/* Patvegar Tea Billing System - Main Styles */

:root {
    --primary: #337ab7;
    --header-blue: #337ab7;
    --checkout-blue: #5bc0de;
    --success: #5cb85c;
    --danger: #d9534f;
    --sidebar-bg: #2b3338;
    --sidebar-width: 84px;
    --cart-width: 480px;
    --header-height: 72px;
    --main-bg: #d4d4d4;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
}

.billing-page,
.billing-app {
    font-family: 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Billing POS - lock page scroll */
body.billing-page {
    overflow: hidden;
    height: 100vh;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
}
.login-page-pos {
    background: linear-gradient(135deg, #1e5a8a 0%, #337ab7 100%);
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Billing Layout */
.billing-app {
    display: grid;
    grid-template-areas:
        "header header header"
        "sidebar main   cart";
    grid-template-columns: var(--sidebar-width) 1fr var(--cart-width);
    grid-template-rows: var(--header-height) 1fr;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar */
.billing-sidebar {
    grid-area: sidebar;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    z-index: 100;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; width: 100%; padding-top: 8px; }
.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 6px;
    color: #B0BEC5;
    text-decoration: none;
    font-size: 11px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    min-height: 56px;
}
.sidebar-item:hover, .sidebar-item.active {
    color: white;
    background: rgba(255,255,255,0.1);
}
.sidebar-item i { font-size: 24px; margin-bottom: 4px; }
.sidebar-item-transfer { position: relative; }
.sidebar-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.sidebar-logout {
    color: #fff !important;
    background: #c9302c !important;
    margin: 8px 6px;
    border-radius: 4px;
    padding: 12px 5px !important;
    min-height: 56px;
}

/* Header - full width blue bar */
.billing-header {
    grid-area: header;
    background: var(--header-blue);
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    color: white;
    z-index: 200;
    overflow: visible;
    white-space: nowrap;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: white;
    font-weight: 600;
    font-size: 15px;
}
.header-brand i { font-size: 18px; cursor: pointer; opacity: 0.9; }
.header-user-pill {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.35);
    color: white;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
}
.header-search {
    flex: 1 1 auto;
    min-width: 160px;
    max-width: 480px;
}
.header-search input {
    width: 100%;
    height: 48px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    background: white;
    color: #333;
}
.header-search input:focus {
    outline: 2px solid rgba(255,255,255,0.5);
}
.header-right {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: visible;
}
.header-cart-btn {
    position: relative;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}
.header-cart-btn .cart-badge {
    position: absolute;
    top: 0;
    right: 2px;
    background: var(--success);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
}
.header-customer {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    position: relative;
    flex-shrink: 0;
    min-width: 0;
}
.customer-search-wrap {
    position: relative;
    flex: 0 1 380px;
    min-width: 240px;
    max-width: 460px;
    width: 380px;
    z-index: 220;
}
.customer-selected-box {
    position: relative;
    background: white;
    border-radius: 6px;
}
.header-customer input,
#customerSearch {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: none;
    height: 48px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    background: white;
    box-sizing: border-box;
}
.header-customer input.has-customer,
#customerSearch.has-customer {
    padding-right: 48px;
    cursor: pointer;
    font-weight: 600;
}
.selected-customer-info {
    flex-shrink: 0;
    background: #fff;
    color: #222;
    padding: 10px 12px 12px;
    margin: 8px 8px 0;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    white-space: normal;
    line-height: 1.35;
    cursor: pointer;
}
.sel-cust-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.sel-cust-name {
    flex: 1;
    min-width: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    padding-right: 4px;
}
.selected-customer-info .btn-clear-customer {
    position: static;
    transform: none;
    flex-shrink: 0;
}
.sel-cust-mobile {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    padding-top: 2px;
}
.sel-cust-item {
    font-size: 14px;
    font-weight: 600;
    margin-top: 6px;
    font-family: 'Noto Sans Devanagari', sans-serif;
}
.sel-cust-type {
    font-size: 14px;
    color: #444;
    margin-top: 2px;
}
.sel-cust-when {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}
.sel-cust-points {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #eee;
    font-size: 15px;
    font-weight: 700;
    color: #2e7d32;
}
.sel-cust-points.is-negative {
    color: #c62828;
}
.btn-clear-customer {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: #e53935;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}
.btn-clear-customer:hover { background: #c62828; }
.header-customer input::placeholder,
#customerSearch::placeholder,
.header-search input::placeholder {
    font-size: 17px;
    color: #888;
}
.btn-add-customer {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-add-customer:hover { background: rgba(255,255,255,0.3); }

/* Main Content */
.billing-main {
    grid-area: main;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    background: var(--main-bg);
}

.view-panel {
    height: 100%;
    min-height: 0;
}

/* Dashboard View */
.dashboard-view { display: grid; grid-template-rows: auto 1fr; gap: 15px; height: 100%; min-height: 0; }
.dashboard-top {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 15px;
}
.profile-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #757575;
}
.profile-info h5 { margin: 0 0 5px; font-size: 16px; }
.profile-info p { margin: 0; font-size: 12px; color: #757575; }
.sales-chart {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.sales-chart h6 { margin: 0 0 10px; color: #757575; }

/* Navigation Grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.nav-tile {
    background: white;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}
.nav-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.nav-tile i {
    font-size: 36px;
    color: var(--success);
    margin-bottom: 10px;
}
.nav-tile span {
    display: block;
    color: var(--primary);
    font-weight: 500;
}
.nav-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.stock-transfer-heading {
    font-size: 15px;
    font-weight: 700;
    margin: 8px 0 10px;
    color: #333;
}
.stock-transfer-branch {
    margin: -6px 0 14px;
    color: #666;
    font-size: 14px;
}
.stock-transfer-accept {
    min-width: 88px;
    font-weight: 600;
}
.transfer-detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 16px;
}
.transfer-detail-meta span {
    display: block;
    color: #757575;
    font-size: 13px;
}
.transfer-detail-meta strong {
    font-size: 16px;
}

/* Products Grid */
.products-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--main-bg);
}
.products-topbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--main-bg);
    gap: 10px;
    flex-shrink: 0;
}
.btn-home {
    background: none;
    border: none;
    color: #c9302c;
    font-size: 28px;
    padding: 8px;
    cursor: pointer;
    line-height: 1;
    min-width: 48px;
    min-height: 48px;
}
.category-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
}
.category-tab {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 16px 16px;
    text-align: center;
    font-size: 16px;
    min-height: 52px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.category-tab:hover { border-color: var(--header-blue); }
.category-tab.active {
    border-color: var(--header-blue);
    background: #eef4fb;
    color: var(--header-blue);
    font-weight: 600;
}
.products-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 8px;
    min-height: 0;
}
.products-header {
    display: none;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.product-card {
    background: white;
    border: 1px solid #bbb;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.product-card:hover {
    border-color: var(--header-blue);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.product-stock {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #f0ad4e;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    z-index: 1;
}
.product-stock-oos {
    background: #c62828;
}
.product-card-oos {
    opacity: 0.55;
}
.product-card-oos .product-image img,
.product-card-oos .product-image i {
    filter: grayscale(1);
}
.variant-item-oos {
    opacity: 0.55;
    cursor: not-allowed;
}
.product-image {
    height: 176px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}
.product-image img {
    max-width: 94%;
    max-height: 94%;
    object-fit: contain;
}
.product-image i { font-size: 72px; color: #ccc; }
.product-card-custom-gift {
    border-style: dashed;
    border-color: #2e7d32;
    background: #f4faf4;
}
.product-card-custom-gift .product-image i {
    color: #2e7d32;
}
.product-card-custom-gift .product-price {
    color: #1b5e20;
}
.product-card-custom-gift:hover {
    border-color: #1b5e20;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.18);
}
.custom-gift-modal { max-width: 440px; }
.custom-gift-label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin: 0 0 6px;
    color: #333;
}
.custom-gift-label + .custom-gift-input + .custom-gift-label {
    margin-top: 16px;
}
.custom-gift-input {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 18px;
}
.custom-gift-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}
.custom-gift-hint {
    margin: 12px 0 0;
    font-size: 14px;
    color: #666;
}
.product-price {
    padding: 10px 10px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.products-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-top: 1px solid #ccc;
    flex-shrink: 0;
}
.products-footer-left { color: #555; font-size: 18px; }
.products-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}
.products-pagination button {
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 16px;
    min-height: 44px;
    min-width: 44px;
}
.products-pagination button:hover { background: #f5f5f5; }

/* Cart Panel */
.cart-panel {
    grid-area: cart;
    width: var(--cart-width);
    min-width: var(--cart-width);
    min-height: 0;
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cart-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px 8px;
}
.cart-item {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: 20px; line-height: 1.3; }
.cart-item-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.cart-item-meta { font-size: 15px; color: #757575; }
.cart-qty-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cart-qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.cart-qty-btn:hover { background: #e8e8e8; border-color: #999; }
.cart-qty-value {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
}
.cart-item-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.cart-price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    white-space: nowrap;
}
.cart-item-price { font-weight: 700; font-size: 22px; color: var(--primary); white-space: nowrap; }
.cart-item-remove {
    color: var(--danger);
    cursor: pointer;
    padding: 6px 8px;
    font-size: 22px;
    line-height: 1;
}
.cart-actions {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
}
.cart-actions button {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    color: #555;
    white-space: nowrap;
    min-width: 0;
}
.cart-actions #btnCartMore {
    flex: 0 0 32px;
    padding: 8px;
}
.cart-actions .btn-add {
    background: var(--success);
    color: white;
    border-color: var(--success);
    font-weight: 600;
}
/* Cart bottom — tablet-sized totals, payment, checkout */
.cart-bottom {
    flex-shrink: 0;
    border-top: 1px solid #ddd;
    background: #fafafa;
}
.cart-totals-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 14px 14px;
    font-size: 18px;
    color: #555;
}
.cart-totals-line b { color: #222; font-weight: 700; font-size: 22px; }
.cart-total-pay { margin-left: auto; font-weight: 700; }
.cart-total-pay b { color: var(--primary); font-size: 24px; }
.cart-points-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 18px;
    font-weight: 600;
    border-top: 1px dashed #e0e0e0;
}
.cart-points-line input {
    width: 72px;
    height: 44px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 700;
    text-align: right;
}
.cart-points-line small {
    color: #2e7d32;
    margin-left: auto;
    white-space: nowrap;
    font-size: 18px;
    font-weight: 700;
}
.btn-use-all-points {
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 700;
    border: 1px solid var(--success);
    background: #E8F5E9;
    color: var(--success);
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
}
.cart-pay-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    padding: 12px 12px 14px;
    background: white;
    border-top: 1px solid #eee;
}
.cart-pay-footer button {
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    min-height: 68px;
}
.cart-pay-methods {
    display: flex;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}
