/* ============================================================
   Design tokens — hand-rolled, no component library (Ayush's call).
   One place to change the accent color later once a real brand
   color is picked; everything else keys off these variables.
   ============================================================ */
:root {
    --font-sans: 'Plus Jakarta Sans', 'Noto Sans Devanagari', 'Noto Sans Gujarati', ui-sans-serif, system-ui, sans-serif;

    /* Zaika brand red, taken directly from the logo (rgb(193,17,0)). */
    --accent: #C11100;
    --accent-dark: #970E00;
    --accent-soft: #FBE4E0;

    --warn: #F0B429;
    --warn-soft: #FCF1D6;
    --success: #16A34A;
    --success-soft: #E1F5E8;
    --danger: #DC2626;
    --danger-soft: #FBE4E4;

    --ink: #1C232E;
    --ink-muted: #6B7280;
    --ink-faint: #9AA1AC;
    --border: #E7E9EC;
    --bg: #F5F6F8;
    --surface: #FFFFFF;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html, body {
    background: var(--bg);
    color: var(--ink);
    color-scheme: light only; /* a deliberate single-theme choice for now, not an oversight — see the earlier dark-background fix */
    font-family: var(--font-sans);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Scrolling stays fully functional (mouse wheel, trackpad, keyboard) — this only
   hides the visible scrollbar track/thumb, a deliberate cosmetic choice. */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }

h1, h2, h3, h4 { font-weight: 700; margin: 0; }

/* ---- Buttons ---- */
.btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity .12s ease;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.field input, .field select, .field textarea {
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--accent-soft);
    border-color: var(--accent);
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---- Stat cards (dashboard) ---- */
.stat-card { display: flex; flex-direction: column; gap: var(--space-2); }
.stat-card .stat-label { font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.progress-track {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--border);
    overflow: hidden;
}
.progress-fill { display: block; height: 100%; border-radius: var(--radius-pill); }
.progress-fill.warn { background: var(--warn); }
.progress-fill.success { background: var(--success); }
.progress-fill.accent { background: var(--accent); }

/* ---- Responsive grid rows (Dashboard's stat/revenue/activity rows, Orders'
   table-count stat row) — collapses column count by breakpoint instead of the
   unconditional repeat(N, 1fr) each page used to hardcode inline. ---- */
.grid-stats-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-2-wide { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-5); }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
/* Breakpoint overrides for these three live in the "Responsive breakpoints"
   section near the end of this file, not here — mobile's 1-column override has
   to come after tablet's 2-column one in source order, since both @media blocks
   match on a phone and the later one wins the cascade (same selector, same
   specificity). Keeping them split like this once bit this class: tablet's rule
   silently overrode mobile's because it appeared later in the file. */

/* ---- Badges ---- */
.badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.badge-open, .badge-pending { background: var(--warn-soft); color: #8A6116; }
.badge-closed, .badge-completed, .badge-ready { background: var(--success-soft); color: #0F7A34; }
.badge-preparing { background: var(--accent-soft); color: var(--accent-dark); }

/* ---- Kitchen display ticket cards ---- */
.ticket-card { border-left: 4px solid transparent; }
.ticket-aging-warn { border-left-color: var(--warn); }
.ticket-aging-danger { border-left-color: var(--danger); }
.ticket-line {
    display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2);
    padding: var(--space-2) 0;
}
.ticket-line + .ticket-line { border-top: 1px solid var(--border); }

/* ---- List rows (recent activity / top dishes) ---- */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

/* ---- App shell ----
   Fixed to the viewport height rather than growing with page content — the sidebar
   used to be a plain flex child that stretched to match a tall .main-content (e.g.
   a 75-item menu list), which pushed .sidebar-profile's "margin-top: auto" thousands
   of pixels down the page instead of staying pinned to the visible viewport. Now only
   .main-content scrolls; the sidebar and topbar stay fixed in place. */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: width .18s ease, padding .18s ease, opacity .18s ease;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar.collapsed {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: none;
    opacity: 0;
}
.sidebar-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--ink-muted);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--ink); }
.sidebar-toggle svg { width: 18px; height: 18px; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: var(--space-6); }
.sidebar-logo-mark {
    width: 32px; height: 32px; border-radius: var(--radius-md);
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.nav-section-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink-faint); margin: var(--space-4) 0 var(--space-2);
}
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius-md);
    color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
    margin-bottom: 2px;
}
.nav-link:hover { background: var(--bg); }
.nav-link.active { background: var(--accent); color: #fff; }
.sidebar-profile {
    margin-top: auto;
    display: flex; align-items: center; gap: 10px;
    padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg);
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-dark);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-5) var(--space-6) 0;
    flex-shrink: 0;
    position: relative;
}
/* Hangs off the topbar's bottom edge into .main-content's scroll area (positioned
   elements paint after normal-flow ones, so this sits above scrolled cards without
   needing an explicit stacking hack) — softens the hard visual cut where content
   used to scroll flush up against the fixed topbar. Never intercepts clicks. */
