/* ===== COMPONENT STYLES ===== */

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--accent-primary-glow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 0 0 80px;
    opacity: 0.08;
}

.stat-card.primary::before {
    background: var(--accent-primary);
}

.stat-card.success::before {
    background: var(--accent-success);
}

.stat-card.warning::before {
    background: var(--accent-warning);
}

.stat-card.danger::before {
    background: var(--accent-danger);
}

.stat-card.info::before {
    background: var(--accent-info);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
}

.stat-icon .material-symbols-rounded {
    font-size: 22px;
    color: white;
}

.stat-icon.primary {
    background: var(--gradient-primary);
}

.stat-icon.success {
    background: var(--gradient-success);
}

.stat-icon.warning {
    background: var(--gradient-warning);
}

.stat-icon.danger {
    background: var(--gradient-danger);
}

.stat-icon.info {
    background: var(--gradient-info);
}

.stat-value {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ===== SECTION CARDS ===== */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: var(--font-md);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title .material-symbols-rounded {
    font-size: 20px;
    color: var(--accent-primary);
}

.section-body {
    padding: var(--space-md);
}

/* ===== DATA TABLE ===== */
.data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== LIST ITEMS ===== */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--bg-tertiary);
}

.list-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    font-size: var(--font-base);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-sub {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.list-item-value {
    font-weight: 700;
    font-size: var(--font-base);
    white-space: nowrap;
    margin-left: var(--space-sm);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
}

.badge-success {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.badge-warning {
    background: var(--accent-warning-bg);
    color: var(--accent-warning);
}

.badge-danger {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

.badge-info {
    background: var(--accent-info-bg);
    color: var(--accent-info);
}

/* ===== SEARCH BAR ===== */
.search-bar {
    position: relative;
    margin-bottom: var(--space-md);
}

.search-bar .material-symbols-rounded {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-base);
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: nowrap;
    /* Strictly no wrap, keep them side-by-side */
}

/* Make sure the right-side actions div can scroll horizontally if needed */
.toolbar>div:not(.section-title) {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    /* affordance for focus states/scrollbars */
    flex-wrap: nowrap;
    /* keep buttons in one line and scroll */
    flex: 1;
    /* Allow taking remaining space */
    justify-content: flex-end;
    /* Push to right initially */
}

.toolbar>div:not(.section-title)::-webkit-scrollbar {
    display: none;
}

.toolbar-spacer {
    flex: 1;
}

/* ===== FILTER CHIPS ===== */
.filter-chips {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-md);
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.filter-chip:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--accent-primary-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary-hover);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
}