.cart-pay-methods .cart-pay-btn {
    flex: 1;
    flex-direction: row;
    padding: 12px 16px;
    font-size: 18px;
    gap: 8px;
    border-width: 2px;
    border-radius: 8px;
    min-height: 68px;
}
.cart-pay-methods .cart-pay-btn i { font-size: 26px; }
.cart-pay-footer .btn-clear {
    padding: 12px 16px;
    font-size: 26px;
    flex-shrink: 0;
    min-width: 68px;
}
.btn-clear { color: var(--danger); border-color: #ccc !important; }
.cart-pay-footer .btn-checkout {
    flex: 1 1 100%;
    width: 100%;
    min-width: 100%;
    padding: 14px 16px;
    background: var(--checkout-blue) !important;
    border: none !important;
    color: white;
    font-weight: 700;
    font-size: 28px !important;
    border-radius: 8px !important;
    min-height: 68px;
}
.btn-checkout:disabled {
    background: #b0bec5 !important;
    cursor: not-allowed;
    opacity: 0.85;
}
.cart-points-only-note {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    padding: 4px 8px;
    background: #E8F5E9;
    border-radius: 4px;
    flex-shrink: 0;
}
.cart-pay-btn {
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    transition: all 0.15s;
}
.cart-pay-btn[data-method="cash"] i { color: var(--success); }
.cart-pay-btn[data-method="online"] i { color: var(--primary); }
.cart-pay-btn.active {
    border-color: var(--primary);
    background: #E3F2FD;
    color: var(--primary);
}

#customerSearch.customer-required {
    outline: 2px solid #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.25);
}
.cart-customer-warning {
    background: #fff3e0;
    color: #e65100;
    padding: 6px 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}