.topbar-fade {
    position: absolute;
    left: 0; right: 0;
    bottom: -28px;
    height: 28px;
    background: linear-gradient(var(--bg), transparent);
    pointer-events: none;
}
.main-content {
    flex: 1;
    min-width: 0;
    padding: var(--space-6);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.main-content::-webkit-scrollbar { display: none; }

/* Dims the page behind the sidebar when it's open on a narrow screen — see the
   mobile override below, which turns .sidebar from a flex column into a fixed
   overlay. Invisible (display:none) outside that breakpoint, so it's harmless to
   always render regardless of _sidebarCollapsed's state on desktop/tablet. */
.sidebar-backdrop { display: none; }

/* ============================================================
   Responsive breakpoints — this file has none below this point
   otherwise. Convention: mobile <=640px, tablet 641-1024px,
   desktop >1024px (the implicit default above, unchanged).
   ============================================================ */
@media (max-width: 1024px) {
    /* Tablet keeps the sidebar's desktop squeeze-collapse behavior (there's enough
       width for content to reflow around it) — only the grid/table rules below get
       a tablet-specific column count. */
    .grid-stats-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .topbar { padding: var(--space-4) var(--space-4) 0; }
    .main-content { padding: var(--space-4); }
    .grid-stats-3, .grid-2-wide, .grid-2-even { grid-template-columns: 1fr; }

    /* The sidebar becomes a slide-in overlay drawer (same pattern as the Mobile
       app's .mobile-nav-drawer) instead of squeezing .main-content-wrap — a fixed
       232px column has no room to share with content on a phone screen. */
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 1000;
        width: 260px;
        max-width: 80vw;
        box-shadow: var(--shadow-md);
        transform: translateX(0);
        transition: transform .2s ease;
        opacity: 1;
    }
    .sidebar.collapsed {
        /* Overrides the desktop squeeze (width:0 etc.) with an off-screen slide —
           still takes its full 260px in layout terms, just translated out of view,
           so the transform transition has something to animate. */
        width: 260px;
        max-width: 80vw;
        padding: var(--space-5);
        border-right: 1px solid var(--border);
        opacity: 1;
        transform: translateX(-100%);
    }
    .sidebar-backdrop {
        display: block;
        position: fixed; inset: 0;
        background: rgba(28, 35, 46, 0.45);
        z-index: 999;
    }
}

/* ---- Neutral tag (non-semantic label, e.g. "Seafood" on a menu card) ---- */
.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink-muted);
}

/* ---- Category filter dropdown ---- */
.filter-select {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    min-width: 200px;
}
.filter-select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ---- Not-available/Inactive filter pills (stayed separate pill buttons, unlike the category dropdown) ---- */
.pill-tab {
    font-size: 13px; font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}
