@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ============================================================
   THEME TOKEN SYSTEM — Caffeine
   All components MUST use these variables only.
   ============================================================ */

:root {
    /* ===== CLASSIC ENTERPRISE POS THEME — Caffeine ===== */

    /* — Core grays (desk application window chrome) — */
    --bg-secondary:     #ece9d8;   /* panel face */
    --bg-tertiary:      #c8c4bc;   /* toolbar trough */
    --bg-card:          #f0ede4;   /* raised panel */
    --bg-surface:       #e8e4d8;
    --bg-surface-md:    #dedad0;

    /* — Text — */
    --text-primary:   #1a1a18;
    --text-secondary: #3a3830;
    --text-muted:     #6a6860;
    --text-on-accent: #ffffff;
    --text-accent:    #2a7230;   /* enterprise green */

    /* — Accent: enterprise green + amber warnings — */
    --accent-primary:   #2a7230;   /* POS green */
    --accent-secondary: #3d9e48;
    --accent-warm:      #c87000;
    --accent-green:     #2a7230;

    /* — Semantic status — */
    --color-success: #217a28;
    --color-danger:  #b82000;
    --color-warning: #c07800;
    --color-info:    #2060a0;
    --color-purple:  #5040a0;
    --color-accent-primary: #2a7230;

    /* — Separator / shadow — */
    --separator-color:  rgba(0,0,0,0.22);
    --border-subtle:    rgba(255,255,255,0.80);
    --border-color:     rgba(0,0,0,0.30);
    --border-input:     rgba(0,0,0,0.45);
    --border-header:    rgba(0,0,0,0.45);

    /* — Status aliases — */
    --system-red:    #b82000;
    --system-green:  #217a28;

    /* — Semantic background tokens — */
    --bg-input:       linear-gradient(180deg, #b8b4ac 0%, #d8d4cc 6%, #f0ede4 100%);
    --bg-input-focus: linear-gradient(180deg, #a0a098 0%, #c4c0b8 6%, #e0dcd4 100%);
    --bg-modal:       linear-gradient(180deg, #ece9e0 0%, #d8d4cc 100%);
    --bg-stat-card:   linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    --bg-notification-panel: linear-gradient(180deg, #f0ede4 0%, #dedad0 100%);

    /* — Button tokens — */
    --btn-default-bg:     linear-gradient(180deg, #f0ede4 0%, #dedad0 45%, #c8c4bc 50%, #dedad0 100%);
    --btn-default-color:  #1a1a18;
    --btn-active-bg:      linear-gradient(180deg, #3d9e48 0%, #2a7230 45%, #1e5824 50%, #287034 100%);
    --btn-active-color:   #ffffff;
    --btn-active-border:  #1a4a1e;
    --btn-cancel-bg:      linear-gradient(180deg, #e4e0d8 0%, #ccc8c0 100%);
    --btn-cancel-color:   #4a4840;

}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== ENTERPRISE BODY ===== */
body {
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    background-color: #a8a49c;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.025) 3px, rgba(0,0,0,0.025) 6px),
        linear-gradient(135deg, #c0bbb0 0%, #b4b0a8 40%, #a8a49c 70%, #b8b4ac 100%);
    background-attachment: fixed;
    color: #1a1a18;
    font-size: 14px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
input, textarea, select { -webkit-user-select: auto; user-select: auto; }

/* ======== HEADER — Enterprise toolbar bar ======== */
.header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #dedad2 0%, #c8c4bc 40%, #a8a49c 52%, #bbb8b0 100%);
    border-radius: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(0,0,0,0.42);
    border-top: 1px solid rgba(255,255,255,0.60);
    border-bottom: 1px solid rgba(0,0,0,0.55);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.55) inset,
        0 -1px 0 rgba(0,0,0,0.18) inset,
        0 3px 8px rgba(0,0,0,0.40),
        0 1px 2px rgba(0,0,0,0.20);
    position: sticky;
    top: 8px;
    z-index: 200;
    gap: 14px;
    min-height: 48px;
    flex-wrap: wrap;
    row-gap: 8px;
    overflow: visible;
}
.header h1 {
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.7); }
}
.header .active-tables-header { display: none; }
.header .active-tables-section {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}
.header .active-tables-list {
    padding: 8px 8px 4px 2px !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.header .active-tables-list::-webkit-scrollbar { display: none; }
#license-days-badge { color: #000 !important; }

/* Header New Order + dropdown */
.header-ordtype-wrapper { position: relative; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-ordtype-wrapper .new-order-btn { padding: 7px 12px; font-size: 0.82em; white-space: nowrap; }
.order-type-caret-btn {
    background: linear-gradient(180deg, #f0ede4 0%, #dedad0 45%, #c8c4bc 50%, #dedad0 100%);
    border: 1px solid rgba(0,0,0,0.38);
    border-top: 1px solid rgba(255,255,255,0.55);
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 0.8em;
    font-weight: 700;
    color: #1a1a18;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255,255,255,0.60) inset, 0 -1px 0 rgba(0,0,0,0.14) inset, 0 2px 4px rgba(0,0,0,0.22);
    text-shadow: 0 1px 0 rgba(255,255,255,0.70);
}
.header-ordtype-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: linear-gradient(180deg, #f0ede4 0%, #e8e4d8 100%);
    border: 1px solid rgba(0,0,0,0.45);
    border-top: 1px solid rgba(255,255,255,0.50);
    border-radius: 6px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.50) inset, 2px 4px 14px rgba(0,0,0,0.50);
    padding: 4px;
    flex-direction: column;
    gap: 3px;
    z-index: 400;
    min-width: 160px;
}
.header-ordtype-dropdown.show { display: flex; }
.header-ordtype-dropdown .order-type-btn { width: 100%; text-align: left; white-space: nowrap; }

/* ===== QUANTITY BUTTONS ===== */
.quantity-display {
    box-shadow: 0 1px 2px rgba(0,0,0,0.20) inset;
}

/* ===== TABLE ITEMS ===== */
.table-number { text-shadow: 0 1px 0 rgba(255,255,255,0.60); }

/* ===== MENU SECTION ===== */
.active-tables-section {
    box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 2px 5px rgba(0,0,0,0.18);
}
.active-tables-header { text-shadow: 0 1px 0 rgba(255,255,255,0.60); }
.active-table-btn {
    text-shadow: 0 1px 1px rgba(0,0,0,0.40);
    box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 2px 4px rgba(0,0,0,0.25);
}
.notification-badge {
    border: 1px solid rgba(0,0,0,0.30);
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* ===== MENU CARDS ===== */
.menu-item .item-name { text-shadow: 0 1px 0 rgba(255,255,255,0.55); }

/* Flying animation */

/* ===== CART — inset panel ===== */
.selected-table-info h4 { font-weight: 700; }
.cart-item-name { text-shadow: 0 1px 0 rgba(255,255,255,0.55); }
.cart-item-note {
    box-shadow: 0 1px 2px rgba(0,0,0,0.18) inset;
}
.discount-section h4 { font-weight: 700; }
.cart-summary {
    box-shadow: 0 1px 0 rgba(255,255,255,0.50) inset, 0 1px 3px rgba(0,0,0,0.14);
}

/* Cart Total — enterprise green bar */
.cart-total {
    text-shadow: 0 1px 2px rgba(0,0,0,0.40);
    box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 2px 5px rgba(0,0,0,0.28);
}
#splitBillBtn {
    border: 1px solid #804800;
    border-top: 1px solid rgba(255,255,255,0.18);
    text-shadow: 0 1px 1px rgba(0,0,0,0.40);
    box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 2px 4px rgba(0,0,0,0.28);
}

/* ===== HISTORY & GENERIC SECTIONS ===== */
.history-actions-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.history-actions-row .nav-btn { padding: 9px 14px; font-size: 0.88em; white-space: nowrap; }
.history-actions-row #history-order-search { flex: 1 1 180px; min-width: 140px; font-size: 0.9em; }
.history-filters { padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.history-filters:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
#historyFiltersModal .history-filters { justify-content: flex-start; }
#historyFiltersModal .history-filters-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
#historyFiltersModal .history-filters { flex-direction: column; align-items: stretch; border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
#historyFiltersModal .history-filters .filter-btn,
#historyFiltersModal .history-filters .payment-filter-btn,
#historyFiltersModal .history-filters .date-filter-btn { width: 100%; text-align: center; }
@media (max-width: 900px) {
    #historyFiltersModal .history-filters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    #historyFiltersModal .history-filters-grid { grid-template-columns: 1fr; }
}
.date-input {
    box-shadow: 0 1px 3px rgba(0,0,0,0.18) inset;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}
.stat-value { text-shadow: 0 1px 0 rgba(255,255,255,0.55); }
.history-detail, .generic-item-detail {
    box-shadow: 0 1px 0 rgba(255,255,255,0.50) inset, 0 1px 2px rgba(0,0,0,0.12);
}
.history-items-list {
    box-shadow: 0 1px 2px rgba(0,0,0,0.14) inset;
}

/* ===== SIDEBAR NAV — desktop only, icon-only buttons on the left ===== */
@media (min-width: 901px) {
    body { padding-left: 86px; }
    /* Desktop-only: shrink the quick-discount buttons (0/5/10/15/20/50/100%) so all
       7 fit on a single row instead of wrapping to a second line. Scoped to this
       min-width query only — mobile sizing (fbm.css ~3100, inside the 900px-max
       query) is untouched. */
    .discount-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
    }
    .discount-buttons .discount-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 4px !important;
        font-size: 0.72rem !important;
        letter-spacing: -0.2px;
    }
    .header-nav-wrapper {
        position: fixed;
        left: 10px;
        top: 10px;
        bottom: 10px;
        width: 64px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 14px 8px;
        overflow-y: auto;
        overflow-x: hidden;
        background: linear-gradient(180deg, #dedad2 0%, #c8c4bc 40%, #a8a49c 52%, #bbb8b0 100%);
        border: 1px solid rgba(0,0,0,0.42);
        border-top: 1px solid rgba(255,255,255,0.60);
        border-radius: 22px;
        box-shadow:
            0 1px 0 rgba(255,255,255,0.55) inset,
            0 -1px 0 rgba(0,0,0,0.18) inset,
            0 3px 10px rgba(0,0,0,0.35);
        z-index: 300;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .header-nav-wrapper::-webkit-scrollbar { display: none; }
    .header-nav-wrapper .sidebar-spacer { flex: 1; min-height: 6px; }
    /* Floating rounded nav cards: each button reads as its own elevated pill,
       detached from the bar background, with a soft shadow and a hover/active
       lift so the sidebar feels tactile instead of a flat strip of buttons. */
    .header-nav-wrapper .nav-btn {
        width: 46px;
        height: 46px;
        min-width: 46px;
        padding: 0;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(238,242,246,0.92) 100%);
        border: 1px solid rgba(255,255,255,0.6);
        box-shadow: 0 4px 10px rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.5) inset;
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }
    .header-nav-wrapper .nav-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.22), 0 1px 0 rgba(255,255,255,0.6) inset;
    }
    .header-nav-wrapper .nav-btn:active { transform: translateY(0); }
    .header-nav-wrapper .nav-btn.active {
        background: linear-gradient(180deg, var(--accent-primary, #007aff) 0%, #0057cc 100%);
        border-color: rgba(255,255,255,0.35);
        box-shadow: 0 6px 14px rgba(0,90,220,0.45), 0 1px 0 rgba(255,255,255,0.3) inset;
        transform: translateY(-1px);
    }
    .header-nav-wrapper .nav-btn.active svg { color: #fff; stroke: #fff; }
    .header-nav-wrapper .nav-btn svg {
        margin-right: 0 !important;
        vertical-align: middle !important;
        width: 19px !important;
        height: 19px !important;
    }
    .header-nav-wrapper #notification-bell-btn { font-size: 1.2em; }
}
.header h1 { 
    color: #ffffff; 
    font-size: 1.18em; 
    font-weight: 700; 
    letter-spacing: -0.01em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 -1px 0 rgba(0,0,0,0.2);
}
.header h1 .logo-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 6px rgba(0,122,255,0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.7); }
}
.header p { display: none; }

/* Header right side — nav lives here */
.header-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.header-nav-wrapper::-webkit-scrollbar { display: none; }

/* ===== iOS6 SKEUOMORPHIC BUTTONS ===== */
.nav-btn, .order-type-btn, .category-btn, .filter-btn, .payment-filter-btn, .date-filter-btn, .ts-view-btn, .modal-actions button, .add-item-form button, .checkout-btn, .kot-btn, .clear-btn, .payment-btn, .discount-btn {
    background: linear-gradient(180deg, #e8eef4 0%, #d0dae4 48%, #b8c8d4 52%, #c4c0b8 100%);
    border: 1px solid rgba(0,0,0,0.30);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s ease;
    color: #1a1a1a;
    text-align: center;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.55) inset,
        0 -1px 0 rgba(0,0,0,0.15) inset,
        0 2px 4px rgba(0,0,0,0.20);
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
    position: relative;
    overflow: hidden;
    letter-spacing: 0em;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}
.nav-btn::before, .checkout-btn::before, .category-btn::before, .payment-btn::before {
    display: none;
}
.nav-btn:hover, .order-type-btn:hover, .ts-view-btn:hover { 
    background: linear-gradient(180deg, #f0f4f8 0%, #d8e2ec 48%, #c0d0dc 52%, #d4e0ec 100%);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.65) inset,
        0 -1px 0 rgba(0,0,0,0.12) inset,
        0 3px 8px rgba(0,0,0,0.22);
    transform: none;
}
.nav-btn:active, .checkout-btn:active { 
    background: linear-gradient(180deg, #a0a098 0%, #b8c8d4 48%, #c8d4de 52%, #b0c0cc 100%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15) inset;
}
.nav-btn.active, .order-type-btn.active, .category-btn.active, .filter-btn.active, .ts-view-btn.active, .payment-filter-btn.active, .payment-btn.active, .discount-btn.active {
    background: linear-gradient(180deg, #3d9e48 0%, #2a7230 48%, #1e5824 52%, #287034 100%) !important;
    color: #ffffff !important;
    border: 1px solid #1a4a1e !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 2px 4px rgba(0,0,0,0.25) !important;
}

/* Checkout Button — iOS6 Green Glossy */
.checkout-btn { 
    background: linear-gradient(180deg, #3d9e48 0%, #217a28 48%, #1e7030 52%, #2a9040 100%);
    color: #ffffff; 
    border: 1px solid #1a4a1e;
    font-size: 1em; 
    padding: 12px 20px; 
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 2px 5px rgba(0,0,0,0.3);
}
.checkout-btn:hover { 
    background: linear-gradient(180deg, #50c860 0%, #308040 48%, #246030 52%, #30803e 100%);
}
.kot-btn { 
    background: linear-gradient(180deg, #ffaa30 0%, #e07800 48%, #c06000 52%, #d87000 100%);
    color: #ffffff; 
    border: 1px solid #9a4800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    font-weight: 700;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 2px 5px rgba(0,0,0,0.3);
}
#printBillBtn { 
    background: linear-gradient(180deg, #ffaa30 0%, #e07800 48%, #c06000 52%, #d87000 100%);
    color: #ffffff; 
    border: 1px solid #9a4800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    font-weight: 700;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 2px 5px rgba(0,0,0,0.3);
}
#shiftTableBtn, .discount-btn { 
    background: var(--btn-default-bg);
    color: var(--btn-default-color); 
}
.clear-btn { 
    background: linear-gradient(180deg, #d85040 0%, #b82000 48%, #9c1800 52%, #b02000 100%);
    color: #ffffff; 
    border: 1px solid #780e00;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 2px 5px rgba(0,0,0,0.3);
}
.modal-actions .print-receipt, .add-item-form button, #custom-confirm-ok { 
    background: linear-gradient(180deg, #3d9e48 0%, #2a7230 48%, #1e5824 52%, #287034 100%);
    color: #ffffff; 
    border: 1px solid #1a4a1e;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 2px 5px rgba(0,0,0,0.25);
}
.modal-actions .close-receipt, #custom-confirm-cancel { 
    background: linear-gradient(180deg, #e8eef4 0%, #d0dae4 48%, #b8c8d4 52%, #c4c0b8 100%);
    color: #3a3a3a; 
    border: 1px solid rgba(0,0,0,0.28);
}
.checkout-btn:disabled, .kot-btn:disabled { 
    background: linear-gradient(180deg, #d0d8e0 0%, #c0c8d0 100%);
    color: rgba(0,0,0,0.30); 
    border: 1px solid rgba(0,0,0,0.15);
    cursor: not-allowed; 
    transform: none; 
    box-shadow: none;
    text-shadow: none;
}

/* Quantity Buttons */
.quantity-btn {
    background: var(--btn-active-bg);
    color: var(--btn-active-color);
    border: 1px solid var(--btn-active-border);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.2em;
    transition: background 0.15s ease;
}
.quantity-btn:hover { background: var(--btn-active-bg); opacity: 0.85; }
.quantity-display { 
    background: var(--bg-input);
    border: 0.5px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    padding: 4px 12px; 
    font-weight: 700; 
    min-width: 36px; 
    text-align: center; 
    color: var(--text-primary); 
    font-size: 1em; 
    font-family: 'Courier New', Consolas, monospace;
}

/* ===== SECTIONS & LAYOUT ===== */
.section { display: none; }
.pos-main-layout { display: flex; align-items: flex-start; gap: 12px; }
.main-content-wrapper { flex: 2.5; min-width: 0; }
#opening-cash-display { display: none; }

/* ===== CARD STYLE — iOS6 Skeuomorphic ===== */
.card-style { 
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    border-radius: 10px; 
    padding: 15px; 
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.55) inset,
        0 4px 12px rgba(0,0,0,0.25),
        0 1px 2px rgba(0,0,0,0.15);
    transition: all 0.15s ease;
}

/* Table & Reservation toolbar — title, view toggle, and table-management
   actions all in one wrapping row instead of stacked separately. */
.tables-toolbar-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.tables-toolbar-spacer { flex: 1 1 auto; min-width: 0; }
@media (max-width: 768px) {
    .tables-toolbar-row { gap: 8px; }
    .tables-toolbar-row h2 { font-size: 1.1em; flex: 1 1 100%; }
    .tables-toolbar-spacer { display: none; }
    .tables-toolbar-row .nav-btn, .tables-toolbar-row .filter-btn { padding: 8px 10px; font-size: 0.82em; }
}

/* ===== TABLE ITEMS — Modern Cards ===== */
.tables-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tables-section.edit-mode .table-item:hover { border: 1.5px solid var(--accent-primary); }
.table-item {
    position: relative;
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    border: 1px solid rgba(0,0,0,0.25);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.55) inset,
        0 3px 8px rgba(0,0,0,0.20);
}
.delete-table-btn { 
    display: none; 
    position: absolute; 
    top: -8px; 
    left: -8px; 
    background: rgba(255,71,87,0.2);
    color: var(--color-danger); 
    border: 1px solid rgba(255,71,87,0.4); 
    border-radius: 50%; 
    width: 26px; height: 26px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 14px; 
    line-height: 24px; 
    z-index: 10; 
}
.tables-section.edit-mode .table-item .delete-table-btn { display: block; }
.table-item:hover { 
    background: linear-gradient(180deg, #e4ecf4 0%, #d4dce8 100%);
    border-color: #2a7230;
    box-shadow: 0 1px 0 rgba(255,255,255,0.65) inset, 0 5px 14px rgba(0,0,0,0.28);
}

.table-item.selected { 
    border-color: var(--accent-primary); 
    box-shadow: 0 0 0 2px rgba(0,122,255,0.2);
}
.table-number { 
    font-size: 1.7em; 
    font-weight: 700; 
    color: var(--text-primary); 
    margin-bottom: 8px; 
}
.table-status { font-size: 0.9em; font-weight: 600; }
.table-status.available { color: var(--color-success); }
.table-status.occupied { color: var(--color-danger); }
.table-running-time { font-size: 0.82em; margin-top: 6px; font-weight: 500; color: var(--text-secondary); }
.table-reservation-info { font-size: 0.78em; margin-top: 4px; color: var(--color-info); font-weight: 600; }

/* ===== MENU SECTION — iOS6 Skeuomorphic ===== */
.menu-section { 
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    border-radius: 10px; 
    padding: 15px;
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.55) inset,
        0 4px 12px rgba(0,0,0,0.22);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
}
.active-tables-section { 
    margin-bottom: 15px; 
    padding: 12px 12px 16px 12px; 
    background: var(--bg-surface-md);
    border-radius: 10px; 
    display: none;
    border: 1px solid var(--border-subtle);
    overflow: visible;
    flex-shrink: 0;
}
.active-tables-header { margin-bottom: 10px; color: var(--text-primary); font-size: 1em; font-weight: 600; }
.active-tables-list { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; padding-top: 8px; }
.active-table-btn { 
    background: var(--btn-active-bg);
    color: var(--btn-active-color); 
    border: 1px solid var(--btn-active-border);
    padding: 6px 12px; 
    border-radius: 20px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s ease; 
    position: relative;
    font-size: 0.85em;
}
.active-table-btn:hover { background: rgba(0,122,255,0.15); }
.notification-badge { 
    position: absolute; 
    top: -6px; 
    right: -6px; 
    background: var(--accent-primary);
    color: var(--text-on-accent); 
    border-radius: 50%; 
    padding: 1px 5px; 
    font-size: 10px; 
    font-weight: 700;
}

/* ===== SEARCH INPUT — iOS6 Engraved ===== */
#menuSearchInput {
    width: 100%;
    padding: 9px 15px;
    margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.30);
    border-top: 1px solid rgba(0,0,0,0.40);
    border-radius: 8px;
    font-size: 0.9em;
    background: linear-gradient(180deg, #b0aca4 0%, #e4e0d8 8%, #f0ede4 100%);
    color: #1a1a1a;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18) inset, 0 1px 0 rgba(255,255,255,0.4);
    flex-shrink: 0;
    box-sizing: border-box;
}
#menuSearchInput::placeholder { color: #7a7870; }
#menuSearchInput:focus { 
    outline: 0; 
    border-color: #2a7230; 
    background: linear-gradient(180deg, #a0a098 0%, #c4c0b8 8%, #e0dcd4 100%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.22) inset, 0 0 0 2px rgba(30,110,200,0.25);
}

.menu-categories { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; flex-shrink: 0; }

/* ===== MENU CARDS — Modern Dark Cards ===== */
.menu-items { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); 
    gap: 10px;
    align-content: start;
}
.menu-item {
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.55) inset,
        0 3px 8px rgba(0,0,0,0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    padding: 0;
}
.menu-item:hover {
    transform: translateY(-3px);
    background: linear-gradient(180deg, #e4ecf4 0%, #d4dce8 100%);
    border-color: #2a7230;
    box-shadow: 0 1px 0 rgba(255,255,255,0.65) inset, 0 6px 16px rgba(0,0,0,0.28);
}
.menu-item .item-icon {
    width: 100%;
    height: 115px;
    background: var(--bg-surface-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2em;
    margin: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}
.menu-item .item-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    opacity: 0.9;
}
.menu-item:hover .item-icon img { transform: scale(1.08); opacity: 1; }

.menu-item-details-box {
    padding: 10px 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}
.menu-item .item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88em;
    margin-bottom: 5px;
    line-height: 1.3;
}
.menu-item .item-price {
    color: var(--color-accent-primary);
    font-weight: 700;
    font-size: 1em;
    margin-top: auto;
    font-family: 'Courier New', Consolas, monospace;
}

/* Flying Animation */
.flying-item {
    position: fixed;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

/* ===== CART — White Glass Panel ===== */
.cart-section { 
    flex: 1.5; 
    display: flex; 
    flex-direction: column; 
    background: linear-gradient(180deg, #e4e0d8 0%, #d4d0c8 100%);
    padding: 15px; 
    border-radius: 10px; 
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 4px 12px rgba(0,0,0,0.22);
    transition: all 0.15s ease;
}
.cart-header { 
    font-size: 1.1em; 
    margin-bottom: 12px; 
    padding-bottom: 8px; 
    border-bottom: 1px solid rgba(0,0,0,0.18);
    text-align: left; 
    font-weight: 700; 
    color: #1a1a1a;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
    flex-shrink: 0; 
}
.selected-table-info { 
    background: linear-gradient(180deg, #d4d0c8 0%, #b8c4cc 100%);
    border-radius: 8px; 
    padding: 8px; 
    margin-bottom: 12px; 
    text-align: center; 
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.18);
    box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset;
}
.selected-table-info h4 { margin: 0 0 5px; font-size: 0.9em; color: #2a7230; }
.cart-items { margin-bottom: 12px; padding-right: 5px; }
.cart-footer-wrapper { flex-shrink: 0; }
.cart-item { 
    background: linear-gradient(180deg, #dce6ee 0%, #dedad2 100%);
    border-radius: 7px; 
    padding: 6px 8px; 
    margin-bottom: 4px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    animation: itemAdd 0.3s ease-in-out;
    border: 1px solid rgba(0,0,0,0.18);
    box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 1px 3px rgba(0,0,0,0.12);
    font-size: 0.9em;
}

.cart-item-status { font-size: 1em; cursor: pointer; margin-right: 8px; font-weight: bold; user-select: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 32px; gap: 1px; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; color: var(--text-primary); margin-bottom: 3px; font-size: 0.88em; }

/* KOT print status — a cart item that has already been sent to the kitchen gets
   a visibly deeper/darker card so the cashier can tell at a glance which lines
   are already cooking vs which are still new/unsent. Partially-sent (quantity
   increased after printing, only part of it sent) gets its own amber tint. */
.cart-item.kot-printed {
    background: linear-gradient(180deg, #b9c4b0 0%, #9fac95 100%);
    border-color: rgba(0,0,0,0.32);
    box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 1px 4px rgba(0,0,0,0.22);
}
.cart-item.kot-printed .cart-item-name::after {
    content: ' 🖨️ Sent';
    font-size: 0.72em;
    font-weight: 700;
    color: #2a6b30;
    text-shadow: none;
}
.cart-item.kot-partial {
    background: linear-gradient(180deg, #e8d3a8 0%, #dcbf8a 100%);
    border-color: rgba(160,110,0,0.35);
}
.cart-item.kot-partial .cart-item-name::after {
    content: ' ⏳ Partly Sent';
    font-size: 0.72em;
    font-weight: 700;
    color: #a06800;
    text-shadow: none;
}
.cart-item-price { color: var(--text-secondary); font-weight: 500; font-size: 0.82em; }
.cart-item-note { 
    width: 100%; 
    padding: 4px 8px; 
    margin-top: 3px; 
    border: 1px solid var(--border-subtle); 
    border-radius: 6px; 
    font-size: 0.8em; 
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
}
.cart-item-note:focus { outline: 0; border-color: var(--accent-primary); background: var(--bg-input-focus); }
.cart-item-modifiers { font-size: 0.8em; color: var(--color-success); margin-top: 4px; padding-left: 10px; }
.quantity-controls { display: flex; align-items: center; gap: 8px; }
.discount-section h4 { font-size: 0.9em; margin-bottom: 8px; color: var(--text-secondary); }

.cart-summary { 
    background: var(--bg-surface-md);
    color: var(--text-primary); 
    padding: 10px; 
    border-radius: 8px; 
    margin-bottom: 8px; 
    font-size: 0.88em;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.summary-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.summary-row:last-child { margin-bottom: 0; }

/* Cart Total — Modern Accent */
.cart-total { 
    background: var(--accent-primary);
    color: #ffffff; 
    padding: 12px; 
    border-radius: 10px; 
    text-align: center; 
    margin-bottom: 8px; 
    font-size: 1.3em; 
    font-weight: 700;
    border: none;
    font-family: 'Courier New', Consolas, monospace;
}
.cart-actions { display: flex; flex-direction: column; gap: 8px; }
#splitBillBtn { 
    background: rgba(255,171,0,0.15);
    color: var(--color-warning); 
    border-color: rgba(255,171,0,0.3);
}

/* ===== HISTORY & GENERIC SECTIONS ===== */
.history-section, .generic-section, .admin-section-container, .expense-section-container, .staff-section, .customer-section {
    background: rgba(255,255,255,0.60);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.15s ease;
}
.history-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }

/* ===== HISTORY FILTER DROPDOWNS ===== */
.date-input { 
    padding: 8px 12px; 
    border: 1px solid var(--border-subtle); 
    border-radius: 8px; 
    background: var(--bg-input);
    color: var(--text-primary);
}
.history-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { 
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    border-radius: 10px; 
    padding: 15px; 
    text-align: center;
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 4px 12px rgba(0,0,0,0.20);
    transition: all 0.15s ease;
}
.stat-value { font-size: 1.8em; font-weight: bold; color: #2a7230; margin-bottom: 8px; font-family: 'Courier New', Consolas, monospace; }
.stat-label { color: #6a6860; font-weight: 700; font-size: 0.9em; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }

.history-items { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-height: 600px; overflow-y: auto; padding-right: 10px; }
.generic-items-list, .staff-list, .customer-list { max-height: 600px; overflow-y: auto; padding-right: 10px; }
.history-item, .generic-item {
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    border-radius: 8px;
    padding: 14px;
    border-left: 3px solid #2a7230;
    transition: all 0.15s ease;
    margin-bottom: 0;
    border-top: 1px solid rgba(0,0,0,0.18);
    border-right: 1px solid rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(0,0,0,0.25);
    box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 2px 6px rgba(0,0,0,0.16);
}
.history-item:hover, .generic-item:hover { 
    background: linear-gradient(180deg, #e4ecf4 0%, #d4dce8 100%);
    box-shadow: 0 1px 0 rgba(255,255,255,0.65) inset, 0 5px 14px rgba(0,0,0,0.24);
    transform: translateY(-1px);
}
.history-item.dine-in { border-left-color: var(--color-success); }
.history-item.takeaway { border-left-color: var(--color-warning); }
.history-item.foodpanda { border-left-color: #d83b8b; }
.history-item.foodmama { border-left-color: #ff6600; }
.history-item.stafffamily { border-left-color: var(--color-info); }

.history-header, .generic-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.history-order-number, .generic-item-description { font-weight: 700; color: var(--text-primary); font-size: 1em; }
.history-total, .generic-item-amount { font-weight: 700; color: var(--text-accent); font-size: 1.1em; font-family: 'Courier New', Consolas, monospace; }
.history-details, .generic-item-details { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; font-size: 0.85em; }
.history-detail, .generic-item-detail { 
    color: var(--text-secondary); 
    background: var(--bg-surface-md);
    border: 0.5px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 0.92em;
    white-space: nowrap;
    font-weight: 500;
}
.history-detail strong, .generic-item-detail strong { 
    color: var(--text-primary);
    font-weight: 700;
}
/* Specific highlight colors for key fields — bigger pill style */
.history-detail.detail-time { 
    background: rgba(79,195,247,0.15); 
    border: 1.5px solid rgba(79,195,247,0.4); 
    color: var(--color-info);
    font-size: 0.95em;
    font-weight: 600;
}
.history-detail.detail-type { 
    background: rgba(0,214,143,0.15); 
    border: 1.5px solid rgba(0,214,143,0.4); 
    color: var(--color-success);
    font-size: 0.95em;
    font-weight: 600;
}
.history-detail.detail-payment { 
    background: rgba(255,171,0,0.15); 
    border: 1.5px solid rgba(255,171,0,0.4); 
    color: var(--color-warning);
    font-size: 0.95em;
    font-weight: 600;
}
.history-detail.detail-items { 
    background: rgba(0,122,255,0.12); 
    border: 1.5px solid rgba(0,122,255,0.3); 
    color: var(--accent-primary);
    font-size: 0.95em;
    font-weight: 600;
}
/* Void reason display on history card */
.history-void-reason {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(255,59,48,0.12);
    border: 1.5px solid rgba(255,59,48,0.4);
    border-radius: 10px;
    color: var(--color-danger);
    font-size: 1em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}
.history-items-list { 
    background: var(--bg-surface-md);
    border-radius: 8px; 
    padding: 12px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.history-item-row { display: flex; justify-content: space-between; margin-bottom: 5px; padding: 5px 0; border-bottom: 1px dashed var(--border-subtle); color: var(--text-secondary); font-size: 0.88em; }
.history-item-row:last-child { border-bottom: none; }
.history-item.voided { opacity: 0.7; border-left-color: var(--color-danger); border-left-width: 4px; background: rgba(255,59,48,0.04); }
.history-item.voided .history-total, .history-item.voided .history-item-row span, .history-item.voided .history-order-number { text-decoration: line-through; }

/* ===== EXPENSE SYSTEM ===== */
.expense-view { display: none; }
.expense-view.active { display: block; }
.expense-form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px; 
    background: rgba(255,255,255,0.50);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 20px; 
    border-radius: 14px; 
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.15s ease;
}
#expense-item-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
#expense-item-table th, #expense-item-table td { padding: 12px; border-bottom: 1px solid var(--border-subtle); text-align: left; color: var(--text-primary); }
#expense-item-table thead { background: rgba(255,255,255,0.75); }
#expense-item-table th { color: var(--text-secondary); font-weight: 700; }
#expense-item-table .item-total-cost { font-weight: bold; color: var(--text-primary); }
#expense-item-table .delete-item-row-btn { 
    background: rgba(255,71,87,0.2);
    color: var(--color-danger); 
    border: 1px solid rgba(255,71,87,0.3); 
    border-radius: 50%; 
    width: 28px; height: 28px; 
    cursor: pointer; 
    font-weight: bold;
}
.expense-summary-panel { 
    background: var(--bg-surface-md);
    padding: 20px; 
    border-radius: 12px; 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.expense-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.supplier-history-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-height: 70vh; overflow-y: auto; padding: 5px; }
.supplier-card { 
    background: rgba(255,255,255,0.60);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 14px; 
    padding: 15px; 
    border-left: 3px solid var(--accent-primary);
    border-top: 1px solid rgba(255,255,255,0.75);
    border-right: 1px solid rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 6px 20px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.5);
    transition: all 0.15s ease;
}
.supplier-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.supplier-name { font-size: 1.2em; font-weight: 700; color: var(--text-primary); cursor: pointer; }
.supplier-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; margin-top: 10px; }
.supplier-summary-item .value { font-size: 1.1em; font-weight: 700; font-family: 'Courier New', Consolas, monospace; }
.supplier-summary-item .label { font-size: 0.78em; color: var(--text-secondary); }
.supplier-summary-item .value.total { color: var(--text-primary); }
.supplier-summary-item .value.paid { color: var(--color-success); }
.supplier-summary-item .value.due { color: var(--color-danger); }
.supplier-entries-view { 
    display: none; 
    background: var(--bg-surface-md);
    border-radius: 8px; 
    padding: 15px; 
    margin-top: 15px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.expense-entry-card { 
    background: var(--bg-card);
    border-radius: 8px; 
    padding: 12px; 
    margin-bottom: 10px;
    border: 0.5px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.expense-entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.expense-entry-date { font-weight: 600; color: var(--text-secondary); font-size: 0.88em; }
.expense-entry-actions button { background: none; border: none; color: var(--text-secondary); font-size: 1em; cursor: pointer; margin-left: 8px; }
.expense-entry-details-table { width: 100%; font-size: 0.88em; color: var(--text-secondary); }
.expense-entry-details-table td { padding: 4px 0; }
.expense-entry-details-table tr td:last-child { text-align: right; }
.expense-entry-details-table .paid-amount-color { color: var(--color-success) !important; }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.78em; font-weight: 700; }
.status-paid { 
    background: rgba(0,214,143,0.15);
    color: var(--color-success);
    border: 1px solid rgba(0,214,143,0.3);
}
.status-due { 
    background: rgba(255,71,87,0.15);
    color: var(--color-danger);
    border: 1px solid rgba(255,71,87,0.3);
}
.status-partial { 
    background: rgba(255,171,0,0.15);
    color: var(--color-warning);
    border: 1px solid rgba(255,171,0,0.3);
}

/* ===== STAFF SECTION ===== */
.staff-details-view { display: none; background: var(--bg-surface-md); border-radius: 8px; padding: 15px; margin-top: 15px; border: 0.5px solid rgba(0,0,0,0.08); }
.staff-history-item { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--border-subtle); gap: 8px; color: var(--text-secondary); font-size: 0.88em; }
.staff-history-item:last-child { border-bottom: none; }
.staff-history-list { list-style: none; padding: 0; margin: 0; max-height: 180px; overflow-y: auto; }
#expense-category-management { 
    background: var(--bg-surface-md);
    padding: 16px; 
    border-radius: 10px; 
    margin-bottom: 24px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.category-list-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px; 
    background: var(--bg-card);
    border-radius: 8px; 
    margin-bottom: 8px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.category-list-item button { background: none; border: none; cursor: pointer; font-size: 1.1em; margin-left: 10px; color: var(--text-secondary); }

/* ===== CHART STYLES ===== */
#historyChartContainer { 
    padding: 20px; 
    background: rgba(255,255,255,0.65);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 16px; 
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.15s ease;
}

/* ===== ADMIN DASHBOARD ===== */
.admin-summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-card { 
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    padding: 20px; 
    border-radius: 10px; 
    text-align: center; 
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 4px 12px rgba(0,0,0,0.20);
    transition: all 0.15s ease;
}
.admin-card:hover { 
    box-shadow: 0 1px 0 rgba(255,255,255,0.65) inset, 0 6px 18px rgba(0,0,0,0.28);
    transform: translateY(-2px);
}
.admin-card h3 { margin-top: 0; color: #6a6860; font-size: 0.9em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
.admin-card p { font-size: 1.8em; font-weight: 700; color: #1a1a1a; margin: 10px 0 0; font-family: 'Courier New', Consolas, monospace; overflow-wrap: anywhere; word-break: break-word; }
.admin-card { overflow: hidden; box-sizing: border-box; min-width: 0; }
.admin-card.profit-card p { color: #217a28; }
.admin-card.expense-card p { color: #b82000; }
.admin-charts-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.admin-chart-box { 
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    padding: 20px; 
    border-radius: 10px; 
    position: relative; 
    box-sizing: border-box;
    min-width: 0;
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 4px 12px rgba(0,0,0,0.20);
    transition: all 0.15s ease;
}
/* Only boxes that actually hold a Chart.js canvas get a fixed height + flex
   layout (Chart.js with maintainAspectRatio:false needs a bounded container).
   Plain content boxes (heatmap grid, table turnover list, break-even stats)
   stay auto-height so their content never gets clipped or forced to overlap
   the box below. */
.admin-chart-box.has-canvas { height: 320px; display: flex; flex-direction: column; }
.admin-chart-box h3 { flex-shrink: 0; }
.admin-chart-canvas-wrap { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; }
.admin-chart-canvas-wrap canvas { position: absolute !important; top: 0; left: 0; width: 100% !important; height: 100% !important; max-width: 100%; }
.admin-chart-box h3 { text-align: center; color: #1a1a1a; margin-bottom: 20px; text-shadow: 0 1px 0 rgba(255,255,255,0.5); font-weight: 700; }
/* Second admin insights row (heatmap / forecast / table turnover / break-even) —
   same 2-col-desktop -> 1-col-mobile behavior as .admin-charts-container. */
.admin-extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.admin-table-box { 
    background: rgba(255,255,255,0.65);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 20px; 
    border-radius: 16px; 
    margin-bottom: 30px; 
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.15s ease;
}
.admin-table-box h3 { color: var(--text-primary); margin-bottom: 15px; }
#costing-form { 
    margin-bottom: 20px; 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    background: var(--bg-surface-md);
    padding: 15px; 
    border-radius: 10px;
    border: none;
}
#costing-table { width: 100%; border-collapse: collapse; }
#costing-table th, #costing-table td { padding: 12px 15px; border-bottom: 1px solid var(--border-subtle); text-align: left; }
#costing-table thead { background: rgba(255,255,255,0.75); }
#costing-table th { color: var(--text-secondary); font-weight: 700; }
#costing-table td { color: var(--text-primary); }
#costing-table .edit-cost-btn { 
    background: rgba(255,171,0,0.2);
    color: var(--color-warning); 
    padding: 6px 12px; 
    font-size: 0.9em;
    border-color: rgba(255,171,0,0.3);
}

/* ===== SETTINGS ===== */
.settings-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.settings-card { 
    background: rgba(255,255,255,0.65);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 16px; 
    padding: 20px; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.15s ease; 
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.6);
}
.settings-card:hover { 
    transform: translateY(-5px); 
    background: rgba(255,255,255,0.85);
    box-shadow: 0 16px 40px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,1);
}
.settings-card h3 { color: var(--text-primary); margin-bottom: 10px; }
.settings-card p { color: var(--text-secondary); font-size: 0.9em; }
.settings-view { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
.settings-view-header { text-align: center; margin-bottom: 20px; font-weight: 700; font-size: 1.3em; color: var(--text-primary); }
#pin-management-list .generic-item-header { margin-bottom: 0; }
#pin-management-list .pin-input { 
    width: 80px; 
    padding: 8px; 
    text-align: center; 
    font-size: 1em; 
    letter-spacing: 0.2em;
    background: var(--bg-input);
    border: 0.5px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Courier New', Consolas, monospace;
}

/* ===== MENU EDITOR ===== */
#menu-editor-list .generic-item {
    background: var(--bg-card);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 0.5px solid rgba(0,0,0,0.1);
    border-left: none;
    border-radius: 0;
}
#menu-editor-list .generic-item:first-of-type { border-top-left-radius: 10px; border-top-right-radius: 10px; }
#menu-editor-list .generic-item:last-of-type { border-bottom: none; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
#menu-editor-list .menu-actions { display: flex; align-items: center; gap: 15px; }
#menu-editor-list .generic-item-description .generic-item-amount { font-size: 0.9em; margin-top: 2px; color: var(--text-secondary); }
#menu-editor-list .menu-actions button { padding: 6px 12px; font-size: 0.9em; }

/* ===== iOS 7 TOGGLE SWITCH ===== */
.availability-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}
.availability-toggle input { opacity: 0; width: 0; height: 0; }
.availability-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.12);
    transition: .3s;
    border-radius: 34px;
    border: none;
}
.availability-toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: .3s;
    border-radius: 50%;
}
.availability-toggle input:checked + .slider {
    background: var(--color-success);
    border: none;
}
.availability-toggle input:checked + .slider:before { 
    transform: translateX(20px);
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ===== RECIPE MANAGEMENT ===== */
#recipe-ingredients-list { 
    background: var(--bg-surface-md);
    border-radius: 8px; 
    padding: 10px; 
    min-height: 50px; 
    margin-bottom: 10px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.recipe-ingredient-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--bg-surface-md);
    padding: 5px 10px; 
    border-radius: 6px; 
    margin-bottom: 5px;
    border: 0.5px solid rgba(0,0,0,0.08);
    color: var(--text-secondary);
    font-size: 0.88em;
}
.recipe-ingredient-item button { 
    background: rgba(255,71,87,0.15);
    color: var(--color-danger); 
    border: 1px solid rgba(255,71,87,0.3); 
    border-radius: 50%; 
    width: 20px; height: 20px; 
    cursor: pointer; 
    font-weight: 700; 
    line-height: 18px;
    text-align: center;
}

/* ===== MODAL & NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-on-accent);
    z-index: 2100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: notificationSlide 3s ease-in-out forwards;
    backdrop-filter: none;
    font-size: 0.9em;
}
.notification.success { 
    background: var(--color-success);
    border: none;
}
.notification.error { 
    background: var(--color-danger);
    border: none;
}
@keyframes notificationSlide { 0% { transform: translateX(120%); opacity: 0; } 10%, 90% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(120%); opacity: 0; } }

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.60);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: linear-gradient(180deg, #eceade 0%, #dedad2 100%);
    padding: 24px;
    border-radius: 12px;
    max-width: 500px;
    width: 95%;
    margin: auto;
    color: #1a1a1a;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.28);
    border-bottom: 1px solid rgba(0,0,0,0.38);
    box-shadow: 
        0 1px 0 rgba(255,255,255,0.55) inset,
        0 20px 50px rgba(0,0,0,0.50),
        0 4px 12px rgba(0,0,0,0.30);
}
.modal-content.form-modal { padding: 30px; }
#custom-confirm-modal .modal-content, #custom-prompt-modal .modal-content { max-width: 400px; padding: 30px; text-align: center; }
#custom-confirm-title, #custom-prompt-title { font-size: 1.2em; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; }
#custom-confirm-message, #custom-prompt-message { font-size: 1em; color: var(--text-secondary); margin-bottom: 25px; line-height: 1.5; }
#custom-confirm-actions, #custom-prompt-actions { display: flex; justify-content: center; gap: 15px; }

/* Settle Modal — redesigned as a wide 3-column layout (Quick Pay+Calculator | Payment
   Combination | Single Payment Method) instead of stacked scrolling sections. */
#settleModal .settle-modal-content { max-width: 1080px; width: 96%; }
#settleModal .settle-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
    align-items: start;
    margin-top: 10px;
}
#settleModal .settle-col {
    background: rgba(0,0,0,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 14px;
}
#settleModal .settle-col h4 { margin-top: 0; }
#settleModal .settle-calc-area { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
#settleModal .payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
#settleModal .final-total { font-size: 2em; font-weight: 700; text-align: center; margin: 15px 0; color: var(--text-accent); font-family: 'Courier New', Consolas, monospace; }
#settleModal .quick-pay-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 15px; }
#settleModal #change-due-display { text-align: center; font-size: 1.2em; color: var(--color-success); font-weight: 700; height: 25px; margin-top: 10px; }
#settleModal .payment-combination-area { margin-top: 0; }
#settleModal .payment-combo-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
#settleModal #remaining-amount-display { text-align: center; font-weight: 700; margin-top: 10px; color: var(--color-danger); }
@media (max-width: 900px) {
    #settleModal .settle-columns { grid-template-columns: 1fr; }
}

/* Split Bill Modal */
#splitBillModal .modal-content { max-width: 800px; }
.split-bill-container { display: flex; gap: 20px; }
.split-bill-pane { 
    flex: 1; 
    background: var(--bg-surface-md);
    padding: 15px; 
    border-radius: 10px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.split-bill-pane h4 { text-align: center; margin-bottom: 10px; color: var(--text-primary); }
.split-bill-items { min-height: 200px; max-height: 400px; overflow-y: auto; }
.split-bill-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 8px; 
    background: var(--bg-card);
    border-radius: 6px; 
    margin-bottom: 5px; 
    cursor: pointer;
    border: 0.5px solid rgba(0,0,0,0.08);
    color: var(--text-primary);
}
.split-bill-item:hover { background: rgba(0,122,255,0.06); border-color: rgba(0,122,255,0.15); }
.split-bill-summary { margin-top: 15px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }

/* Print styles preserved */
@media print {
    @page { margin: 0; size: auto; }
    body { margin: 0; padding: 0; }
    body * { visibility: hidden; }
    #kot-print-area, #kot-print-area *, 
    #generic-print-area, #generic-print-area *, 
    #receiptModal .modal-content, #receiptModal .modal-content * { visibility: visible; }
    #kot-print-area, #generic-print-area, #receiptModal .modal-content {
        position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 5px; box-sizing: border-box;
    }
     /* Hide all other modals during print */
    .modal { display: none !important; }
    #receiptModal { display: block !important; }
    .modal-actions, .close-receipt, .print-receipt { display: none !important; }
    .receipt-total-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #000 !important; color: #fff !important; }
     /* Hide Happy Hour banner and notification panel during print */
    #happy-hour-banner,
#notification-panel { display: none !important; }
}

/* KOT Styles — preserved for thermal printer */
#kot-print-area {
    font-family: 'Ubuntu Mono', monospace;
    width: 85%;
    max-width: 62mm;
    margin: 0 auto;
    color: #000;
    border: none;
    padding: 3px;
    box-sizing: border-box;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    overflow: hidden;
}
.kot-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0; }
.kot-order-no { font-size: 1.4em; font-weight: 900; }
.kot-table-no { font-size: 1.2em; font-weight: 900; text-align: right; }
.kot-meta { font-size: 0.8em; font-weight: 600; color: #000; margin-bottom: 0; }
.kot-type-badge { background: #000; color: #fff; padding: 1px 4px; font-weight: bold; font-size: 0.8em; display: inline-block; margin-top: 1px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.kot-divider { border-top: 2px dashed #000; margin: 2px 0; }
.kot-columns { display: flex; font-weight: 900; font-size: 0.8em; border-bottom: 2px solid #000; padding-bottom: 1px; margin-bottom: 2px; }
.kot-col-qty { width: 25px; flex-shrink: 0; }
.kot-col-item { flex-grow: 1; }
.kot-item-row { display: flex; margin-bottom: 1px; page-break-inside: avoid; }
.kot-item-qty { width: 25px; font-size: 1.2em; font-weight: 900; flex-shrink: 0; }
.kot-item-details { flex-grow: 1; }
.kot-item-name { font-size: 1.2em; font-weight: 700; line-height: 1.1; }
.kot-item-mods { font-size: 1.3em; margin-top: 3px; font-weight: 900; color: #000; line-height: 1.1; }
.kot-tag-nobutter { background: #000; color: #fff; padding: 1px 5px; font-size: 0.85em; font-weight: bold; margin-right: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; display: inline-block; margin-bottom: 2px; }
.kot-note-text { font-size: 0.9em; font-weight: 700; color: #222; display: block; margin-top: 2px; font-style: italic; }
.kot-footer { display: flex; justify-content: space-between; font-size: 1em; font-weight: 900; margin-top: 3px; }

/* Receipt styles — preserved */
#receiptModal .modal-content {
    font-family: 'Ubuntu', sans-serif;
    color: #000;
    background: white;
    max-width: 380px;
    padding: 5px;
    border-radius: 0;
}
.receipt-address-line { font-size: 10px; color: #444; margin-bottom: 2px; text-transform: uppercase; }
.receipt-dashed-divider { border-top: 1px dashed #ccc; margin: 4px 0; width: 100%; }
.receipt-items-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 11px; }
.receipt-items-table th { text-align: left; border-bottom: 2px solid #000; padding: 2px 0; font-weight: 700; text-transform: uppercase; }
.receipt-items-table th:last-child { text-align: right; }
.receipt-items-table th:nth-child(2) { text-align: center; }
.receipt-items-table td { padding: 2px 0; border-bottom: 1px dashed #eee; vertical-align: top; text-align: left; }
.receipt-items-table td:last-child { text-align: right; font-weight: 600; }
.receipt-items-table td:nth-child(2) { text-align: center; }
.receipt-feedback-box { border: 1px dashed #ccc; border-radius: 8px; padding: 10px; margin: 15px 0; text-align: center; }
.receipt-feedback-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.receipt-footer-msg { color: #555; margin-top: 5px; font-family: serif; }
.receipt-offer-box { border: 0px dashed #000; background: #f9f9f9; padding: 8px; margin: 10px 0; text-align: center; }
.receipt-offer-title { font-weight: 800; font-size: 11px; text-transform: uppercase; margin-bottom: 4px; }
.receipt-offer-code { font-family: 'Ubuntu Mono', monospace; font-weight: 700; font-size: 14px; border: 1px solid #ccc; padding: 2px 8px; background: #fff; display: inline-block; }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }

#addPaymentModal .payment-info-display, #addSalaryPaymentModal .payment-info-display { 
    background: var(--bg-surface-md);
    padding: 15px; 
    border-radius: 10px; 
    margin-bottom: 20px; 
    text-align: left;
    border: 0.5px solid rgba(0,0,0,0.08);
}
#addPaymentModal .payment-info-display p, #addSalaryPaymentModal .payment-info-display p { margin: 5px 0; font-size: 1.1em; color: var(--text-primary); }
#addPaymentModal .payment-controls-wrapper, #addSalaryPaymentModal .payment-controls-wrapper { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 25px; }
#addPaymentModal #payment-amount-input, #addSalaryPaymentModal #salary-payment-amount-input { 
    width: 120px; 
    text-align: center; 
    font-size: 1.5em; 
    padding: 10px;
    background: var(--bg-input);
    border: 0.5px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    color: var(--text-primary);
}

/* Modifiers */
.modifiers-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    max-height: 300px; 
    overflow-y: auto; 
    padding: 10px; 
    background: var(--bg-surface-md);
    border-radius: 10px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.modifier-item { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    background: var(--bg-card);
    padding: 8px; 
    border-radius: 6px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.modifier-item input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.modifier-item label { cursor: pointer; flex-grow: 1; color: var(--text-primary); }

/* Z-Report */
.z-report-section { 
    background: var(--bg-surface-md);
    padding: 15px; 
    border-radius: 10px; 
    margin-bottom: 15px;
    border: 0.5px solid rgba(0,0,0,0.08);
}
.z-report-section h4 { margin-top: 0; margin-bottom: 10px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 5px; color: var(--text-primary); }
#z-report-printable-area .summary-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--text-primary); }
#z-report-printable-area hr { border: none; border-top: 1px dashed var(--border-subtle); margin: 8px 0; }

#kot-print-area, #generic-print-area { display: none; }

/* Form Inputs — iOS6 Engraved */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.28);
    border-top: 1px solid rgba(0,0,0,0.38);
    font-size: 0.92em;
    background: linear-gradient(180deg, #b0aca4 0%, #e4e0d8 8%, #f0ede4 100%);
    color: #1a1a1a;
    transition: all 0.15s ease;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18) inset, 0 1px 0 rgba(255,255,255,0.4);
}
.form-input:focus {
    outline: 0;
    border-color: #2a7230;
    background: linear-gradient(180deg, #a0a098 0%, #c4c0b8 8%, #e0dcd4 100%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.22) inset, 0 0 0 2px rgba(30,110,200,0.25);
}
.form-input option { background: #d8e2ea; color: #1a1a1a; }
.form-label { font-weight: 700; color: #3a3a3a; display: block; margin-bottom: .4rem; font-size: 0.85em; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
.form-group { margin-bottom: 1rem; }

.add-item-form {
    background: linear-gradient(180deg, #d0dae4 0%, #c0cad4 100%);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    border: 1px solid rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(0,0,0,0.30);
    box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 3px 8px rgba(0,0,0,0.18);
    transition: all 0.15s ease;
}
.form-field { flex: 1 1 180px; min-width: 150px; }
.add-item-form button { flex-shrink: 0; }

/* Top Selling Items */
#topSellingItems { display: flex; flex-direction: column; gap: 10px; max-height: 600px; overflow-y: auto; padding-right: 10px; }
.top-selling-item {
    background: rgba(255,255,255,0.60);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 14px;
    padding: 14px;
    display: grid;
    grid-template-columns: 40px 1fr 100px 120px;
    align-items: center;
    gap: 15px;
    border-left: 3px solid var(--color-warning);
    border-top: 1px solid rgba(255,255,255,0.75);
    border-right: 1px solid rgba(255,255,255,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
    transition: all 0.15s ease;
}
.top-selling-rank { font-size: 1.4em; font-weight: 700; color: var(--color-warning); text-align: center; }
.top-selling-name { font-size: 1em; font-weight: 700; color: var(--text-primary); }
.top-selling-quantity, .top-selling-revenue { 
    font-size: 1em; 
    font-weight: 700; 
    background: var(--bg-surface-md);
    padding: 5px 10px; 
    border-radius: 8px; 
    text-align: center;
    border: 0.5px solid rgba(0,0,0,0.08);
    font-family: monospace;
}
.top-selling-quantity { color: var(--color-danger); }
.top-selling-revenue { color: var(--color-success); }

/* ===== LOGIN MODAL — Dark Leather ===== */
#login-modal { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 2000; 
    background-image: url('https://images.unsplash.com/photo-1555396273-367ea4eb4db5?q=80&w=1974&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
#login-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(20,10,0,0.78) 100%);
}
#login-modal::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.015) 2px, rgba(255,255,255,0.015) 4px), repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255,255,255,0.01) 3px, rgba(255,255,255,0.01) 6px);
    pointer-events: none;
}
.login-app-icon {
    width: 88px; height: 88px;
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.8em;
    margin: 0 auto 24px;
    box-shadow: 0 8px 32px rgba(102,126,234,0.45), 0 2px 8px rgba(0,0,0,0.2);
    position: relative; overflow: hidden;
}
.login-app-icon::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.0) 100%);
    border-radius: 22px 22px 60% 60%;
}
.login-box {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.92);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255,255,255,0.6);
    border-top: 1px solid rgba(255,255,255,0.8);
    padding: 40px 40px 36px;
    border-radius: 20px;
    text-align: center;
    box-shadow:
        0 40px 100px rgba(0,0,0,0.5),
        0 20px 40px rgba(0,0,0,0.3),
        0 2px 0 rgba(255,255,255,0.8) inset;
    width: 90%; max-width: 400px;
    overflow: hidden;
}
.login-box::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9) 30%, rgba(255,255,255,0.9) 70%, transparent);
    pointer-events: none;
}
.login-box::after { content: none; }
.login-box h2 {
    position: relative;
    margin-bottom: 6px;
    color: #111827;
    font-size: 1.65em;
    font-weight: 800;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.login-restaurant-label {
    font-size: 0.8em; color: #6b7280; margin-bottom: 28px;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
    position: relative;
}
.login-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0.1) 70%, transparent);
    margin: 0 0 24px; position: relative;
}
.login-divider::after { content: none; }
.login-box p {
    color: #4b5563; margin-bottom: 22px; font-size: 0.875em;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    position: relative; line-height: 1.6;
}
#login-btn {
    width: 100%; padding: 14px 20px;
    background: #ffffff;
    color: #1f2937; font-size: 0.95em; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    border: 1.5px solid #e5e7eb; border-radius: 12px;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    position: relative; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.08);
    letter-spacing: 0; transition: all 0.2s ease;
}
#login-btn::before { content: none; }
#login-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
#login-btn:active {
    background: #f3f4f6;
    transform: scale(0.98) translateY(0);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
#login-btn img { height: 20px; width: 20px; border-radius: 4px; flex-shrink: 0; }
.login-pos-brand {
    position: relative; margin-top: 20px; font-size: 0.7em;
    color: rgba(107,114,128,0.6); font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    letter-spacing: 0.1em; text-transform: uppercase;
}
#login-error {
    color: #dc2626; margin-top: 14px; height: 20px; font-weight: 600; font-size: 0.85em;
    position: relative;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .pos-main-layout { flex-direction: column; gap: 20px; }
    .main-content-wrapper, .cart-section { width: 100%; }
    .cart-section { position: static; height: auto; max-height: none; overflow: visible; margin-top: 0; }
    .menu-section { position: static; height: auto; max-height: none; overflow: visible; }
    .menu-items { overflow-y: visible; flex: unset; }
    .header { padding: 10px 16px; }
    .admin-charts-container { grid-template-columns: 1fr; }
    .history-items { grid-template-columns: 1fr; }
    .supplier-history-list { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    body { padding: 10px; font-size: 14px; }
    .pos-container { padding: 0; }
    .header h1 { font-size: 1.6em; }
    .nav-btn { padding: 8px 10px; font-size: 0.85em; min-height: 44px; }
    .menu-items { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
    .tables-section { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .history-details, .generic-item-details { grid-template-columns: 1fr; }
    .top-selling-item { grid-template-columns: 30px 1fr; grid-template-rows: auto auto; gap: 5px 15px; }
    .top-selling-rank { grid-row: 1 / span 2; }
    .top-selling-name { grid-column: 2; }
    .top-selling-quantity, .top-selling-revenue { font-size: 1em; padding: 3px 8px; }
    .admin-summary-cards { grid-template-columns: 1fr 1fr; }
    .admin-card { padding: 14px 10px; }
    .admin-card p { font-size: 1.3em; }
    .admin-chart-box.has-canvas { height: 260px; padding: 12px; }
    .admin-extra-grid { grid-template-columns: 1fr; }
    .split-bill-container { flex-direction: column; }
    .generic-item-header { flex-direction: column; align-items: flex-start; }
    .generic-item-header .generic-item-actions { width: 100%; justify-content: flex-end; margin-top: 10px; }
    #menu-editor-list .generic-item-header { flex-direction: row; align-items: center; }
}

/* ===== RECEIPT FOOTER COMPACT ===== */
.receipt-footer-msg { font-size: 10px; font-style: italic; }

/* ===== TABLE STATUS COLORS ===== */
.table-item.available {
    background: rgba(76,217,100,0.08);
    border: 1.5px solid var(--color-success);
}
.table-item.available .table-number { color: var(--color-success); }
.table-item.occupied {
    background: rgba(255,59,48,0.06);
    border: 1.5px solid var(--color-danger);
    position: relative;
    animation: pulse-border 2s infinite;
}
.table-item.occupied .table-number { color: var(--color-danger); }
@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(255,71,87,0.3); }
    70% { box-shadow: 0 0 0 8px rgba(255,71,87,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,71,87,0); }
}

/* ===== MODERN SCROLLBAR — White Glass ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.55);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
}
::-webkit-scrollbar-thumb:hover { 
    background: rgba(255,255,255,0.80);
}

/* ===== RIPPLE EFFECT ===== */
.nav-btn, .checkout-btn, .category-btn, .payment-btn { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple-animation 0.6s linear; background-color: rgba(255, 220, 150, 0.5); pointer-events: none; }
@keyframes ripple-animation { to { transform: scale(4); opacity: 0; } }

/* ===== TYPEWRITER CURSOR ===== */
.cursor { animation: blink 1s infinite; font-weight: bold; color: var(--color-accent-primary); margin-left: 2px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ===== iOS 6 PAGE TRANSITIONS ===== */
.section {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}
.section.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    display: block;
}

/* ===== iOS 6 BUTTON PRESS ANIMATION ===== */
.nav-btn:active, .order-type-btn:active, .category-btn:active, 
.checkout-btn:active, .kot-btn:active, .payment-btn:active,
.clear-btn:active, .discount-btn:active, .filter-btn:active, .ts-view-btn:active {
    transform: scale(0.93) !important;
    transition: transform 0.08s ease !important;
}

/* ===== iOS 6 MENU ITEM BOUNCE ===== */
.menu-item {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.menu-item:active {
    transform: scale(0.92) !important;
}

/* ===== iOS 6 MODAL SLIDE UP ===== */
@keyframes ios6ModalIn {
    0% { transform: translateY(100%) scale(0.9); opacity: 0; }
    60% { transform: translateY(-10px) scale(1.01); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-content {
    animation: ios6ModalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* ===== iOS 6 CART ITEM BOUNCE ===== */
@keyframes itemAdd {
    0% { opacity: 0; transform: translateX(60px) scale(0.8); }
    60% { transform: translateX(-8px) scale(1.02); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* ===== iOS 6 TABLE PULSE IMPROVED ===== */
.table-item {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.table-item:hover {
    transform: translateY(-6px) scale(1.03) !important;
}

/* ===== HAPPY HOUR BANNER ===== */
#happy-hour-banner {
    font-family: 'DM Sans', sans-serif;
}

/* ===== MODERN NAV ACTIVE ===== */
.nav-btn.active {
    animation: none;
}

/* ===== NOTIFICATION SHAKE ===== */
@keyframes notificationShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}
.notification.error {
    animation: notificationSlide 3s ease-in-out forwards, notificationShake 0.4s ease 0.1s !important;
}

/* ---- MOBILE BOTTOM NAV BAR ---- */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 900px) {

    /* ---- HIDE DESKTOP ELEMENTS ---- */
    .header { 
        padding: 6px 10px !important; 
        margin-bottom: 8px !important;
        border-radius: 6px !important;
        position: relative !important;
        z-index: 100;
        flex-wrap: wrap !important;
        row-gap: 0 !important;
        overflow: visible !important;
    }
    .header h1 { font-size: 0.85em !important; margin-bottom: 0 !important; }
    .header-nav-wrapper { display: none !important; }
    /* Logo + O.C.C / license badges — stays on the LEFT of the same row as
       the New Order / Dine-In buttons (no longer forced to its own row) */
    .header-logo-badges-wrap { order: 1 !important; flex-shrink: 0 !important; gap: 6px !important; }
    #opening-cash-display, #license-days-badge { padding: 2px 6px !important; font-size: 0.62em !important; }
    /* "+ New Order" and "Dine-In" buttons — SAME row + same "column"/line as
       the O.C.C / license badges, right next to them (not on a new row) */
    .header-ordtype-wrapper {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        order: 2 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        gap: 4px !important;
    }
    .header-ordtype-wrapper .new-order-btn { flex: 1 1 auto !important; min-width: 0 !important; width: auto !important; padding: 6px 6px !important; font-size: 0.68em !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
    .order-type-caret-btn { flex-shrink: 0 !important; width: auto !important; padding: 6px 6px !important; font-size: 0.64em !important; }
    /* active orders — break to its own full-width row on mobile */
    .header .active-tables-section {
        order: 10 !important;
        flex-basis: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 4px 0 0 0 !important;
        padding: 6px 2px 4px 2px !important;
        border-top: 1px solid rgba(0,0,0,0.14) !important;
        overflow: visible !important;
    }
    .header .active-tables-list {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        padding: 6px 2px 4px 2px !important;
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }
    .header .active-tables-list::-webkit-scrollbar { display: none; }

    /* ---- BODY PADDING for bottom nav ---- */
    body {
        padding-bottom: 70px;
    }

    /* ---- POS CONTAINER ---- */
    .pos-container {
        padding: 8px 8px 8px 8px !important;
    }

    /* ---- POS MAIN LAYOUT — STACK ---- */
    .pos-main-layout {
        flex-direction: column !important;
        gap: 0 !important;
    }
    .main-content-wrapper {
        width: 100% !important;
        flex: unset !important;
    }

    /* ---- CART SECTION — FLOATING WHITE GLASS DRAWER ---- */
    .cart-section {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 500 !important;
        border-radius: 24px 24px 0 0 !important;
        height: 85vh !important;
        max-height: 85vh !important;
        display: flex !important;
        flex-direction: column !important;
        transform: translateY(100%) !important;
        transition: transform 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.15) !important;
        background: rgba(255,255,255,0.85) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-top: 1px solid rgba(255,255,255,0.9) !important;
    }
    .cart-section.cart-open {
        transform: translateY(0) !important;
    }
    /* Items area scrolls, header and footer are fixed */
    .cart-section .cart-items {
        max-height: none !important;
    }
    .cart-section .cart-header,
    .cart-section .cart-close-btn-mobile,
    .cart-section .selected-table-info,
    .cart-section #cart-waiter-display {
        flex-shrink: 0 !important;
    }
    .cart-section .cart-footer-wrapper {
        flex-shrink: 0 !important;
    }

    /* Cart drag handle */
    .cart-section::before {
        content: '';
        display: block;
        width: 50px;
        height: 5px;
        background: rgba(100,70,20,0.3);
        border-radius: 3px;
        margin: 10px auto 5px auto;
    }

    /* ---- CART OVERLAY ---- */
    .cart-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 499;
    }
    .cart-overlay.active { display: block; }

    /* ---- FLOATING CART BUTTON ---- */
    .mobile-cart-fab {
        position: fixed !important;
        bottom: 70px !important;
        right: 16px !important;
        z-index: 498 !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
        background: rgba(0,122,255,0.9) !important;
        color: var(--text-on-accent) !important;
        border: 1px solid rgba(0,122,255,0.4) !important;
        font-size: 1.5em !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        box-shadow: 0 4px 20px rgba(0,122,255,0.25) !important;
        transition: transform 0.2s ease !important;
    }
    .mobile-cart-fab:active { transform: scale(0.9) !important; }
    .mobile-cart-fab-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: var(--color-danger);
        color: var(--text-on-accent);
        border-radius: 50%;
        min-width: 22px;
        height: 22px;
        font-size: 0.65em;
        font-weight: 700;
        line-height: 22px;
        text-align: center;
        border: 2px solid var(--text-on-accent);
        padding: 0 3px;
    }

    /* ---- BOTTOM NAV BAR — White Glass ---- */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 60px !important;
        z-index: 600 !important;
        background: rgba(255,255,255,0.80) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border-top: 1px solid rgba(255,255,255,0.85) !important;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.10) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 0 4px !important;
        align-items: stretch !important;
        gap: 0 !important;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .mobile-bottom-nav::-webkit-scrollbar { display: none; }

    .mobile-nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
        min-width: 60px !important;
        min-height: 44px !important;
        padding: 6px 6px !important;
        cursor: pointer !important;
        border-radius: 10px !important;
        margin: 4px 2px !important;
        transition: all 0.2s ease !important;
        background: transparent !important;
        border: none !important;
        color: var(--text-muted) !important;
        font-family: 'DM Sans', sans-serif !important;
    }
    .mobile-nav-item.active {
        background: var(--btn-active-bg) !important;
        color: var(--btn-active-color) !important;
        border: 1px solid var(--btn-active-border) !important;
    }
    .mobile-nav-item .mnav-icon {
        font-size: 1.3em !important;
        line-height: 1 !important;
        margin-bottom: 2px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: inherit !important;
    }
    .mobile-nav-item .mnav-icon svg {
        stroke: currentColor !important;
        display: block !important;
    }
    .mobile-nav-item .mnav-label {
        font-size: 0.58em !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        text-transform: uppercase !important;
        letter-spacing: 0.04em !important;
    }
    .mobile-nav-item.logout-item {
        color: rgba(255,71,87,0.6) !important;
    }
    .mobile-nav-item.logout-item.active {
        background: rgba(255,71,87,0.1) !important;
    }

    /* ---- MENU ITEMS — 2 column grid on mobile ---- */
    .menu-items {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .menu-item {
        padding: 10px 8px !important;
    }
    .item-icon { font-size: 1.6em !important; }
    .item-name { font-size: 0.78em !important; }
    .item-price { font-size: 0.78em !important; }

    /* ---- TABLES GRID ---- */
    .tables-section {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .table-number { font-size: 1.4em !important; }

    /* ---- ACTIVE TABLE CHIPS ---- */
    .active-tables-section {
        overflow: visible !important;
        padding-top: 14px !important;
    }
    .active-tables-list { 
        display: flex !important; 
        flex-wrap: nowrap !important; 
        overflow-x: auto !important;
        overflow-y: visible !important;
        gap: 8px !important;
        padding-bottom: 6px !important;
        padding-top: 10px !important;
        -ms-overflow-style: none !important;
        scrollbar-width: none !important;
    }
    .active-tables-list::-webkit-scrollbar { display: none; }
    .active-table-btn {
        flex: 0 0 auto !important;
        overflow: visible !important;
        position: relative !important;
        margin-top: 6px !important;
    }
    .active-table-btn .notification-badge {
        position: absolute !important;
        top: -10px !important;
        right: -8px !important;
        overflow: visible !important;
        z-index: 5 !important;
        min-width: 18px !important;
        height: 18px !important;
        line-height: 18px !important;
        font-size: 10px !important;
    }

    /* ---- HISTORY ITEMS — 1 column ---- */
    .history-items { 
        grid-template-columns: 1fr !important; 
        max-height: none !important;
    }
    .history-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ---- MODALS — Full screen on mobile ---- */
    .modal-content {
        max-height: 90vh !important;
        overflow-y: auto !important;
        margin: 5% auto !important;
        width: 95% !important;
    }

    /* ---- ORDER TYPE BTNS ---- */
    .order-type-btn {
        padding: 8px 10px !important;
        font-size: 0.78em !important;
    }

    /* ---- NOTIFICATION PANEL ---- */
    #notification-panel {
        right: 5px !important;
        width: calc(100% - 10px) !important;
        top: 55px !important;
        z-index: 9999 !important;
    }

    /* ---- ADMIN CHARTS ---- */
    .admin-charts-container {
        grid-template-columns: 1fr !important;
    }
    .admin-extra-grid {
        grid-template-columns: 1fr !important;
    }
    .admin-chart-box.has-canvas {
        height: 260px !important;
        padding: 12px !important;
    }

    /* ---- SUPPLIER LIST ---- */
    .supplier-history-list {
        grid-template-columns: 1fr !important;
    }

    /* ---- ADMIN SUMMARY CARDS ---- */
    .admin-summary-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .admin-card {
        padding: 12px 8px !important;
    }
    .admin-card p {
        font-size: 1.15em !important;
        overflow-wrap: anywhere !important;
    }

    /* ---- CATEGORY BUTTONS ---- */
    .menu-categories {
        overflow-x: auto !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        padding-bottom: 6px !important;
        -ms-overflow-style: none;
        scrollbar-width: none;
        gap: 6px !important;
    }
    .menu-categories::-webkit-scrollbar { display: none; }
    .category-btn {
        flex: 0 0 auto !important;
        padding: 8px 12px !important;
        font-size: 0.82em !important;
        white-space: nowrap !important;
    }

    /* ---- FORM GRID ---- */
    .expense-form-grid,
    .expense-summary-panel {
        grid-template-columns: 1fr !important;
    }

    /* ---- SETTINGS DASHBOARD ---- */
    .settings-dashboard {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ---- CART SECTION INNER ---- */
    /* Zoom out cart content slightly to show more items */
    .cart-section .cart-items,
    .cart-section .cart-footer-wrapper {
        font-size: 0.88em !important;
    }
    .cart-section .cart-item {
        padding: 6px 8px !important;
    }
    .cart-section .quantity-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 1.1em !important;
    }
    .cart-section .quantity-display {
        padding: 2px 8px !important;
        font-size: 0.95em !important;
    }
    /* Compact cart summary for mobile — more room for item list */
    .cart-section .cart-summary {
        padding: 5px 8px !important;
        margin-bottom: 5px !important;
        font-size: 0.78em !important;
    }
    .cart-section .summary-row {
        margin-bottom: 2px !important;
        line-height: 1.3 !important;
    }
    .cart-section .discount-section {
        margin-bottom: 6px !important;
    }
    .cart-section .discount-section h4 {
        font-size: 0.78em !important;
        margin-bottom: 5px !important;
    }
    .cart-section .discount-btn {
        padding: 4px 8px !important;
        font-size: 0.78em !important;
    }
    .cart-section .cart-total {
        padding: 7px 8px !important;
        font-size: 1.05em !important;
        margin-bottom: 6px !important;
    }
    .cart-section .cart-items {
        min-height: 0 !important;
    }

    /* ---- SEARCH INPUT ---- */
    #menuSearchInput {
        font-size: 16px !important; /* Prevent iOS zoom */
    }
    .form-input { font-size: 16px !important; }

    /* ---- NOTIFICATION BELL IN BOTTOM NAV ---- */
    .mobile-notif-btn {
        position: relative;
    }
}

/* ---- CART CLOSE BTN ---- */
.cart-close-btn-mobile {
    display: none;
}
@media (max-width: 900px) {
    .cart-close-btn-mobile {
        display: block !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
        width: 100% !important;
        text-align: right !important;
        padding: 8px 12px 4px 12px !important;
        background: transparent !important;
        border: none !important;
        font-size: 1.3em !important;
        color: rgba(60,30,0,0.6) !important;
        cursor: pointer !important;
    }
}

/* ===== LICENSE ACTIVATION SCREEN ===== */
#license-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1999;
    background-image: url('https://images.unsplash.com/photo-1555396273-367ea4eb4db5?q=80&w=1974&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
}
#license-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(20,8,0,0.7);
    backdrop-filter: none;
}
.license-box {
    position: relative;
    background: linear-gradient(170deg, #5c3018 0%, #3d1e0a 50%, #5c3018 100%);
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(0,0,0,0.1) 3px, rgba(0,0,0,0.1) 6px),
        linear-gradient(170deg, #5c3018 0%, #3d1e0a 50%, #5c3018 100%);
    border: 1px solid #2a0e00;
    outline: 3px dashed rgba(160,100,40,0.5);
    outline-offset: -10px;
    padding: 35px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,180,60,0.2);
    width: 92%;
    max-width: 420px;
}
.license-box .lic-icon { font-size: 3em; margin-bottom: 10px; display: block; }
.license-box h2 { color: #f0c060; font-size: 1.6em; margin-bottom: 8px; text-shadow: 0 2px 6px rgba(0,0,0,0.8); }
.license-box .lic-status-msg {
    color: rgba(255,180,100,0.85);
    font-size: 0.95em;
    margin-bottom: 22px;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(255,150,50,0.2);
}
.license-box .lic-status-msg.expired { color: #ff8060; border-color: rgba(255,80,60,0.3); }
.license-box .lic-plan-badge {
    display: inline-block;
    background: linear-gradient(180deg, #3a9020, #1a6008);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 700;
    margin-bottom: 18px;
    border: 1px solid #0e3e04;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
#license-code-input {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: 2px solid rgba(200,150,60,0.4);
    background: linear-gradient(180deg, #1a0a00, #2a1200);
    color: #f0d080;
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
    font-family: 'Ubuntu Mono', monospace;
}
#license-code-input::placeholder { color: rgba(200,150,60,0.35); letter-spacing: 1px; font-size: 0.85em; }
#license-code-input:focus { outline: none; border-color: #c07830; box-shadow: inset 0 2px 8px rgba(0,0,0,0.5), 0 0 0 3px rgba(192,120,48,0.25); }
#apply-license-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(180deg, #5caa30 0%, #3a8010 45%, #2a6008 50%, #4a9820 100%);
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #1a4804;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 0 rgba(180,255,80,0.3);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.4);
    margin-bottom: 10px;
    transition: transform 0.1s ease;
}
#apply-license-btn:active { transform: scale(0.97); }
#apply-license-btn:disabled { background: linear-gradient(180deg, #888 0%, #555 50%, #666 100%); cursor: not-allowed; }
#lic-logout-btn {
    background: none;
    border: none;
    color: rgba(255,120,80,0.7);
    font-size: 0.85em;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 6px;
}
.lic-divider { 
    border: none; 
    border-top: 1px dashed rgba(180,120,40,0.3); 
    margin: 18px 0; 
}
.lic-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82em;
    color: rgba(200,160,80,0.7);
    margin-bottom: 6px;
}
.lic-info-row strong { color: rgba(240,200,100,0.9); }
.lic-countdown {
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-size: 0.82em;
    color: rgba(200,160,80,0.8);
    border: 1px solid rgba(180,120,40,0.2);
}
.lic-countdown .days-left { font-size: 1.6em; font-weight: 700; color: #f0c060; display: block; }
.lic-countdown .days-left.warning { color: #ff9040; }
.lic-countdown .days-left.danger { color: #ff5030; }
#lic-loading { 
    display: none; 
    color: rgba(220,180,100,0.8); 
    font-size: 0.9em; 
    margin-top: 8px; 
    animation: lic-pulse 1s infinite alternate;
}
@keyframes lic-pulse { from { opacity: 0.5; } to { opacity: 1; } }

/* ===== NEW ORDER MODAL — TABLE GRID BUTTONS (Modern Redesign) ===== */
.new-order-table-btn {
    padding: 12px 6px 10px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    line-height: 1.4;
    width: 100%;
    font-family: inherit;
    border: 1.5px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    position: relative;
    overflow: hidden;
}
.new-order-table-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset;
    pointer-events: none;
}
.new-order-table-btn .tbl-icon {
    display: block;
    font-size: 1.5em;
    margin-bottom: 4px;
    line-height: 1;
}
.new-order-table-btn .tbl-name {
    display: block;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.new-order-table-btn .tbl-cap {
    display: block;
    font-size: 0.78em;
    opacity: 0.7;
    font-weight: 500;
    margin-top: 2px;
}
.new-order-table-btn.available {
    border-color: var(--accent-primary);
    background: linear-gradient(180deg, rgba(91,141,217,0.18) 0%, rgba(30,110,200,0.10) 100%);
    color: var(--text-primary);
}
.new-order-table-btn.available:hover {
    background: linear-gradient(180deg, rgba(91,141,217,0.30) 0%, rgba(30,110,200,0.18) 100%);
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 8px 20px rgba(30,110,200,0.25);
    border-color: var(--accent-secondary);
}
.new-order-table-btn.available:active {
    transform: scale(0.95);
    transition: transform 0.08s;
}
.new-order-table-btn.occupied {
    border-color: var(--color-danger);
    background: linear-gradient(180deg, rgba(204,34,0,0.10) 0%, rgba(180,20,0,0.06) 100%);
    color: var(--color-danger);
    opacity: 0.55;
    cursor: not-allowed;
}
.new-order-table-btn.selected-table {
    border-color: var(--accent-primary) !important;
    background: linear-gradient(180deg, rgba(91,141,217,0.40) 0%, rgba(30,110,200,0.28) 100%) !important;
    color: #fff !important;
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(30,110,200,0.40), 0 0 0 3px rgba(91,141,217,0.35);
}
/* New Order Modal — layout */
.new-order-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--separator-color);
}
.new-order-modal-header .nom-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3em;
    box-shadow: 0 3px 10px rgba(30,110,200,0.35);
    flex-shrink: 0;
}
.new-order-modal-header h3 {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.new-order-section-label {
    font-size: 0.76em;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.new-order-section-label::before {
    content: '';
    display: inline-block;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--accent-primary);
}
.nom-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
    overflow-y: auto;
    padding: 6px 4px;
    border-radius: 10px;
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border-subtle);
}
.nom-quick-guest-btn {
    padding: 6px 10px; border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: var(--btn-default-bg);
    color: var(--text-primary);
    font-size: 0.8em; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.nom-quick-guest-btn:hover { background: var(--btn-active-bg); color: #fff; border-color: var(--btn-active-border); }
.nom-selected-info {
    display: none;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(91,141,217,0.12), rgba(30,110,200,0.08));
    border: 1.5px solid var(--accent-primary);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.88em;
    color: var(--text-primary);
    margin-bottom: 14px;
}
.nom-selected-info .nom-si-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(91,141,217,0.6);
    animation: nomPulse 1.5s ease-in-out infinite;
}
@keyframes nomPulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.5;transform:scale(0.7);} }
.nom-actions { display: flex; gap: 10px; }
.nom-cancel-btn {
    flex: 1; padding: 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: var(--btn-cancel-bg);
    color: var(--btn-cancel-color);
    font-size: 0.95em; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.nom-start-btn {
    flex: 2; padding: 12px;
    border-radius: 10px;
    border: 1.5px solid var(--btn-active-border);
    background: var(--btn-active-bg);
    color: #fff;
    font-size: 0.95em; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    opacity: 0.5;
    box-shadow: 0 3px 10px rgba(30,110,200,0.25);
}
.nom-start-btn:not([disabled]) { opacity: 1; }
.nom-start-btn:not([disabled]):hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(30,110,200,0.35); }

/* ===== NEW ORDER MODAL — wide 3-column layout (Table / PAX / Waiter) so it's
   short & vertical instead of tall & square and needs no scroll on desktop ===== */
.nom-wide-modal { max-width: 860px !important; width: 94% !important; }
.nom-columns {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}
.nom-column { min-width: 0; }
.nom-pax-grid {
    display: grid;
    overflow-y: auto;
    border-radius: 10px;
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border-subtle);
}
.nom-pax-btn:hover { background: var(--btn-active-bg); color: #fff; border-color: var(--btn-active-border); }
.nom-waiter-grid {
    display: grid;
    overflow-y: auto;
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    min-height: 40px;
}
@media (max-width: 768px) {
    .nom-wide-modal { max-width: 460px !important; width: 92% !important; }
    .nom-columns { grid-template-columns: 1fr; gap: 14px; }
}

/* ===== TOTAL PAX MODAL ===== */
.pax-modal-content { max-width: 460px; width: 92%; border-radius: 18px; }
.pax-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
}
.pax-stat-card {
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
    border: 1.5px solid var(--border-color);
    background: var(--bg-stat-card);
    transition: all 0.15s;
}
.pax-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.pax-stat-card .pax-label {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.pax-stat-card .pax-value {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
    font-family: 'Courier New', Consolas, monospace;
}
.pax-stat-card .pax-sub {
    font-size: 0.75em;
    color: var(--text-muted);
    margin-top: 4px;
}
.pax-stat-card.today-card { border-color: rgba(91,141,217,0.4); background: linear-gradient(135deg, rgba(91,141,217,0.12), rgba(30,110,200,0.06)); }
.pax-stat-card.today-card .pax-value { color: var(--accent-primary); }
.pax-stat-card.weekly-card { border-color: rgba(52,168,90,0.4); background: linear-gradient(135deg, rgba(52,168,90,0.10), rgba(30,140,60,0.05)); }
.pax-stat-card.weekly-card .pax-value { color: var(--accent-green); }
.pax-stat-card.monthly-card { border-color: rgba(224,120,0,0.4); background: linear-gradient(135deg, rgba(224,120,0,0.10), rgba(180,80,0,0.05)); }
.pax-stat-card.monthly-card .pax-value { color: var(--accent-warm); }
.pax-stat-card.total-card { border-color: rgba(155,141,217,0.4); background: linear-gradient(135deg, rgba(155,141,217,0.12), rgba(100,80,180,0.06)); }
.pax-stat-card.total-card .pax-value { color: var(--color-purple); }

/* ============================================================
   LIVE PUSH NOTIFICATION — CENTER-SCREEN POPUP MODAL
   (uses the same .modal / .modal-content system as the rest of the app)
   ============================================================ */
.live-notif-modal-content {
    max-width: 380px;
    text-align: center;
    position: relative;
    padding-top: 30px;
    overflow: hidden;
}
.live-notif-modal-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: var(--color-info);
}
.live-notif-modal-icon {
    font-size: 2.6em;
    line-height: 1;
    margin-bottom: 10px;
    animation: live-notif-pop 0.4s ease-out;
}
.live-notif-modal-title {
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.live-notif-modal-msg {
    font-size: 1.08em;
    line-height: 1.55;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 22px;
    word-break: break-word;
    white-space: pre-wrap;
}
@keyframes live-notif-pop {
    0% { transform: scale(0.4); opacity: 0; }
    70% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); }
}