.cart-customer-warning i { margin-right: 4px; }

/* Customer Search Dropdown */
.customer-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 9999;
    display: none;
    color: #333;
}
.customer-dropdown.show { display: block; }
.customer-dropdown-loading,
.customer-dropdown-title {
    padding: 10px 15px;
    font-size: 12px;
    color: #757575;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}
.customer-dropdown-loading { text-align: center; }
.customer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.customer-item:hover { background: #f5f5f5; }
.customer-details { flex: 1; min-width: 0; }
.customer-name { font-weight: 600; font-size: 14px; }
.customer-meta { font-size: 12px; color: #757575; margin-top: 2px; }
.customer-benefit {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 4px;
}
.customer-benefit.benefit-points { background: #E8F5E9; color: #2E7D32; }
.customer-benefit.benefit-points.is-negative { background: #FFEBEE; color: #c62828; }
.customer-benefit.benefit-discount { background: #FFF3E0; color: #E65100; }

/* Payment modal */
.payment-modal { max-width: 420px; }
.payment-total {
    font-size: 36px;
    font-weight: 700;
    color: var(--checkout-blue);
    margin: 10px 0 20px;
}
.payment-method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
}
.payment-method-btn i { font-size: 28px; }
.payment-method-btn:hover { border-color: var(--primary); background: #f5f9fc; }
.payment-cash i { color: var(--success); }
.payment-online i { color: var(--primary); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.show { display: flex; }
.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.customer-detail-modal { max-width: 520px; }
.customer-detail-list {
    margin: 0 0 18px;
    display: grid;
    gap: 10px;
}
.customer-detail-list > div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px;
    font-size: 16px;
    align-items: start;
}
.customer-detail-list dt {
    margin: 0;
    color: #757575;
    font-weight: 500;
}
.customer-detail-list dd {
    margin: 0;
    font-weight: 600;
    color: #222;
    word-break: break-word;
}
.customer-detail-heading {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}
.customer-last-purchase {
    background: #f5f9fc;
    border: 1px solid #d6e6f3;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.customer-last-when {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.customer-last-order {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}
.customer-last-items {
    margin: 0;
    padding: 0;
    list-style: none;
}
.customer-last-items li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 16px;
    padding: 4px 0;
    border-top: 1px solid #e4eef6;
}
.customer-last-items li:first-child { border-top: 0; }
.customer-detail-empty {
    color: #888;
    margin: 0 0 16px;
}
.btn-view-all-txns {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--primary);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.customer-history-meta {
    font-size: 13px;
    color: #757575;
    margin-top: 4px;
}
.modal-content-wide {
    max-width: min(1200px, 96vw);
    width: 96vw;
}
.customer-history-body { padding: 16px 20px; }
.customer-history-tabs {
    display: flex;
    gap: 8px;
    margin: 14px 0 12px;
    border-bottom: 2px solid #e8e8e8;
}
.customer-history-tab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    min-height: 44px;
}
.customer-history-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.customer-history-panel { display: none; }
.customer-history-panel.active { display: block; }
.customer-history-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 13px;
}
.customer-stat strong { color: var(--primary); }
.customer-stat.is-negative,
.customer-stat.is-negative strong { color: #c62828; }
.customer-history-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.customer-name-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-size: inherit;
}
.customer-name-link:hover { text-decoration: underline; }
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h5 { margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #757575;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Variant Selection Modal */
.variant-modal {
    max-width: 960px;
    width: 94%;
}
.variant-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.variant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.variant-item:hover, .variant-item.selected {
    border-color: var(--primary);
    background: #E3F2FD;
}
.variant-weight { font-weight: 600; font-size: 16px; }
.variant-price { color: var(--primary); font-weight: 700; font-size: 18px; white-space: nowrap; }
.variant-stock { font-size: 13px; color: #757575; }
.variant-points { font-size: 12px; color: var(--success); }

/* Settings View */
.settings-list { background: white; border-radius: 8px; }
.setting-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}
.setting-item:last-child { border-bottom: none; }
.setting-toggle {
    width: 50px;
    height: 28px;
    background: #ccc;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    margin-right: 15px;
    transition: background 0.3s;
}
.setting-toggle.active { background: #E91E63; }
.setting-toggle::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}
.setting-toggle.active::after { transform: translateX(22px); }
.setting-label { flex: 1; font-size: 15px; }
.setting-item-action { justify-content: space-between; gap: 12px; }
.setting-action-copy { flex: 1; min-width: 0; }
.setting-action-copy .setting-label { display: block; }
.setting-hint { display: block; margin-top: 4px; font-size: 12px; color: #757575; }

.order-success-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    z-index: 10000;
    padding: 16px;
}
.order-success-overlay.show { display: flex; }
.order-success-card {
    background: #fff;
    border-radius: 10px;
    min-width: 220px;
    max-width: 280px;
    padding: 16px 20px 14px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.order-success-card > i {
    font-size: 32px;
    color: #2e7d32;
    line-height: 1;
    display: block;
    margin-bottom: 6px;
}
.order-success-title {
    font-size: 18px;
    font-weight: 700;
    color: #1b5e20;
    line-height: 1.2;
}
.order-success-meta {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

/* Reports Table */
.report-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}
.report-table th, .report-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}
.report-table th:first-child, .report-table td:first-child { text-align: left; }
.report-table th { background: #fafafa; color: #757575; font-weight: 500; }
.report-table tr.total-row { font-weight: 700; background: #f5f5f5; }

/* Billing sub-views (Orders, Transactions, etc.) */
.billing-subview {
    padding: 15px;
    height: 100%;
    overflow-y: auto;
    background: #f5f5f5;
}
.billing-subview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}
.billing-table-wrap {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
}
.billing-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.billing-data-table th,
.billing-data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
}
.billing-data-table th {
    background: #fafafa;
    color: #757575;
    font-weight: 600;
    white-space: nowrap;
}
.billing-data-table tr:hover td { background: #fafafa; }
.billing-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.billing-badge-cash { background: #E8F5E9; color: #2E7D32; }
.billing-badge-online { background: #E3F2FD; color: #1565C0; }
.billing-badge-custom { background: #F3E5F5; color: #6A1B9A; }
.billing-badge-sale { background: #E8F5E9; color: #2E7D32; }
.billing-badge-refund { background: #FFEBEE; color: #C62828; }

.txn-ledger-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.txn-ledger-total {
    flex: 1;
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    color: #1565C0;
    line-height: 1.1;
    letter-spacing: 0.02em;
}
.txn-ledger-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.txn-ledger-actions .btn-link { color: #1565C0; }
.txn-ledger-table th { background: #eee; color: #222; }
.txn-ledger-table .txn-out { color: #c62828; font-weight: 600; }
.txn-ledger-table .txn-in { font-weight: 600; }
.txn-add-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
    min-height: 40px;
}
.txn-add-header h5 {
    font-weight: 700;
    font-size: 22px;
}
.txn-back-btn {
    position: absolute;
    left: 0;
    background: #c62828;
    color: #fff;
    border: none;
    padding: 6px 16px;
}
.txn-back-btn:hover { background: #b71c1c; color: #fff; }
.txn-add-form {
    background: #fff;
    padding: 24px 20px 16px;
    border-radius: 4px;
    min-height: 280px;
}
.txn-add-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}
.txn-add-form label span {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}
.txn-add-form input,
.txn-add-form textarea {
    width: 100%;
    border: none;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    padding: 6px 0;
    background: transparent;
    outline: none;
}
.txn-add-form input:focus,
.txn-add-form textarea:focus { border-bottom-color: #1565C0; }
.txn-add-reason { display: block; margin-bottom: 24px; }
.txn-add-footer { display: flex; justify-content: flex-end; }
.txn-save-btn {
    background: #1565C0;
    color: #fff;
    border: none;
    padding: 8px 22px;
}
.txn-save-btn:hover { background: #0d47a1; color: #fff; }

/* Admin Panel */
body:has(.admin-layout) {
    overflow: hidden;
    height: 100vh;
    background: #f4f6f8;
}
body.admin-nav-lock { overflow: hidden; }

.admin-layout {
    --admin-sidebar: 264px;
    --admin-accent: #2e7d32;
    --admin-ink: #0f172a;
    display: grid;
    grid-template-columns: var(--admin-sidebar) 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    height: 100vh;
    overflow: hidden;
    background: #f4f6f8;
    color: #1e2937;
}
.admin-backdrop {
    display: none;
}
.admin-sidebar {
    grid-area: sidebar;
    background: #0f172a;
    color: white;
    padding: 18px 12px 20px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    contain: layout style;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.admin-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--admin-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.admin-brand strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
}
.admin-brand small {
    display: block;
    color: #94a3b8;
    font-size: 12px;
}
.admin-sidebar h4 {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}
.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.admin-nav a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}
.admin-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.admin-nav a.active {
    background: rgba(46, 125, 50, 0.22);
    color: #86efac;
}
.admin-nav-sep {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 8px;
}
.admin-topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #e8edf2;
}
.admin-menu-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 22px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-topbar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--admin-ink);
    flex: 1;
    min-width: 0;
}
.admin-topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}
.admin-topbar-logout {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #f8fafc;
    text-decoration: none;
}
.admin-topbar-logout:hover { color: #b91c1c; background: #fef2f2; }
.admin-main {
    grid-area: main;
    padding: 22px 24px 28px;
    background: #f4f6f8;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}
.admin-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--admin-ink);
}
.admin-header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.admin-header-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    flex-wrap: wrap;
}
.admin-header-search {
    position: relative;
}
.admin-header-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
    pointer-events: none;
}
.admin-header-search .form-control {
    width: 240px;
    padding-left: 32px;
}
.admin-header-filter .form-select {
    width: auto;
    min-width: 160px;
    max-width: 220px;
}
.admin-header-filter-lg {
    gap: 12px;
}
.admin-header-filter-lg .admin-header-search .form-control {
    width: 380px;
    min-height: 52px;
    font-size: 17px;
    padding-left: 42px;
}
.admin-header-filter-lg .admin-header-search i {
    left: 14px;
    font-size: 18px;
}
.admin-header-filter-lg .form-select {
    min-width: 200px;
    max-width: 280px;
    min-height: 52px;
    font-size: 17px;
}
.admin-header-filter-lg label {
    font-size: 15px;
    font-weight: 600;
}
.admin-date-filter {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    min-width: 0;
}
.admin-date-filter label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.admin-date-filter input[type="date"] {
    width: 150px;
    height: 40px;
    border: 1px solid #dbe3ea;
    border-radius: 10px;
    padding: 0 8px;
    background: #fff;
}
.admin-date-filter .btn {
    height: 40px;
    flex-shrink: 0;
}
.admin-date-filter .admin-header-search .form-control {
    width: 220px;
    height: 40px;
    padding-left: 34px;
}
.admin-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #e8edf2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.admin-card-flush {
    padding: 0;
    overflow: hidden;
}
.admin-card-flush .table {
    margin-bottom: 0;
}
.admin-card-flush .table thead th {
    background: #f8f9fa;
    font-size: 0.8125rem;
    border-bottom: 1px solid #dee2e6;
}
.admin-card-flush .table td,
.admin-card-flush .table th {
    padding: 0.65rem 1rem;
}
.admin-toolbar {
    padding: 0;
}
.admin-toolbar .form-label {
    font-weight: 500;
}
.admin-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}
.admin-thumb-placeholder {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 6px;
    color: #bbb;
    font-size: 20px;
}
.admin-image-preview img {
    max-width: 100%;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.admin-actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Product modal — wide layout, no horizontal scroll */
.modal-product-dialog {
    max-width: 920px !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.modal-product-content {
    overflow: hidden;
    max-width: 100%;
    font-size: calc(1rem + 3px);
}
.modal-product-content .modal-title {
    font-size: calc(1.25rem + 3px);
}
.modal-product-content .btn {
    font-size: calc(1rem + 3px);
}
.modal-product-content .form-check-label {
    font-size: calc(1rem + 3px);
}
.modal-product-content .modal-body {
    padding: 0.75rem 1.25rem 1rem;
    overflow-x: hidden;
    overflow-y: visible;
}
.modal-product-content .modal-header,
.modal-product-content .modal-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.product-modal-form {
    max-width: 100%;
    overflow: hidden;
}
.product-modal-top {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 12px;
    max-width: 100%;
}
.product-modal-top-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pm-inline-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) auto;
    gap: 10px 12px;
    align-items: end;
}
.pm-field-active {
    padding-bottom: 0.45rem;
    white-space: nowrap;
}
.pm-field-active .form-check {
    margin: 0;
}
.pm-field-file {
    min-width: 0;
}
.pm-field-file .pm-file-input {
    width: 100%;
    max-width: 100%;
}
.product-modal-form .form-label {
    font-size: calc(0.8125rem + 3px);
    font-weight: 500;
    color: #555;
    margin-bottom: 0.2rem;
}
.product-modal-form .form-control,
.product-modal-form .form-select {
    font-size: calc(0.875rem + 3px);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.product-modal-form input[name="name"] {
    font-family: 'Noto Sans Devanagari', sans-serif;
}
.product-modal-form .product-image-box {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    align-self: center;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-modal-form .product-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-modal-form .product-image-placeholder {
    color: #ced4da;
    font-size: calc(1.5rem + 3px);
}
.product-modal-pricing {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 14px;
    max-width: 100%;
    overflow: hidden;
}
.product-modal-pricing-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.product-modal-pricing-head span {
    font-size: calc(0.75rem + 3px);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #666;
}
.product-modal-pricing-head a {
    font-size: calc(0.8125rem + 3px);
    color: var(--primary);
    text-decoration: none;
}
.variant-price-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
    max-width: 100%;
}
.vpm-scroll {
    overflow-x: auto;
    max-width: 100%;
    margin: 0 -2px;
    padding: 0 2px;
}
.variant-price-matrix {
    display: grid;
    gap: 6px 8px;
    align-items: center;
    width: 100%;
    min-width: calc(56px + var(--vpm-cols, 3) * 84px);
    grid-template-columns: 56px repeat(var(--vpm-cols, 3), minmax(76px, 1fr));
}
.vpm-corner {
    min-height: 1px;
}
.vpm-col-head {
    text-align: center;
    font-size: calc(0.75rem + 3px);
    font-weight: 600;
    color: #444;
    font-family: 'Noto Sans Devanagari', sans-serif;
    padding: 0 4px;
    line-height: 1.25;
    word-break: break-word;
}
.vpm-row-head {
    font-size: calc(0.8125rem + 3px);
    font-weight: 700;
    color: #333;
    text-align: right;
    padding-right: 6px;
    white-space: nowrap;
    font-family: 'Noto Sans Devanagari', sans-serif;
}
.variant-price-matrix .variant-price-cell {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 6px;
    min-width: 0;
}
.variant-price-matrix .variant-price-cell .input-group {
    flex-wrap: nowrap;
}
.variant-price-matrix .variant-price-cell .form-control {
    min-width: 0;
    font-size: calc(0.8125rem + 3px);
    padding: 0.25rem 0.375rem;
}
.variant-price-matrix .variant-price-cell .input-group-text {
    font-size: calc(0.8125rem + 3px);
    padding: 0.25rem 0.4rem;
}
.variety-name-cell,
.variety-name-input {
    font-family: 'Noto Sans Devanagari', sans-serif;
}
.stock-qty-input {
    width: 90px;
    min-width: 70px;
}
.stock-filters .form-label {
    margin-bottom: 0.15rem;
}
.variant-price-cell {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}
.variant-price-name {
    font-weight: 700;
    font-size: calc(0.9375rem + 3px);
    color: #222;
    margin-bottom: 0;
}
.variant-price-cell .input-group {
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
}
.variant-price-cell .form-control {
    font-size: calc(0.9375rem + 3px);
    font-weight: 600;
}
.variant-extra-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #dee2e6;
}
.variant-extra-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.variant-extra-row .input-group {
    max-width: 200px;
}
.variant-extra-label-text {
    min-width: 120px;
    font-weight: 500;
    font-size: calc(0.875rem + 3px);
}

.admin-stat-card {
    text-align: center;
    padding: 22px 16px;
}
.admin-stat-card h2 {
    font-weight: 800;
    letter-spacing: -0.03em;
}
.admin-layout .table {
    --bs-table-bg: transparent;
}
.admin-layout .table thead th {
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    border-bottom-color: #e8edf2;
}
.admin-layout .btn-success {
    background: #2e7d32;
    border-color: #2e7d32;
}
.admin-layout .form-control,
.admin-layout .form-select {
    border-color: #dbe3ea;
    border-radius: 10px;
}

@media (max-width: 991px) {
    .admin-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 60px 1fr;
        grid-template-areas:
            "topbar"
            "main";
    }
    .admin-menu-btn { display: flex; }
    .admin-topbar { padding: 0 12px; }
    .admin-topbar-title { font-size: 16px; }
    .admin-topbar-user span { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(280px, 86vw);
        height: 100%;
        z-index: 1200;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: none;
    }
    .admin-layout.sidebar-open .admin-sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 28px rgba(15, 23, 42, 0.18);
    }
    .admin-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .admin-layout.sidebar-open .admin-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .admin-main { padding: 14px 12px 24px; }
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-header .btn:not(.admin-date-filter .btn),
    .admin-header > div { width: 100%; }
    .admin-date-filter {
        width: 100%;
        overflow-x: auto;
    }
    .admin-date-filter .btn { width: auto; }
    .admin-header-filter,
    .admin-header-filter-lg {
        width: 100%;
    }
    .admin-header-search,
    .admin-header-search .form-control,
    .admin-header-filter-lg .admin-header-search .form-control {
        width: 100%;
        max-width: none;
    }
    .admin-header-filter .form-select,
    .admin-header-filter-lg .form-select {
        min-width: 0;
        max-width: none;
        flex: 1 1 140px;
    }
    .admin-header-filter-lg .form-select,
    .admin-header-filter-lg .admin-header-search .form-control {
        min-height: 46px;
        font-size: 16px;
    }
    .modal-product-dialog {
        max-width: calc(100vw - 16px) !important;
        margin: 8px;
    }
}
.customer-name-link {
    color: var(--primary);
    text-decoration: none;
}
.customer-name-link:hover {
    text-decoration: underline;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #FF5722;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    display: none;
    z-index: 3000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.offline-indicator.show { display: block; }

/* Responsive Tablet */
@media (max-width: 1024px) {
    .nav-grid { grid-template-columns: repeat(3, 1fr); }
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .dashboard-top { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .billing-app {
        grid-template-areas:
            "header header"
            "sidebar main";
        grid-template-columns: var(--sidebar-width) 1fr;
        grid-template-rows: var(--header-height) 1fr;
    }
    .header-search { display: none; }
    .header-brand { display: none; }
    .header-user-pill { display: none; }
    .header-right {
        flex: 1;
        margin-left: 0;
        flex-wrap: nowrap;
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }
    .header-cart-btn { flex-shrink: 0; }
    .header-customer {
        flex: 1;
        min-width: 0;
        flex-wrap: nowrap;
        display: flex;
        align-items: center;
    }
    .customer-search-wrap {
        flex: 1;
        width: auto;
        min-width: 0;
        max-width: none;
    }
    .header-customer input,
    #customerSearch {
        width: 100%;
        min-width: 0;
        max-width: none;
        flex: none;
    }
    .cart-panel {
        position: fixed;
        top: 0;
        right: -100%;
        width: var(--cart-width);
        max-width: min(var(--cart-width), 95vw);
        height: 100vh;
        transition: right 0.3s;
        z-index: 500;
        grid-area: unset;
    }
    .cart-panel.open { right: 0; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .nav-grid { grid-template-columns: repeat(2, 1fr); }
}