.pill-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Manage categories / add-ons windows: list rows with an inline delete icon ---- */
.manage-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); max-height: 240px; overflow-y: auto; }
.manage-row {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
@media (max-width: 640px) {
    /* Rows like Tables.razor's (name + seats + sort-order + section picker +
       toggle + delete, all fixed-width) would otherwise overflow a phone's width —
       this lets them wrap onto a second line instead of clipping or scrolling. */
    .manage-row { flex-wrap: wrap; }
}
.sort-order-input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    text-align: center;
}

/* ---- Gallery/Detailed view toggle on the Menu page ---- */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; flex-shrink: 0; }
.view-toggle button {
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--ink-muted);
}
.view-toggle button svg { width: 16px; height: 16px; }
.view-toggle button.active { background: var(--accent); color: #fff; }

/* ---- Detailed (table) view of the menu item list ---- */
.item-table { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.item-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.item-table tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.item-table tbody tr:last-child td { border-bottom: none; }
.item-table tbody tr:hover { background: var(--bg); }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--ink-faint);
    padding: 6px;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* ---- "Table freed, seat the waitlist" toast stack (TableFreedNotifications.razor) ---- */
.table-freed-stack {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    width: 320px;
    max-width: calc(100vw - var(--space-5) * 2);
}
.table-freed-toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
}
@media (max-width: 640px) {
    .table-freed-stack { left: var(--space-4); right: var(--space-4); width: auto; bottom: var(--space-4); }
}

/* ---- Search box ---- */
.search-box {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    min-width: 260px;
}
.search-box input { border: none; outline: none; font-family: inherit; font-size: 14px; flex: 1; background: transparent; }
@media (max-width: 640px) {
    /* min-width: 260px/200px (search-box/filter-select) plus a gap easily exceeds a
       375px phone's available width — these two sit in a flex-wrap row together on
       Orders/Menu, so letting each go full-width lets them stack cleanly instead of
       both trying to keep their desktop floor and overflowing. */
    .search-box, .filter-select { min-width: 0; width: 100%; max-width: none; }
}

/* ---- Toggle switch (e.g. "Available today") ---- */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; background: var(--border); border-radius: var(--radius-pill);
    cursor: pointer; transition: background .15s ease;
}
.switch .slider::before {
    content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px;
    background: #fff; border-radius: 50%; transition: transform .15s ease; box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(28, 35, 46, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-card {
    background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    padding: var(--space-5); width: 380px; max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-muted); }