/* ===== NEW ORDER MODAL — touch-friendly PAX (3 per row, 12 total) & Waiter (1 per row) =====
   Same size/shape/feel as the Table buttons on the left. */
.nom-pax-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 4px; max-height: 300px; }
.nom-waiter-grid { grid-template-columns: 1fr; gap: 8px; padding: 6px 4px; max-height: 300px; }
.nom-table-grid { max-height: 300px; }
.nom-pax-btn, .nom-waiter-btn {
    min-height: 64px; padding: 12px 6px 10px; border-radius: 12px;
    border: 1.5px solid var(--accent-primary);
    background: linear-gradient(180deg, rgba(91,141,217,0.18) 0%, rgba(30,110,200,0.10) 100%);
    color: var(--text-primary); font-family: inherit; font-size: 1em; font-weight: 700;
    cursor: pointer; width: 100%; text-align: center; line-height: 1.3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nom-pax-btn { font-size: 1.25em; }
.nom-pax-btn:hover, .nom-waiter-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,110,200,0.25); }
.nom-pax-btn:active, .nom-waiter-btn:active { transform: scale(0.95); transition: transform 0.08s; }
.nom-pax-btn.selected-pax, .nom-waiter-btn.selected-waiter {
    background: linear-gradient(180deg, rgba(91,141,217,0.40) 0%, rgba(30,110,200,0.28) 100%);
    color: #fff; border-color: var(--accent-primary);
    box-shadow: 0 6px 20px rgba(30,110,200,0.40), 0 0 0 3px rgba(91,141,217,0.35);
}
@media (max-width: 768px) {
    .nom-waiter-grid, .nom-table-grid { max-height: 240px; }
}