.empty-state .material-symbols-rounded {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.empty-state p {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

/* ===== CHART PLACEHOLDER ===== */
.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.chart-bar-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 160px;
    padding: 0 var(--space-sm);
    gap: var(--space-xs);
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    max-width: 60px;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.6s ease;
    position: relative;
}

.chart-bar-label {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.chart-bar-value {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: var(--space-lg) auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== PRODUCT CARDS (Mobile-optimized) ===== */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-fast);
}

.product-card:hover {
    border-color: var(--accent-primary-glow);
}

.product-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.product-card-name {
    font-weight: 600;
    font-size: var(--font-base);
}

.product-card-sku {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.product-card-prices {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.product-card-price {
    display: flex;
    flex-direction: column;
}

.product-card-price .label {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.product-card-price .value {
    font-weight: 700;
    font-size: var(--font-base);
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light);
}

.product-card-actions {
    display: flex;
    gap: var(--space-xs);
}

/* ===== BILLING LAYOUT ===== */
.billing-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.billing-search-container {
    position: relative;
}

/* Cart */
.cart-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: var(--font-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.cart-price-input {
    width: 60px;
    padding: 2px 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--font-xs);
    text-align: center;
    outline: none;
}

.cart-price-input:focus {
    border-color: var(--accent-primary);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.cart-item-qty button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.cart-item-qty button:active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.cart-item-qty span {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    font-size: var(--font-sm);
}

.cart-item-total {
    font-weight: 700;
    font-size: var(--font-sm);
    min-width: 60px;
    text-align: right;
}

.cart-item-remove {
    color: var(--accent-danger);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.cart-item-remove:hover {
    background: var(--accent-danger-bg);
}

.cart-summary {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.cart-summary-row.total {
    font-size: var(--font-lg);
    font-weight: 800;
    color: var(--text-primary);
    padding-top: var(--space-sm);
    margin-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
}

.cart-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.cart-empty .material-symbols-rounded {
    font-size: 40px;
    margin-bottom: var(--space-sm);
    display: block;
}

/* Draft cards */
.draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-sm);
    padding: var(--space-md);
}

.draft-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.draft-card:hover {
    border-color: var(--accent-warning);
    transform: translateY(-1px);
}

.draft-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.draft-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Billing customer form */
.billing-customer-form label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

/* ===== POS / RETAIL BILLING ===== */
.pos-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - 16px);
    overflow: hidden;
}

.pos-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    margin-bottom: var(--space-sm);
    min-height: 44px;
}

.pos-tabs {
    display: flex;
    gap: var(--space-xs);
}

.pos-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pos-tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.pos-tab .material-symbols-rounded {
    font-size: 18px;
}

/* POS Layout: 2 columns on desktop */
.pos-layout {
    display: flex;
    gap: var(--space-md);
    flex: 1;
    overflow: hidden;
}

.pos-left {
    flex: 1.6;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.pos-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 280px;
    max-width: 380px;
    overflow-y: auto;
}

/* POS Search */
.pos-search-wrapper {
    position: relative;
    margin-bottom: var(--space-sm);
}

.pos-search {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.pos-search:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb, 59, 130, 246), 0.1);
}

.pos-search::placeholder {
    color: var(--text-muted);
}

/* Quick Add Grid */
.pos-quick-label {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.pos-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    margin-bottom: var(--space-sm);
}

.pos-quick-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.pos-quick-btn:active {
    transform: scale(0.95);
    border-color: var(--accent-primary);
    background: var(--accent-primary-glow);
}

.pos-quick-btn.in-cart {
    border-color: var(--accent-success);
    background: rgba(21, 128, 61, 0.05);
}

.pos-quick-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.pos-quick-price {
    font-size: 10px;
    color: var(--accent-primary);
    font-weight: 700;
}

.pos-quick-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-success);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* POS Cart List (Left Side Detailed View) */
.pos-cart-list {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.pos-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-muted);
}

.pos-cart-empty .material-symbols-rounded {
    font-size: 40px;
}

.pos-cart-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.pos-cart-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-sm);
    transition: background var(--transition-fast);
}

.pos-cart-row:hover {
    background: var(--bg-tertiary);
}

.pos-cart-col-sr {
    width: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-xs);
}

.pos-cart-col-name {
    flex: 1;
    min-width: 0;
}

.pos-cart-col-price {
    width: 80px;
}

.pos-cart-col-qty {
    width: 100px;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.pos-cart-col-total {
    width: 80px;
    text-align: right;
    font-weight: 700;
}

.pos-cart-col-act {
    width: 30px;
    text-align: center;
}

.pos-item-name {
    font-weight: 600;
    font-size: var(--font-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-item-sku {
    font-size: 10px;
    color: var(--text-muted);
}

.pos-price-input {
    width: 65px;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--font-xs);
    text-align: center;
    outline: none;
}

.pos-price-input:focus {
    border-color: var(--accent-primary);
}

.pos-qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    -webkit-tap-highlight-color: transparent;
}

.pos-qty-btn:active {
    background: var(--accent-primary);
    color: white;
}

.pos-qty-val {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.pos-remove-btn {
    background: none;
    border: none;
    color: var(--accent-danger);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: var(--radius-xs);
    line-height: 1;
}

.pos-remove-btn:hover {
    background: var(--accent-danger-bg);
}

.pos-cart-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--accent-primary-glow);
    border-top: 2px solid var(--accent-primary);
    color: var(--accent-primary-hover);
    font-weight: 700;
    position: sticky;
    bottom: 0;
}