/* ---- Orders page: table tiles ---- */
.table-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    width: 100%;
}
.table-tile:hover { border-color: var(--accent); }
.table-tile.occupied { border-left-color: var(--accent); }
.table-tile-number { font-size: 15px; font-weight: 700; }
.table-tile-meta { font-size: 12px; color: var(--ink-muted); }
.table-tile-icon { width: 100%; height: 44px; margin: 4px 0; fill: var(--border); stroke: none; }
.table-tile-icon-top { fill: var(--bg); stroke: var(--border); stroke-width: 2; }
.table-tile.occupied .table-tile-icon { fill: var(--accent); }
.table-tile.occupied .table-tile-icon-top { fill: var(--accent-soft); stroke: var(--accent); }
.table-tile-dishes {
    font-size: 12px;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Orders page: compact gallery grid — many tables at a glance, trading
   the detailed grid's dish preview/price for density. Vacant = lightest green,
   occupied = lightest red (same tokens the badges already use), filling the
   whole tile instead of a small pill, so status reads at a glance. ---- */
.table-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-3);
}
.table-tile-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--space-3) var(--space-2);
    aspect-ratio: 1;
    background: var(--success-soft);
    border: 1px solid var(--success);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .2s ease, transform .15s ease;
}
.table-tile-compact:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.table-tile-compact:active { transform: scale(.94); }
.table-tile-compact.occupied { border-color: var(--accent); background: var(--accent-soft); }
.table-tile-compact-number { font-size: 17px; font-weight: 800; color: #0F7A34; }
.table-tile-compact-meta { font-size: 11px; font-weight: 600; color: #0F7A34; }
.table-tile-compact.occupied .table-tile-compact-number,
.table-tile-compact.occupied .table-tile-compact-meta { color: var(--accent-dark); }

/* ---- Order-taking modal (Orders page POS): wider than the default modal, split
   into an item picker and a cart/checkout panel ---- */
.modal-card.pos-modal {
    width: 1280px;
    max-width: calc(100vw - 32px);
    height: calc(100vh - 32px);
    padding: 0;
    display: flex;
    flex-direction: column;
}
/* The top of the dialog is kept to as few lines as it can: title, who served, merge / move and the table's order tabs share one
   wrapping row; the search and the category pills are tight too - every pixel saved is menu list. */
.pos-header { padding: var(--space-3) var(--space-5) 0; margin-bottom: var(--space-2); align-items: flex-start; }
.pos-header > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; min-width: 0; }
.pos-header h3 { margin: 0; }
.pos-header p, .pos-header .link-btn { margin: 0 !important; }
.pos-header-tabs { min-width: 0; }
.pos-header-tabs > div > div { margin-bottom: 0 !important; }
.pos-header-tabs:empty { display: none; }
.pos-modal .pill-tab { padding: 5px 12px; font-size: 12px; }
@media (max-height: 800px) {
    .modal-card.pos-modal { height: calc(100vh - 16px); max-height: calc(100vh - 16px); }
}
.pos-modal-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.pos-picker { flex: 1.4; min-width: 0; padding: var(--space-3) var(--space-5) var(--space-4); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
/* Search/veg-filter/category/subcategory rows never scroll away — only the item
   rows below them do, with the table's own header pinned to the top of that
   scroll area (position: sticky) so column labels stay visible too. */
.pos-picker-filters { flex-shrink: 0; }
/* position: sticky on a <th> is unreliable across browsers once the table sits
   inside a flex/overflow layout like this modal — a plain header bar that lives
   outside the scrollable area sidesteps that entirely and is guaranteed to stay put. */
.pos-item-table-header {
    display: flex;
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--border);
}
.pos-item-table-header span:nth-child(1) { flex: 1; }
.pos-item-table-header span:nth-child(2), .pos-col-price { width: 90px; }
.pos-item-table-header span:nth-child(3), .pos-col-qty { width: 130px; }
.pos-picker-scroll { flex: 1; min-height: 120px; overflow-y: auto; }
.pos-item-table { table-layout: fixed; }
/* The cart panel scrolls as a whole when the dialog is short (a laptop, a takeaway's customer fields...) instead of squeezing the
   item list to nothing: the list keeps a minimum height, and the totals + buttons stay stuck to the bottom of the panel. */
.pos-cart { flex: 1; min-width: 340px; padding: var(--space-5); overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
@media (max-width: 900px) {
    /* The two-pane split (item picker | cart) needs each pane at least ~340-400px
       to be usable — there's no room for that side by side under ~900px (covers
       phones and most tablets in portrait), so it stacks into one scrolling column
       instead: picker on top, cart below, each still independently scrollable via
       their own .pos-picker-scroll/.pos-cart-scroll. */
    /* Each pane needs a bounded flex-basis (not "auto") plus min-height: 0 — without
       both, a flex item inside a column whose own height comes from flex:1 (not a
       fixed value) collapses to its content's natural min-height instead of actually
       filling its share, and .pos-cart's own overflow:hidden then clips everything
       past "Cart details" that didn't fit. Keeping .pos-modal-body itself NOT
       scrollable (its inherited overflow:hidden) is what makes each pane's own
       .pos-picker-scroll/.pos-cart-scroll the thing that scrolls, same as desktop. */
    /* UPDATE: squeezing both panes into one screen left the menu list about two rows high. Now the whole body scrolls: the
       menu list gets most of the screen first, the cart (and its totals / buttons) follows when you scroll down, and the cart's
       totals + buttons stay stuck to the bottom edge while any of the cart is on screen. */
    .pos-modal-body { flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
    .pos-picker { flex: 0 0 auto; height: 68%; min-height: 300px; min-width: 0; border-right: none; border-bottom: 1px solid var(--border); }
    .pos-cart { flex: 0 0 auto; min-height: 0; min-width: 0; overflow: visible; }
    /* Here the cart is as tall as its lines (the body scrolls), and the totals + buttons are one slim bar stuck to the bottom edge:
       only the total is shown (the full breakdown is in the Generate bill popup), so the bar covers little. */
    .pos-modal .pos-cart-scroll { flex: 0 0 auto; min-height: 0; overflow: visible; }
    .pos-modal .pos-cart-footer { position: sticky; bottom: 0; background: var(--surface); z-index: 1; padding: var(--space-3) 0 var(--space-3); margin-top: var(--space-2); }
    .pos-modal .pos-cart-footer .pos-summary-card { padding: 4px var(--space-3); margin-bottom: var(--space-2); }
    .pos-modal .pos-cart-footer .pos-summary-row:not(.total) { display: none; }
    .pos-modal .pos-cart-footer .pos-summary-row.total { margin-top: 0; padding: 4px 0; border-top: none; }
    .pos-col-price { width: 70px; }
    .pos-col-qty { width: 100px; }
    .pos-item-table-header span:nth-child(2) { width: 70px; }
    .pos-item-table-header span:nth-child(3) { width: 100px; }
}
.pos-cart-scroll { flex: 1 1 auto; min-height: 120px; overflow-y: auto; margin: var(--space-3) 0; }
.pos-cart-footer { flex-shrink: 0; border-top: 1px solid var(--border); padding-top: var(--space-4); }
.pos-cart-section-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-muted); margin: var(--space-3) 0 var(--space-2); }
.pos-cart-section-label:first-child { margin-top: 0; }
.pos-cart-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pos-cart-item:last-child { border-bottom: none; }
.pos-cart-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pos-cart-item-name { font-size: 13px; font-weight: 700; }
.pos-cart-item-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 12px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.pos-summary-card { background: var(--bg); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.pos-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.pos-summary-row.total { font-weight: 800; font-size: 15px; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border); }
.pos-checkout-fields { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); }
.pos-checkout-row { display: flex; gap: var(--space-3); }
.pos-checkout-row > .field { min-width: 0; }
.pos-checkout-row input, .pos-checkout-row select { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 480px) {
    .pos-checkout-row { flex-wrap: wrap; }
}
.payment-method-row { display: flex; gap: var(--space-2); }
.payment-method-tile {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: var(--space-3) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
}
.payment-method-tile svg { width: 20px; height: 20px; }
.payment-method-tile.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