/* ===== CART header: Waiter + Table cards (equal size) between "Order List" and ? / calculator ===== */
.cart-meta-card {
    flex: 1 1 0; min-width: 0; width: 0; max-width: calc(50% - 3px); height: 34px; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 0 8px; margin: 0 !important; border-radius: 10px;
    font-size: 0.74em; text-align: center; overflow: hidden;
}

/* ---------- Desktop / Tablet landscape ---------- */
@media (min-width: 901px) {
    .cart-section {
        position: sticky;
        top: 8px;
        align-self: flex-start;
        height: calc(100vh - 16px);
        max-height: calc(100vh - 16px);
        min-height: 0;
        overflow: hidden;
    }
    /* If the top header is sticky as well, leave room for it */
    body:has(.header) .cart-section {
        top: 66px;
        height: calc(100vh - 74px);
        max-height: calc(100vh - 74px);
    }
    .cart-section .cart-items {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        margin-bottom: 8px;
        overscroll-behavior: contain;
    }
    .cart-section .cart-footer-wrapper {
        flex: 0 0 auto;
    }
}

/* ---------- Footer pieces (all screen sizes) ---------- */
.cart-section .cart-footer-wrapper {
    border-top: 1px solid rgba(0,0,0,0.18);
    padding-top: 8px;
}