/* POS Summary Card (Right Side) */
.pos-summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.pos-summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 10px var(--space-md);
    background: var(--bg-tertiary);
    font-weight: 700;
    font-size: var(--font-sm);
    border-bottom: 1px solid var(--border-color);
}

.pos-summary-header .material-symbols-rounded {
    font-size: 20px;
    color: var(--accent-primary);
}

.pos-summary-body {
    max-height: 200px;
    overflow-y: auto;
}

.pos-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px var(--space-md);
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-xs);
}

.pos-summary-item-name {
    font-weight: 500;
    display: block;
}

.pos-summary-item-detail {
    color: var(--text-muted);
    font-size: 10px;
}

.pos-summary-item-total {
    font-weight: 700;
    white-space: nowrap;
}

.pos-summary-footer {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    padding: 2px 0;
}

.pos-grand-total {
    font-size: var(--font-xl) !important;
    font-weight: 800 !important;
    color: var(--accent-success) !important;
    padding-top: var(--space-xs) !important;
    margin-top: var(--space-xs);
    border-top: 1px solid var(--border-color);
}

/* POS Checkout Section */
.pos-checkout-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.pos-payment-modes {
    display: flex;
    gap: var(--space-xs);
}

.pos-pay-btn {
    flex: 1;
    padding: 10px 8px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.pos-pay-btn.active {
    background: var(--accent-primary-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary-hover);
}

.pos-pay-btn:active {
    transform: scale(0.97);
}

.pos-customer-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.pos-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.pos-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

/* Receipt line */
.receipt-line {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: var(--font-sm);
}

/* ===== CHART BARS ===== */
.chart-container {
    width: 100%;
    overflow-x: auto;
}

.chart-bar-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    min-width: 100%;
    padding: 0 var(--space-xs);
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 24px;
}

.chart-bar-value {
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 2px;
    white-space: nowrap;
}

.chart-bar {
    width: 100%;
    max-width: 32px;
    background: var(--gradient-primary);
    border-radius: 3px 3px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.chart-bar-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}

/* Search results dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 350px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-lg);
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== DATE RANGE PICKER ===== */
.date-range {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.date-range input[type="date"] {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-sm);
    outline: none;
    color-scheme: light;
}

.date-range input[type="date"]:focus {
    border-color: var(--accent-primary);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .billing-layout {
        display: grid;
        grid-template-columns: 1fr 380px;
        gap: var(--space-lg);
    }

    .product-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: var(--space-md);
    }

    .product-card {
        margin-bottom: 0;
    }
}

/* ===== BADGE PRIMARY ===== */
.badge-primary {
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
}

/* ===== DRAFT CARDS ===== */
.draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-sm);
    padding: var(--space-md);
}

.draft-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid var(--accent-warning);
}

.draft-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-warning);
}

.draft-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.draft-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== CART PRICE INPUT ===== */
.cart-price-input {
    width: 60px;
    padding: 2px 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: var(--font-xs);
    text-align: right;
    outline: none;
}

.cart-price-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

/* Remove number input arrows */
.cart-price-input::-webkit-outer-spin-button,
.cart-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===== OUT OF STOCK ===== */
.search-result-item.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== BTN SUCCESS ===== */
.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ===== CHECKOUT BUTTON ===== */
.btn-checkout {
    font-weight: 700 !important;
    font-size: 16px !important;
    padding: 14px 16px !important;
}

/* ===== PAYMENT OPTIONS - Mobile Friendly ===== */
.payment-options {
    display: flex;
    gap: var(--space-sm);
}