/* ---- Printable bill: hidden on screen, the only thing visible when printing ---- */
.printable-bill { display: none; }
@media print {
    body * { visibility: hidden; }
    .printable-bill, .printable-bill * { visibility: visible; }
    .printable-bill {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 24px;
        font-family: 'Courier New', monospace;
        font-size: 13px;
        color: #000;
    }
    .printable-bill hr { border: none; border-top: 1px dashed #000; margin: 10px 0; }
    .printable-bill table th, .printable-bill table td { padding: 3px 0; }
}

/* ---- Printed menu card (Menu -> Print menu): a preview on screen, the only thing on paper ---- */
.printable-menu {
    background: #fff;
    color: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    padding: 32px 36px;
    max-width: 960px;
    font-family: 'Inter', 'Noto Sans Gujarati', 'Noto Sans Devanagari', sans-serif;
}
.menu-card-head { text-align: center; margin-bottom: 28px; }
.menu-card-head h2 { font-size: 30px; margin: 0; letter-spacing: 0.5px; }
.menu-card-address { font-size: 13px; color: #555; margin-top: 4px; }
.menu-card-title {
    display: inline-block; margin-top: 12px; padding: 2px 18px; font-size: 15px; font-weight: 700;
    letter-spacing: 3px; text-transform: uppercase; border-top: 2px solid #1a1a1a; border-bottom: 2px solid #1a1a1a;
}
.menu-card-columns { column-count: 2; column-gap: 44px; }
.menu-card-category { margin-bottom: 18px; }
.menu-card-category h3 {
    font-size: 19px; margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1.5px solid #1a1a1a;
    break-after: avoid; break-inside: avoid;
}
.menu-card-category h4 { font-size: 14px; margin: 10px 0 4px; color: #444; break-after: avoid; }
.menu-card-item { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; font-size: 14px; break-inside: avoid; }
.menu-card-name { min-width: 0; }
.menu-card-leader { flex: 1; border-bottom: 1px dotted #999; min-width: 12px; transform: translateY(-3px); }
.menu-card-price { font-weight: 600; white-space: nowrap; }
.menu-card-veg { flex: none; width: 9px; height: 9px; border: 1px solid; display: inline-flex; align-items: center; justify-content: center; transform: translateY(-1px); }
.menu-card-veg::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.menu-card-veg.veg { color: #1b8a3a; }
.menu-card-veg.non-veg { color: #b3261e; }
@media (max-width: 720px) {
    .printable-menu { padding: 20px 16px; }
    .menu-card-columns { column-count: 1; }
}
@media print {
    .printable-menu, .printable-menu * { visibility: visible; }
    .printable-menu {
        position: absolute; top: 0; left: 0; width: 100%; max-width: none;
        border: none; border-radius: 0; padding: 0;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .menu-card-columns { column-count: 2; }
}
.print-row { display: flex; justify-content: space-between; padding: 2px 0; }
.print-row.total { font-weight: 800; border-top: 1px dashed #000; margin-top: 6px; padding-top: 6px; }
/* Wraps onto multiple lines rather than scrolling sideways — every category/
   subcategory is visible and tappable at once, no hidden ones to hunt for. */
/* The category pills (and the narrower ones under them) stay on ONE line and scroll sideways: a restaurant with many categories
   would otherwise push the menu list off the dialog. */
.pos-category-row { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: var(--space-2); overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain; scrollbar-width: thin; padding-bottom: 4px; }
.pos-category-row .pill-tab { flex-shrink: 0; white-space: nowrap; }
.pos-category-row::-webkit-scrollbar { height: 6px; }
.pos-category-row::-webkit-scrollbar-thumb { background: #CDD2DA; border-radius: var(--radius-pill); }
.pill-tab-sub { padding: 5px 12px; font-size: 12px; background: var(--bg); }
.pill-tab-sub.active { background: var(--accent); color: #fff; }
.pos-qty-stepper { display: flex; align-items: center; gap: 10px; }
.pos-qty-stepper button {
    width: 26px; height: 26px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.pos-qty-stepper button:disabled { opacity: .4; cursor: not-allowed; }
.pos-qty-stepper span { font-weight: 700; min-width: 16px; text-align: center; }
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

    /* the start-up text, before the app can translate anything: the saved language is on <html lang> (see index.html) */
    html[lang="hi"] .loading-progress-text:after { content: var(--blazor-load-percentage-text, "लोड हो रहा है"); }
    html[lang="gu"] .loading-progress-text:after { content: var(--blazor-load-percentage-text, "લોડ થઈ રહ્યું છે"); }

/* ---- Language picker (Settings) ---- */
.language-picker {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--ink);
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* Settings hub: each card is a link to a configuration page. */
.settings-card { display: block; text-decoration: none; color: inherit; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.settings-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.settings-card-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.settings-card-text { font-size: 13px; color: var(--ink-muted); line-height: 1.45; }

/* Round "?" help button next to a page title, and the long-form text inside a help dialog. */
.help-btn {
    width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface);
    color: var(--ink-muted); font-weight: 700; font-size: 14px; line-height: 1; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.help-btn:hover, .help-btn:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); outline: none; }
.help-body { font-size: 14px; line-height: 1.55; color: var(--ink); }
.help-body p { margin: 0 0 var(--space-3); }
.help-body h4 { margin: var(--space-4) 0 var(--space-2); font-size: 14px; }
.help-body ol, .help-body ul { margin: 0 0 var(--space-3); padding-left: 20px; }
.help-body li { margin-bottom: 6px; }
.help-body code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; word-break: break-all; }
/* A dialog whose text can be long: the card itself never scrolls (so its rounded corners stay intact on all four
   sides); only the text area scrolls, with its slim rounded scrollbar sitting inside the card's padding. */
.modal-card.help-modal { display: flex; flex-direction: column; overflow: hidden; }
.modal-card.help-modal .modal-header { flex-shrink: 0; }
.modal-card.help-modal .help-body { flex: 1 1 auto; min-height: 0; margin-right: calc(-1 * var(--space-3)); padding-right: var(--space-3); }
.modal-card.help-modal > .btn { flex-shrink: 0; }

/* Slim, rounded scrollbar (the page itself hides its scrollbars; this is for an inner scroll area that needs one). */
.soft-scroll { overflow-y: auto; overscroll-behavior: contain; }
.soft-scroll::-webkit-scrollbar { width: 10px; }
.soft-scroll::-webkit-scrollbar-track { background: transparent; border-radius: var(--radius-pill); }
.soft-scroll::-webkit-scrollbar-thumb { background: #CDD2DA; border-radius: var(--radius-pill); border: 2px solid transparent; background-clip: padding-box; }
.soft-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); background-clip: padding-box; }
@supports not selector(::-webkit-scrollbar) { .soft-scroll { scrollbar-width: thin; scrollbar-color: #CDD2DA transparent; } }

.help-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: var(--space-3); }
.help-table th { text-align: left; color: var(--ink-muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.help-table td { vertical-align: top; padding: 8px; border-bottom: 1px solid var(--border); }

/* A small pulsing dot beside "waiting for..." text. */
.spinner-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; animation: spinner-dot-pulse 1.1s ease-in-out infinite; }
@keyframes spinner-dot-pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .spinner-dot { animation: none; } }


/* The loading screen (PageLoader.razor): the Zaika mark breathing above three dots, instead of the words "Loading…". */
.page-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 45vh; padding: var(--space-5) 0; color: var(--ink-muted); }
.page-loader.compact { min-height: 0; padding: var(--space-4) 0; gap: 10px; }
.page-loader-badge { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(193, 17, 0, 0.18); animation: page-loader-breathe 1.6s ease-in-out infinite; }
.page-loader-badge img { width: 66px; height: 66px; object-fit: contain; }
.page-loader.compact .page-loader-badge { width: 52px; height: 52px; box-shadow: 0 4px 14px rgba(193, 17, 0, 0.18); }
.page-loader.compact .page-loader-badge img { width: 40px; height: 40px; }
.page-loader-dots { display: flex; gap: 7px; }
.page-loader-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: page-loader-dot 1.2s infinite ease-in-out both; }
.page-loader.compact .page-loader-dots span { width: 6px; height: 6px; }
.page-loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.page-loader-dots span:nth-child(3) { animation-delay: 0.3s; }
.page-loader-text { margin: 0; font-size: 13px; }
@keyframes page-loader-breathe { 0%, 100% { transform: scale(0.94); } 50% { transform: scale(1.04); } }
@keyframes page-loader-dot { 0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .page-loader-badge, .page-loader-dots span { animation: none; } }