/* Collapsible discount */
.discount-section { margin-bottom: 6px; }
.discount-toggle {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle, rgba(0,0,0,0.2));
    background: var(--bg-surface-md, rgba(0,0,0,0.05));
    color: var(--text-primary, #1a1a18);
    font-family: inherit; font-size: 0.82em; font-weight: 700;
    cursor: pointer;
}
.discount-toggle-right { display: inline-flex; align-items: center; gap: 8px; }
#discountToggleSummary { color: var(--color-success, #2a7230); font-weight: 700; }
.discount-toggle .dt-arrow { transition: transform 0.15s ease; display: inline-block; }
.discount-section.open .dt-arrow { transform: rotate(180deg); }
.discount-body { display: none; padding-top: 8px; }
.discount-section.open .discount-body { display: block; }

/* Compact totals: 2 x 2 grid instead of 4 stacked rows */
.cart-section .cart-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    row-gap: 2px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.8em;
}
.cart-section .cart-summary .summary-row { margin-bottom: 0; line-height: 1.35; }
.cart-section .cart-total {
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 1.2em;
}

/* Action buttons */
.cart-section .cart-actions { gap: 0; }
.cart-section .main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr auto;
    gap: 6px;
    align-items: stretch;
}
.cart-section .main-actions > button,
.cart-section .more-wrap > .more-btn {
    min-height: 44px;
    padding: 6px 8px;
    font-size: 0.86rem;
    width: 100%;
    white-space: nowrap;
}
.cart-section .main-actions .checkout-btn {
    font-size: 0.98rem;
    letter-spacing: 0.3px;
}
.cart-section .more-wrap { position: relative; display: flex; }
.cart-section .more-btn {
    background: var(--btn-default-bg, linear-gradient(180deg,#f0ede4 0%,#dedad0 45%,#c8c4bc 50%,#dedad0 100%));
    color: var(--btn-default-color, #1a1a18);
    border: 1px solid rgba(0,0,0,0.38);
    border-radius: 6px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 2px 4px rgba(0,0,0,0.25);
}
.cart-section .more-btn[aria-expanded="true"] { filter: brightness(0.92); }

/* Pop-up menu opens UPWARD so it never leaves the screen */
.cart-section .more-menu {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    min-width: 190px;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 10px;
    background: #e8e5dc;
    border: 1px solid rgba(0,0,0,0.35);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    z-index: 600;
}
.cart-section .more-menu.open { display: flex; }
.cart-section .more-menu > button {
    width: 100%;
    min-height: 40px;
    text-align: left;
    padding: 8px 12px;
    font-size: 0.86rem;
}
/* keep the special red style of the KOT-void button inside the menu */
.cart-section .more-menu #kotVoidBtn {
    background: linear-gradient(180deg,#d85040 0%,#b82000 48%,#9c1800 52%,#b02000 100%);
    border-color: #780e00;
}

/* ---------- Mobile drawer ---------- */
@media (max-width: 900px) {
    .cart-section .cart-footer-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }
    .cart-section .cart-items { flex: 1 1 auto !important; }
    .cart-section .main-actions > button,
    .cart-section .more-wrap > .more-btn { min-height: 46px; }
    /* allow the menu to overflow the drawer footer */
    .cart-section { overflow: visible !important; }
    .cart-section .cart-items { overflow-y: auto !important; }
}

/* ===== MOBILE: New Order > PAX (1-10, 5 per row) & WAITER (2 per row) — neutral gradient buttons, green selected =====
   Desktop/laptop view is untouched (everything is inside the max-width:768px query). */
@media (max-width: 768px) {
    .nom-pax-grid, .nom-waiter-grid {
        gap: 8px; padding: 8px; max-height: none; overflow: visible;
        border-radius: 18px;
        background: rgba(0,0,0,0.035);
        border: 1.5px solid var(--border-color, rgba(0,0,0,0.18));
    }
    .nom-pax-grid { grid-template-columns: repeat(5, 1fr); }
    .nom-pax-btn:nth-child(n+11) { display: none; }   /* show only 1-10 on mobile */
    .nom-waiter-grid { grid-template-columns: 1fr 1fr; }
    .nom-pax-btn, .nom-waiter-btn { padding: 8px 4px; border-radius: 14px;
        border: 2px solid rgba(0,0,0,0.22);
        background: linear-gradient(180deg, #f4f4f2 0%, #d9d9d6 100%);
        color: var(--text-primary); font-weight: 800;
        box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 2px 4px rgba(0,0,0,0.12);
        transform: none;
    }
    .nom-pax-btn { font-size: 1.35em; min-height: 52px; }
    .nom-waiter-btn { font-size: 1em; text-transform: uppercase; min-height: 44px; }
    .nom-pax-btn:hover, .nom-waiter-btn:hover { transform: none; box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 2px 4px rgba(0,0,0,0.12); background: linear-gradient(180deg, #f4f4f2 0%, #d9d9d6 100%); color: var(--text-primary); border-color: rgba(0,0,0,0.22); }
    .nom-pax-btn.selected-pax, .nom-waiter-btn.selected-waiter,
    .nom-pax-btn.selected-pax:hover, .nom-waiter-btn.selected-waiter:hover {
        background: linear-gradient(180deg, #2f9e44 0%, #1b6e2c 100%);
        color: #fff; border-color: #14531f;
        box-shadow: 0 0 0 3px rgba(47,158,68,0.30), 0 3px 8px rgba(0,0,0,0.25);
    }
}

/* ===== Custom shortcut rows ===== */
#shortcut-list { display: grid; gap: 8px; }
.sc-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.sc-row .sc-label { font-weight: 600; font-size: 0.9em; }
.sc-row .sc-input { text-align: center; cursor: pointer; }
.sc-row .sc-clear { width: 36px; height: 36px; }

/* ===== Responsive: device breakpoints ===== */
/* Desktop Devices (portrait and landscape) */
@media only screen and (min-width: 1440px) {
    .pos-main-layout { gap: 16px; }
    .tables-section { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
}
/* Laptop Devices (portrait and landscape) */
@media only screen and (min-width: 1024px) and (max-width: 1439px) {
    .pos-main-layout { gap: 12px; }
    .tables-section { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
/* Tablet Devices (portrait and landscape) */
@media only screen and (min-width: 768px) and (max-width: 1023px) {
    .pos-main-layout { gap: 10px; }
    .tables-section { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
    .payment-btn, .nav-btn, .discount-btn { min-height: 44px; }
}
/* Mobile Devices (portrait and landscape) */
@media only screen and (max-width: 767px) {
    .pos-main-layout { flex-direction: column; align-items: stretch; }
    .main-content-wrapper, .cart-section { width: 100%; flex: none; }
    .tables-section { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
    .payment-btn, .nav-btn { min-height: 46px; }
    .sc-row { grid-template-columns: 1fr auto; }
    .sc-row .sc-label { grid-column: 1 / -1; }
}

/* ---- HISTORY: list view (PC) — every field is a pill ---- */
.history-items.list-view { display: block; max-height: calc(100vh - 330px); min-height: 420px; padding-right: 4px; }
.history-row {
    border: 1px solid var(--border-subtle, rgba(0,0,0,.15));
    border-left: 5px solid var(--color-info);
    border-radius: 12px;
    margin-bottom: 6px;
    background: var(--bg-card, rgba(255,255,255,.55));
}
.history-row.dine-in { border-left-color: var(--color-success); }
.history-row.takeaway { border-left-color: var(--color-warning); }
.history-row.foodpanda { border-left-color: #c83080; }
.history-row.foodmama { border-left-color: #c05800; }
.history-row.voided { opacity: .65; border-left-color: var(--color-danger); }
.history-row.voided .hr-total, .history-row.voided .hr-no { text-decoration: line-through; }
.hr-main {
    display: grid;
    grid-template-columns: 96px 170px 104px minmax(120px,1.2fr) 82px 92px minmax(110px,1fr) 118px auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.95em;
    cursor: pointer;
}
.hr-main:hover { background: rgba(79,150,220,.08); }
.hr-main > span:not(.hr-actions) {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 12px; border-radius: 999px; min-height: 32px;
    font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: rgba(0,0,0,.06); border: 1px solid rgba(0,0,0,.10); color: var(--text-primary);
}
.hr-main > .hr-no    { background: rgba(88,86,214,.14);  border-color: rgba(88,86,214,.35);  color: #4a48b8; font-weight: 800; }
.hr-main > .hr-time  { background: rgba(79,150,220,.14); border-color: rgba(79,150,220,.35); color: var(--color-info); }
.hr-main > .hr-type  { background: rgba(42,114,48,.14);  border-color: rgba(42,114,48,.35);  color: var(--color-success); text-transform: capitalize; }
.hr-main > .hr-t-takeaway { background: rgba(192,120,0,.14); border-color: rgba(192,120,0,.35); color: var(--color-warning); }
.hr-main > .hr-place { background: rgba(0,0,0,.06); }
.hr-main > .hr-pax   { background: rgba(64,144,208,.16); border-color: rgba(64,144,208,.4); color: var(--color-info); }
.hr-main > .hr-pax:empty { visibility: hidden; }
.hr-main > .hr-items { background: rgba(32,96,160,.12);  border-color: rgba(32,96,160,.30);  color: var(--color-info); }
.hr-main > .hr-pay   { background: rgba(192,120,0,.14);  border-color: rgba(192,120,0,.35);  color: var(--color-warning); text-transform: capitalize; }
.hr-main > .hr-total { background: rgba(42,114,48,.16);  border-color: rgba(42,114,48,.4);   color: var(--color-success); font-weight: 800; font-size: 1.05em; }
.hr-actions { display: flex; gap: 6px; justify-content: flex-end; }
.hr-actions .kot-btn, .hr-actions .clear-btn {
    padding: 6px 16px !important; min-height: 32px; font-size: .95em !important; margin: 0 !important;
    border-radius: 999px !important; font-weight: 700;
}
.hr-detail { display: none; padding: 6px 16px 12px 112px; border-top: 1px dashed var(--border-subtle, rgba(0,0,0,.2)); font-size: .95em; }
.history-row.open .hr-detail { display: block; }
@media (max-width: 900px) {
    .history-items.list-view { max-height: none; }
    .hr-main { display: flex; flex-wrap: wrap; }
    .hr-main > .hr-total { margin-left: auto; }
    .hr-actions { width: 100%; }
    .hr-detail { padding-left: 14px; }
}

/* ---- RESERVATIONS: table-card states + list rows ---- */
.table-item.res-soon { box-shadow: 0 0 0 2px #d98b00 inset; }
.table-item.res-due  { box-shadow: 0 0 0 3px var(--system-red,#ff3b30) inset; animation: resPulse 1.2s ease-in-out infinite; }
.table-item.res-later { box-shadow: 0 0 0 1px var(--color-info) inset; }
.table-reservation-info.res-info-soon { color: #b36f00; }
.table-reservation-info.res-info-due  { color: var(--system-red,#ff3b30); font-weight: 800; }
@keyframes resPulse { 0%,100% { filter: none; } 50% { filter: brightness(1.12) saturate(1.3); } }
.res-row { padding: 8px 12px !important; margin-bottom: 4px !important; }
.res-row.res-done { opacity: .6; }

/* =====================================================================
   FLOOR PLAN
   ===================================================================== */
#tables-floor-view { width: 100%; }
.fp-tabs, .fp-palette, .fp-unplaced { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.fp-tab, .fp-pal-btn, .fp-chip {
    border: 1px solid var(--border-subtle, rgba(0,0,0,.2)); background: var(--bg-card, rgba(255,255,255,.7));
    color: var(--text-primary); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .88em; cursor: pointer;
}
.fp-tab.active { background: var(--accent-primary, #0a84ff); color: #fff; border-color: transparent; }
.fp-tab-act { border-style: dashed; opacity: .9; }
.fp-pal-btn { padding: 5px 11px; font-size: .82em; }
.fp-pal-btn:hover, .fp-tab:hover, .fp-chip:hover { filter: brightness(.95); }
.fp-pal-title { font-size: .8em; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; }
.fp-sep { width: 1px; height: 22px; background: var(--border-subtle, rgba(0,0,0,.2)); margin: 0 4px; }
.fp-snap { font-size: .85em; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.fp-unplaced { padding: 6px 10px; border: 1px dashed var(--color-warning, #c07800); border-radius: 12px; background: rgba(192,120,0,.08); }
.fp-chip.occ { border-color: #e07a5f; }

.fp-main { display: flex; gap: 10px; align-items: flex-start; }
.fp-wrap { flex: 1 1 auto; min-width: 0; overflow: auto; border: 1px solid var(--border-subtle, rgba(0,0,0,.2)); border-radius: 12px; background: #f4f1ea; max-height: calc(100vh - 230px); }
.fp-holder { position: relative; }
.fp-canvas {
    position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0;
    background-color: #f7f4ed;
    background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px);
    background-size: 20px 20px;
}
.fp-edit .fp-canvas {
    background-image: linear-gradient(rgba(0,0,0,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.08) 1px, transparent 1px);
    background-size: 10px 10px;
}
.fp-panel { display: none; flex: 0 0 270px; width: 270px; padding: 12px; border: 1px solid var(--border-subtle, rgba(0,0,0,.2)); border-radius: 12px; background: var(--bg-card, rgba(255,255,255,.7)); font-size: .9em; }
.fp-main.fp-edit .fp-panel { display: block; }
.fp-panel-h { font-weight: 800; margin-bottom: 8px; font-size: 1.05em; }
.fp-hint { color: var(--text-secondary); line-height: 1.7; }
.fp-panel label { display: block; font-size: .8em; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.fp-panel input, .fp-panel select { display: block; width: 100%; margin-top: 3px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border-subtle, rgba(0,0,0,.25)); background: var(--bg-input, #fff); color: var(--text-primary); font-size: 1.05em; box-sizing: border-box; }
.fp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fp-btnrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.fp-btnrow button { flex: 1; padding: 7px 8px; border-radius: 999px; border: 1px solid var(--border-subtle, rgba(0,0,0,.25)); background: var(--bg-card, #fff); color: var(--text-primary); font-weight: 700; cursor: pointer; font-size: .85em; }
.fp-btnrow button.danger { background: var(--system-red, #ff3b30); color: #fff; border-color: transparent; }
@media (max-width: 1000px) {
    .fp-main { flex-direction: column; align-items: stretch; }
    .fp-wrap { width: 100%; flex: none; box-sizing: border-box; min-height: 280px; max-height: calc(100vh - 300px); max-height: calc(100dvh - 300px); }
    .fp-panel { width: 100%; flex: none; box-sizing: border-box; }
}
.fp-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* zoom + text-size toolbar */
.fp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.fp-zoom { display: inline-flex; align-items: center; border: 1px solid var(--border-subtle, rgba(0,0,0,.25)); border-radius: 999px; overflow: hidden; background: var(--bg-card, #fff); }
.fp-zoom button { border: 0; background: transparent; color: var(--text-primary); font-weight: 800; font-size: 1.05em; min-width: 40px; height: 34px; padding: 0 10px; cursor: pointer; }
.fp-zoom button + button { border-left: 1px solid var(--border-subtle, rgba(0,0,0,.2)); }
.fp-zoom #fp-zoom-label { min-width: 58px; font-size: .85em; }
.fp-zoom button:active, .fp-tbtn:active, .fp-trow button:active { filter: brightness(.9); }
.fp-tbtn { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-subtle, rgba(0,0,0,.25)); background: var(--bg-card, #fff); color: var(--text-primary); font-weight: 700; font-size: .85em; cursor: pointer; }
.fp-textpanel { display: none; flex-direction: column; gap: 6px; max-width: 380px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border-subtle, rgba(0,0,0,.2)); border-radius: 12px; background: var(--bg-card, rgba(255,255,255,.7)); }
.fp-trow { display: flex; align-items: center; gap: 8px; font-size: .88em; font-weight: 700; }
.fp-tlbl { flex: 1 1 auto; color: var(--text-secondary); }
.fp-trow b { min-width: 30px; text-align: center; font-size: 1.05em; }
.fp-trow button { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--border-subtle, rgba(0,0,0,.25)); background: var(--bg-card, #fff); color: var(--text-primary); font-weight: 800; font-size: 1.1em; cursor: pointer; }
.fp-textpanel .fp-tbtn { align-self: flex-end; }

/* tables */
.fp-table { position: absolute; z-index: 3; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.fp-edit .fp-table, .fp-edit .fp-item { cursor: move; touch-action: none; }
.fp-body {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden;
    border: 2px solid #78b878; background: linear-gradient(145deg, #f4fff4, #d8f1d8); color: #1f3d1f;
    box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
.fp-shape-square .fp-body, .fp-shape-long .fp-body { border-radius: 10px; }
.fp-shape-round .fp-body, .fp-shape-bar .fp-body { border-radius: 50%; }
.fp-shape-sofa .fp-body { border-radius: 14px 14px 8px 8px; border-color: #8d6e63; background: #efe6e1; }
.fp-table.occupied .fp-body { border-color: #d9826a; background: linear-gradient(145deg, #ffe6df, #f6c3b6); color: #5b1f12; }
.fp-label { position: relative; z-index: 2; pointer-events: none; line-height: 1.15; max-width: 100%; padding: 0 3px; }
.fp-name, .fp-status, .fp-total, .fp-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-name { font-weight: 800; font-size: var(--fp-fs-name, 13px); }
.fp-status { font-size: var(--fp-fs-status, 11px); font-weight: 700; opacity: .9; }
.fp-pax { font-weight: 800; }
.fp-total { font-size: var(--fp-fs-total, 11px); font-weight: 800; }
.fp-time { font-size: var(--fp-fs-time, 10px); font-weight: 700; }
.fp-res { font-size: 10px; font-weight: 800; color: #0a5fb4; }
.fp-small .fp-name { font-size: calc(var(--fp-fs-name, 13px) * .77); } .fp-small .fp-status { font-size: calc(var(--fp-fs-status, 11px) * .82); }
.fp-small .fp-total, .fp-small .fp-time, .fp-small .fp-res { display: none; }
.fp-shape-sofa .fp-label { text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.fp-sofa-layer { position: absolute; inset: 0; display: flex; flex-direction: column; }
.fp-sofa-back { height: 24%; background: #8d6e63; }
.fp-cushions { flex: 1; display: flex; gap: 3px; padding: 3px; }
.fp-cushion { flex: 1; background: #d7ccc8; border-radius: 6px; }
.fp-cushion.taken { background: #e8806a; }
.fp-chair {
    position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; box-sizing: border-box;
    border-radius: 5px 5px 7px 7px; background: #c3cbd3; border: 1px solid #848e98; border-top: 5px solid #67717b;
}
.fp-chair.taken { background: #e8806a; border-color: #b5452f; border-top-color: #8f2f1c; }
.fp-table.fp-current .fp-body { outline: 3px solid var(--accent-primary, #0a84ff); outline-offset: 1px; }
.fp-table.res-later .fp-body { box-shadow: 0 0 0 2px var(--color-info, #4090d0), 0 2px 6px rgba(0,0,0,.2); }
.fp-table.res-soon .fp-body { box-shadow: 0 0 0 3px #d98b00, 0 2px 6px rgba(0,0,0,.2); }
.fp-table.res-due .fp-body { box-shadow: 0 0 0 4px var(--system-red, #ff3b30), 0 2px 8px rgba(0,0,0,.3); animation: resPulse 1.2s ease-in-out infinite; }

/* decor items */
.fp-item { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,.25); border-radius: 8px; color: #333; user-select: none; -webkit-user-select: none; }
.fp-item-in { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; pointer-events: none; white-space: nowrap; }
.fp-item-ico { font-size: 1.5em; }
.fp-i-wall { border-radius: 2px; border-color: #333; }
.fp-i-text { border: 1px dashed transparent; font-size: 16px; }
.fp-edit .fp-i-text { border-color: rgba(0,0,0,.3); }
.fp-i-plant { border-radius: 50%; }
.fp-selected { outline: 2px dashed #0a84ff; outline-offset: 3px; z-index: 6; }
.fp-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; background: #0a84ff; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; z-index: 10; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

.fp-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: .78em; color: var(--text-secondary); font-weight: 700; }
.fp-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.3); }
.fp-legend .avail { background: #d8f1d8; } .fp-legend .occ { background: #f6c3b6; }
.fp-legend .soon { background: #fff; box-shadow: 0 0 0 2px #d98b00; } .fp-legend .due { background: #fff; box-shadow: 0 0 0 2px #ff3b30; }
.fp-legend .chair { background: #c3cbd3; } .fp-legend .taken { background: #e8806a; }

/* =====================================================================
   RECEIPT REDESIGN (customer bill) — scoped to #receiptModal .receipt
   Presentation only. Compact, 80mm / 58mm thermal friendly, black & white.
   ===================================================================== */
#receiptModal .receipt {
    width: 100%; max-width: 70mm; margin: 0 auto; padding: 0 1mm; box-sizing: border-box;
    text-align: left; color: #000; background: #fff;
    font-family: 'Ubuntu', sans-serif; font-size: 11px; font-weight: 500; line-height: 1.2;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
#receiptModal .receipt * { box-sizing: border-box; }
#receiptModal .receipt .receipt-ico { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.12em; }

/* Header */
#receiptModal .receipt-header { text-align: center; padding: 0 0 1px; margin: 0; }
#receiptModal .receipt-logo { display: flex; justify-content: center; margin: 0 auto 1px; line-height: 0; }
#receiptModal .receipt-logo img { max-width: 100%; max-height: 20mm; width: auto; height: auto; object-fit: contain; }
#receiptModal .receipt-brand { font-size: 19px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; line-height: 1.05; word-break: break-word; }
#receiptModal .receipt-tagline { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 1px 0 2px; font-size: 8.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
#receiptModal .receipt-tagline::before, #receiptModal .receipt-tagline::after { content: ''; flex: 0 1 12px; border-top: 1px solid #000; }
#receiptModal .receipt-contact { font-size: 10px; margin-top: 1px; line-height: 1.15; }
#receiptModal .receipt-contact-line { display: flex; align-items: flex-start; justify-content: center; gap: 3px; margin-top: 0; word-break: break-word; }
#receiptModal .receipt-reg { flex-direction: row; flex-wrap: wrap; justify-content: center; column-gap: 8px; margin-top: 2px; font-size: 9.5px; }
#receiptModal .receipt-reg-line { line-height: 1.2; }

/* Status */
#receiptModal .receipt-status-wrap { display: flex; align-items: center; gap: 5px; margin: 2px 0 3px; }
#receiptModal .receipt-status-line { flex: 1; border-top: 1px solid #000; }
#receiptModal .receipt-status { background: #000; color: #fff; padding: 1px 12px; border-radius: 12px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap; }
#receiptModal .receipt-status.is-unpaid { background: #fff; color: #000; border: 1.5px solid #000; padding: 0 9px; font-size: 10.5px; }
#receiptModal .receipt-status.is-void { background: #000; color: #fff; text-decoration: line-through; }

/* Meta */
#receiptModal .receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6px; font-size: 10.5px; padding-bottom: 3px; border-bottom: 1px dashed #777; }
#receiptModal .receipt-meta-col { display: flex; flex-direction: column; min-width: 0; }
#receiptModal .receipt-meta-row, #receiptModal .receipt-meta-full { display: flex; gap: 3px; min-width: 0; }
#receiptModal .receipt-meta-full { grid-column: 1 / -1; }
#receiptModal .receipt-meta .k { flex: 0 0 auto; min-width: 10mm; }
#receiptModal .receipt-meta .c { flex: 0 0 auto; }
#receiptModal .receipt-meta .v { flex: 1 1 auto; font-weight: 700; word-break: break-word; min-width: 0; }

/* Items */
#receiptModal .receipt-items { width: 100%; border-collapse: collapse; margin: 3px 0 0; font-size: 11px; table-layout: auto; }
#receiptModal .receipt-items th { background: #e6e6e6; border: 0; padding: 1px 3px; font-size: 10px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; }
#receiptModal .receipt-items th:first-child { border-radius: 3px 0 0 3px; }
#receiptModal .receipt-items th:last-child { border-radius: 0 3px 3px 0; }
#receiptModal .receipt-items td { padding: 4px 3px; border: 0; vertical-align: top; }
#receiptModal .receipt-items tr.ri-last td { border-bottom: 1px solid #d0d0d0; }
#receiptModal .receipt-items tr:last-child td { border-bottom: 0; }
#receiptModal .receipt-items tr.receipt-item:not(.ri-last) td, #receiptModal .receipt-items tr.receipt-sub td { padding-bottom: 0; }
#receiptModal .receipt-items tr.receipt-sub + tr.receipt-sub td, #receiptModal .receipt-items tr.receipt-item + tr.receipt-sub td { padding-top: 0; }
#receiptModal .receipt-items tr.receipt-sub.ri-last td { padding-bottom: 4px; }
#receiptModal .receipt-item-name { font-weight: 700; word-break: break-word; overflow-wrap: anywhere; width: 100%; }
#receiptModal .receipt-item-qty { text-align: center; white-space: nowrap; padding-left: 5px; padding-right: 5px; }
#receiptModal .receipt-item-amt { text-align: right; white-space: nowrap; font-weight: 700; }
#receiptModal .receipt-modifier { font-size: 9.5px; font-weight: 500; color: #333; line-height: 1.15; padding-left: 3px; word-break: break-word; overflow-wrap: anywhere; }
#receiptModal .receipt-mod-price { white-space: nowrap; text-align: right; }
#receiptModal .receipt-note { font-style: italic; }
#receiptModal .receipt-item { break-inside: avoid; page-break-inside: avoid; }

/* Summary + total */
#receiptModal .receipt-summary { border-top: 1px dashed #777; margin-top: 2px; padding: 3px 3px 1px; font-size: 11px; break-inside: avoid; page-break-inside: avoid; }
#receiptModal .receipt-sum-row { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 1px; }
#receiptModal .receipt-sum-row > span:last-child { white-space: nowrap; text-align: right; }
#receiptModal .receipt-total { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: #e6e6e6; border-top: 1.5px solid #000; border-radius: 3px; padding: 2px 5px; margin-top: 2px; break-inside: avoid; page-break-inside: avoid; }
#receiptModal .receipt-total .lbl { font-size: 13px; font-weight: 800; }
#receiptModal .receipt-total .amt { font-size: 16px; font-weight: 800; white-space: nowrap; }

/* Payment */
#receiptModal .receipt-payment { background: #ececec; border-radius: 4px; padding: 3px 6px; margin-top: 4px; break-inside: avoid; page-break-inside: avoid; }
#receiptModal .receipt-payment-head { display: flex; justify-content: space-between; align-items: center; gap: 5px; padding-bottom: 2px; border-bottom: 1px solid #c8c8c8; }
#receiptModal .receipt-payment-head .ttl { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; letter-spacing: 0.3px; }
#receiptModal .receipt-pay-badge { border: 1.5px solid #000; border-radius: 10px; padding: 0 8px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; background: #fff; text-align: right; word-break: break-word; max-width: 60%; }
#receiptModal .receipt-pay-row { display: flex; justify-content: space-between; gap: 6px; margin-top: 1px; font-size: 11px; }
#receiptModal .receipt-pay-split { padding-bottom: 1px; border-bottom: 1px dotted #aaa; }
#receiptModal .receipt-pay-row strong { white-space: nowrap; }

/* Footer: [Payment QR] [Thank you + table time] [Review QR] */
#receiptModal .receipt-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 4px; margin-top: 4px; padding-top: 4px; border-top: 1px dashed #777; break-inside: avoid; page-break-inside: avoid; }
#receiptModal .receipt-footer-msg-col { flex: 1 1 18mm; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 4px; min-width: 0; }
#receiptModal .receipt-thanks { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 11.5px; line-height: 1.25; text-align: center; white-space: pre-line; word-break: break-word; }
#receiptModal .receipt-duration { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 3px; font-size: 9.5px; font-style: italic; color: #333; }
#receiptModal .receipt-footer-qr { flex: 0 0 20mm; flex-direction: column; align-items: center; justify-content: center; }
#receiptModal .receipt-footer-qr img { width: 19mm; height: 19mm; object-fit: contain; }
#receiptModal .receipt-qr-label { font-size: 8.5px; margin-top: 1px; text-align: center; }
#receiptModal .receipt-powered { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 9px; }
#receiptModal .receipt-powered span { flex: 1; border-top: 1px solid #000; }
#receiptModal .receipt-powered em { font-style: normal; white-space: nowrap; }

@media print {
    #receiptModal .receipt { margin: 0 auto; }
    #receiptModal .receipt-status, #receiptModal .receipt-total, #receiptModal .receipt-payment, #receiptModal .receipt-items th, #receiptModal .receipt-pay-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#receiptModal .receipt-items td.receipt-note { text-align: left !important; }
#receiptModal .receipt-items td.receipt-mod-price { text-align: right !important; }

/* ---- Active orders / running tables: never squeeze chips, scroll sideways instead ---- */
.active-tables-list { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; max-width: 100%; }
.active-tables-list .active-table-btn { flex: 0 0 auto; white-space: nowrap; }
.header .active-tables-section { min-width: 0; max-width: 100%; }

/* ---- Cart item: compact note input beside the price ---- */
.cart-item-pricerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cart-item-pricerow .cart-item-price { flex: 0 0 auto; }
.cart-item-pricerow .cart-item-note { flex: 1 1 auto; width: auto; min-width: 0; margin-top: 0; padding: 2px 7px; font-size: 0.75em; }

/* ===== NETWORK STATUS DOT (header) ===== */
.header h1 .logo-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    display: inline-block;
    transition: background .3s ease, box-shadow .3s ease;
}
.header h1 .logo-dot.online {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,.30), 0 0 10px 2px rgba(34,197,94,.85);
    animation: net-blink-green 1.4s ease-in-out infinite;
}
.header h1 .logo-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239,68,68,.30), 0 0 10px 2px rgba(239,68,68,.9);
    animation: net-blink-red .8s ease-in-out infinite;
}
@keyframes net-blink-green {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.8); }
}
@keyframes net-blink-red {
    0%, 100% { opacity: 1; transform: scale(1.1); }
    50%      { opacity: .2; transform: scale(.75); }
}

/* ===== TOP SELLING VIEW TABS + NEW ROWS ===== */
.ts-view-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.ts-view-btn { padding: 8px 16px; }
.ts-bar { grid-column: 2 / -1; height: 6px; border-radius: 4px; background: rgba(0,0,0,.08); overflow: hidden; margin-top: -6px; }
.ts-bar > span { display: block; height: 100%; background: var(--color-success); border-radius: 4px; }
.ts-sub { font-size: .75em; font-weight: 600; color: var(--text-secondary); margin-top: 2px; }
@media (max-width: 600px) { .top-selling-item { grid-template-columns: 32px 1fr 70px 90px; gap: 8px; padding: 10px; } }

/* ===== TOP SELLING: summary cards, deltas, warnings ===== */
.ts-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 4px; }
.ts-card { background: var(--bg-surface-md); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px 12px; text-align: center; }
.ts-card-label { font-size: .72em; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .03em; }
.ts-card-value { font-size: 1.15em; font-weight: 800; color: var(--text-primary); margin: 2px 0; font-family: monospace; }
.ts-cmp-note { grid-column: 1 / -1; font-size: .72em; color: var(--text-secondary); text-align: right; }
.ts-delta { display: inline-block; font-size: .72em; font-weight: 800; padding: 1px 7px; border-radius: 10px; margin-top: 2px; font-family: sans-serif; }
.ts-delta.up   { color: #15803d; background: rgba(34,197,94,.15); }
.ts-delta.down { color: #b91c1c; background: rgba(239,68,68,.15); }
.ts-delta.flat, .ts-delta.new { color: var(--text-secondary); background: rgba(0,0,0,.07); }
.ts-warn { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.4); color: #92400e; border-radius: 10px; padding: 8px 12px; font-size: .82em; font-weight: 600; }
.top-selling-revenue { min-width: 0; }

/* ===== AUTO BACKUP VIEW ===== */
.ab-box { background: var(--bg-surface-md); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 14px; }
.ab-toggle { display: flex; align-items: center; gap: 8px; font-size: .92em; cursor: pointer; flex-wrap: wrap; }
.ab-pill { color: #fff; font-size: .7em; font-weight: 800; padding: 2px 9px; border-radius: 10px; background: var(--color-danger); }
.ab-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--border-subtle); }