.payment-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 12px 8px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.payment-option.active {
    background: var(--accent-primary-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary-hover);
}

.payment-option:active {
    transform: scale(0.97);
}

/* ===== BILLING CUSTOMER FORM ===== */
.billing-customer-form label {
    display: block;
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.billing-customer-form input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    font-size: 16px;
}

.billing-customer-form input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

/* ===== MOBILE OPTIMIZATIONS (max 767px) ===== */
@media (max-width: 767px) {

    /* Touch-friendly buttons - minimum 44px tap target */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: var(--font-base);
    }

    .btn-sm {
        min-height: 40px;
        padding: 8px 14px;
    }

    .icon-btn {
        min-width: 40px;
        min-height: 40px;
    }

    /* Prevent iOS zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Toolbar stacks on mobile */
    .toolbar {
        gap: var(--space-sm);
    }

    .toolbar .section-title {
        font-size: var(--font-sm);
    }

    /* Stat cards */
    .stat-card {
        padding: var(--space-sm) var(--space-md);
    }

    .stat-value {
        font-size: var(--font-lg);
    }

    /* Filter chips scroll horizontally */
    .filter-chips {
        flex-wrap: nowrap;
        padding-bottom: var(--space-xs);
    }

    .filter-chip {
        padding: 10px 14px;
        font-size: var(--font-sm);
    }

    /* Table cells tighter */
    .data-table th,
    .data-table td {
        padding: 8px 8px;
        font-size: var(--font-xs);
    }

    /* POS Mobile Layout */
    .pos-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .pos-left {
        overflow: visible;
    }

    .pos-right {
        max-width: 100%;
        min-width: auto;
    }

    .pos-cart-col-price {
        display: none;
    }

    .pos-cart-col-sr {
        width: 24px;
    }

    .pos-cart-col-total {
        width: 70px;
    }

    .pos-qty-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .pos-pay-btn {
        padding: 12px 8px;
        font-size: var(--font-base);
    }

    .pos-container {
        height: auto;
        min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 16px);
    }

    /* Customer form stacks on mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    /* Search results taller for easier tapping */
    .search-result-item {
        padding: 12px var(--space-md);
        min-height: 48px;
    }

    /* Modal full-width on mobile */
    .modal-content {
        max-height: 85vh;
        padding: var(--space-md);
    }

    .modal-header h3 {
        font-size: var(--font-lg);
    }

    .modal-actions {
        flex-direction: column;
    }

    /* More menu items taller */
    .more-menu-list li {
        padding: 16px var(--space-md);
        min-height: 48px;
    }

    /* Bottom nav items */
    .bottom-nav-item {
        min-width: 50px;
        padding: 8px 8px;
        font-size: 10px;
    }

    /* Page padding */
    .page {
        padding: var(--space-sm) var(--space-md) calc(var(--bottom-nav-height) + var(--space-md));
    }

    /* Checkout button */
    .btn-checkout {
        min-height: 52px !important;
        font-size: 17px !important;
    }

    /* Report grids stack on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Report 2-column grids stack */
    .section-card+div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Quick product grid */
    .pos-quick-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    /* Billing layout stacks on mobile */
    .billing-layout {
        grid-template-columns: 1fr;
    }

    /* Cart items mobile */
    .cart-item {
        padding: 10px var(--space-sm);
        gap: var(--space-xs);
    }

    .cart-item-qty button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .cart-item-qty span {
        min-width: 28px;
        font-size: var(--font-base);
    }

    /* Payment bigger on mobile */
    .pos-pay-btn {
        padding: 14px 8px;
        font-size: var(--font-base);
    }

    /* Draft grid stacks */
    .draft-grid {
        grid-template-columns: 1fr;
        padding: var(--space-sm);
        gap: var(--space-sm);
    }

    /* Cart summary total */
    .cart-summary-row.total {
        font-size: var(--font-lg);
    }
}