:root {
    --bg: #f5f2ec;
    --surface: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #b45309;
    --danger: #b91c1c;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.auth-page, .customer-page {
    min-height: 100vh;
}
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card, .panel, .stat-card, .order-card, .qr-card, .success-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(31, 41, 51, 0.06);
}
.login-card {
    width: min(420px, 100%);
    padding: 28px;
}
.form-stack { display: grid; gap: 16px; }
.auth-link {
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}
label { display: grid; gap: 8px; font-weight: 700; }
input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
    font-weight: 400;
}
input::placeholder {
    color: #9ca3af !important;
    font-weight: 300 !important;
    opacity: 1;
}
select[multiple] {
    min-height: 96px;
}
.field-hint {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}
.menu-thumb {
    width: 76px;
    height: 58px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f8fafc;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
}
.btn {
    border: 0;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}
.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: #fff; background: var(--danger); margin-top: 16px; }
.btn-danger-soft { color: var(--danger); background: #fee2e2; }
.btn-ghost { background: #eef2f7; color: var(--text); width: 100%; }
.btn-small { min-height: 36px; padding: 8px 12px; background: #eef2f7; }
.btn-wide { width: 100%; }
.muted { color: var(--muted); }
.alert {
    margin: 14px 0;
    padding: 12px;
    border-radius: 8px;
    color: #7f1d1d;
    background: #fee2e2;
}
.alert-success {
    color: #14532d;
    background: #dcfce7;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
}
.sidebar-hidden .app-shell {
    grid-template-columns: 0 1fr;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #17312f;
    color: #fff;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.2s ease, padding 0.2s ease;
}
.sidebar-hidden .sidebar {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    border: 0;
    visibility: hidden;
}
.sidebar-hidden .sidebar * { display: none; }
.brand {
    position: sticky;
    top: 0;
    z-index: 25;
    margin: -22px -22px 0;
    padding: 22px 22px 14px;
    background: #17312f;
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 12px 18px rgba(23, 49, 47, 0.92);
}
.sidebar nav { display: grid; gap: 8px; }
.sidebar a {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
}
.nav-group {
    display: grid;
    gap: 8px;
}
.nav-group-toggle {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    min-height: 42px;
    padding: 10px 12px;
    text-align: left;
    text-transform: uppercase;
}
.nav-group-toggle:hover {
    background: rgba(255,255,255,0.16);
}
.nav-group-icon {
    font-size: 14px;
    line-height: 1;
}
.nav-group:not(.open) .nav-submenu {
    display: none;
}
.nav-submenu {
    display: grid;
    gap: 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.16);
}
.nav-submenu a {
    padding: 10px 12px;
}
.sidebar a.active {
    background: #f8fafc;
    color: #17312f;
    font-weight: 800;
}
.sidebar a:hover {
    background: rgba(255,255,255,0.16);
}
.sidebar a.active:hover {
    background: #f8fafc;
}
.logout-button {
    width: 100%;
    border: 1px solid rgba(248, 113, 113, 0.55);
    background: rgba(127, 29, 29, 0.16);
    color: #fecaca;
}
.logout-button:hover {
    background: rgba(127, 29, 29, 0.28);
    color: #fff;
}
.content { padding: 24px; min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: -24px -24px 20px;
    padding: 16px 24px;
    background: rgba(245, 242, 236, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.topbar h1 { margin: 4px 0 0; }
.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.sidebar-toggle {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    cursor: pointer;
    font-weight: 800;
    display: inline-grid;
    place-items: center;
    flex: 0 0 40px;
    font-size: 22px;
    line-height: 1;
}
.sidebar-toggle:hover {
    border-color: var(--primary);
}
.user-pill {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
}
.stats-grid, .order-grid, .qr-grid {
    display: grid;
    gap: 16px;
}
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.stat-card { padding: 18px; }
.stat-card span { display: block; color: var(--muted); }
.stat-card strong { font-size: 30px; }
.dashboard-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
.dashboard-stats .stat-card {
    min-height: 126px;
}
.dashboard-stats .stat-card strong {
    font-size: 24px;
    overflow-wrap: anywhere;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
}
.report-grid {
    align-items: start;
    margin-bottom: 16px;
}
.report-table {
    max-height: 62vh;
}
.dashboard-table {
    max-height: 420px;
}
.top-item-list {
    display: grid;
    gap: 10px;
}
.top-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.top-item-row div {
    display: grid;
    gap: 4px;
}
.top-item-row span {
    color: var(--muted);
    font-size: 13px;
}
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.panel { padding: 18px; margin-bottom: 16px; }
.panel[id] {
    scroll-margin-top: 150px;
}
.section-tabs {
    position: sticky;
    top: 82px;
    z-index: 20;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: -4px 0 14px;
    padding: 4px 0 8px;
    background: rgba(245, 242, 236, 0.96);
}
.section-tabs a {
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 800;
}
.section-tabs a:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.table-wrap { overflow-x: auto; }
.table-freeze {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.table-freeze thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
    box-shadow: 0 1px 0 var(--line);
}
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 700;
}
.badge-new { background: #fee2e2; color: #991b1b; }
.badge-processing { background: #fef3c7; color: #92400e; }
.badge-ready { background: #dcfce7; color: #166534; }
.badge-served { background: #e0e7ff; color: #3730a3; }
.badge-cancelled { background: #e5e7eb; color: #374151; }
.stat-card small {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}
.empty { color: var(--muted); text-align: center; padding: 24px; }
.order-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.order-card { padding: 16px; display: grid; gap: 14px; }
.order-head { display: flex; justify-content: space-between; gap: 10px; }
.order-head span { display: block; color: var(--muted); margin-top: 4px; }
.order-total { font-size: 24px; font-weight: 800; }
.order-items {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}
.order-item-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.order-items small {
    color: var(--muted);
    margin-top: -4px;
}
.kitchen-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.kitchen-column {
    display: grid;
    gap: 12px;
    min-width: 0;
}
.kitchen-column-head {
    position: sticky;
    top: 82px;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(245, 242, 236, 0.96);
}
.kitchen-column-head h2 {
    margin: 0;
    font-size: 18px;
}
.kitchen-card {
    box-shadow: 0 8px 18px rgba(31, 41, 51, 0.05);
}
.kitchen-items {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}
.kitchen-items div {
    display: grid;
    gap: 4px;
}
.kitchen-items span {
    color: var(--muted);
    font-size: 13px;
}
.kitchen-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.serving-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.serving-card {
    border-left: 6px solid var(--primary);
}
.serving-table {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.serving-table span {
    color: var(--muted);
    font-weight: 800;
}
.serving-table strong {
    font-size: 42px;
    line-height: 1;
}
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; min-width: 180px; }
.filter-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin: 16px 0;
}
.filter-bar .btn {
    min-height: 44px;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-sent { background: #dcfce7; color: #166534; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.payment-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}
.payment-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.payment-summary .stat-card strong {
    font-size: 24px;
}
.payment-total-box {
    display: grid;
    gap: 6px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}
.payment-total-box span {
    color: var(--muted);
    font-size: 12px;
}
.payment-total-box strong {
    font-size: 18px;
}
.quick-cash {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
}
.text-danger {
    color: var(--danger);
}
.bill-scan-form input {
    flex: 1 1 280px;
}
.scanner-box {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}
.scanner-box video {
    width: min(420px, 100%);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    background: #111827;
}
.scanner-box p {
    margin: 0;
    color: var(--muted);
}
.receipt {
    width: min(420px, 100%);
    background: #fff;
    border: 1px dashed #9ca3af;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 18px;
}
.receipt-head {
    display: grid;
    gap: 4px;
    text-align: center;
    border-bottom: 1px dashed #9ca3af;
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.receipt-head strong {
    font-size: 20px;
}
.receipt-head span,
.receipt-note {
    color: var(--muted);
}
.receipt-lines {
    display: grid;
    gap: 10px;
}
.receipt-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.receipt-line div {
    display: grid;
    gap: 3px;
}
.receipt-line span {
    color: var(--muted);
    font-size: 13px;
}
.receipt-total {
    display: flex;
    justify-content: space-between;
    border-top: 1px dashed #9ca3af;
    margin-top: 12px;
    padding-top: 12px;
    font-size: 18px;
}
.receipt-payment {
    display: grid;
    gap: 8px;
    border-top: 1px dashed #9ca3af;
    margin-top: 12px;
    padding-top: 12px;
}
.receipt-payment div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.receipt-payment span {
    color: var(--muted);
}
.receipt-note {
    text-align: center;
    margin: 16px 0 0;
}
.receipt-preview-body {
    display: grid;
    justify-items: center;
    padding: 18px;
    background: #f8fafc;
}
.receipt-preview-body .receipt {
    margin: 0;
}
.receipt-preview-actions {
    padding: 0 18px 18px;
}
.master-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}
.master-form.wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.checkline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.checkline input {
    width: auto;
}
.checkgroup {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}
.checkgroup legend {
    padding: 0 6px;
    font-weight: 800;
}
.checkgroup label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.checkgroup input {
    width: auto;
}
.checkgroup.compact {
    min-width: 170px;
    border: 0;
    padding: 0;
    background: transparent;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
body.modal-open {
    overflow: hidden;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.48);
}
.modal-backdrop[hidden] {
    display: none;
}
.modal-dialog {
    width: min(560px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
}
.modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.modal-head h2 {
    margin: 0;
}
.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2f7;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}
.modal-form {
    display: grid;
    gap: 14px;
    padding: 18px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.qr-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.qr-card { padding: 18px; text-align: center; }
.qr-card img { width: 180px; height: 180px; }
.qr-card p { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.qr-bill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    max-height: 70vh;
    overflow: auto;
    padding: 2px;
}
.qr-bill-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 248px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.qr-bill-card[hidden] {
    display: none;
}
.qr-bill-card-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 8px;
    width: 100%;
}
.qr-bill-card-head div {
    display: grid;
    gap: 3px;
    min-width: 0;
}
.qr-bill-card-head strong,
.qr-bill-card-head span {
    overflow-wrap: anywhere;
}
.qr-bill-card-head div > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.qr-bill-card-img,
.qr-bill-card-invalid {
    width: 116px;
    height: 116px;
    border-radius: 8px;
}
.qr-bill-card-img {
    object-fit: contain;
    background: #fff;
}
.qr-bill-card-invalid {
    display: grid;
    place-items: center;
    border: 1px dashed #9ca3af;
    color: var(--muted);
    background: #f3f4f6;
    font-weight: 800;
}
.qr-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
}
.qr-card-actions form {
    margin: 0;
}
.info-dot {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    font-weight: 900;
}
.info-dot:hover {
    border-color: var(--primary);
    background: #ecfdf5;
}
.qr-table-wrap {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.qr-table {
    min-width: 980px;
}
.qr-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
    box-shadow: 0 1px 0 var(--line);
}
.qr-table tbody tr[hidden] {
    display: none;
}
.qr-table-img,
.qr-table-invalid {
    width: 92px;
    height: 92px;
    border-radius: 8px;
}
.qr-table-img {
    object-fit: contain;
    background: #fff;
}
.qr-table-invalid {
    display: grid;
    place-items: center;
    border: 1px dashed #9ca3af;
    color: var(--muted);
    background: #f3f4f6;
    font-weight: 800;
}
.qr-card-closed {
    opacity: 0.68;
}
.qr-invalid-box {
    width: 180px;
    height: 180px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px dashed #9ca3af;
    color: var(--muted);
    background: #f3f4f6;
    font-weight: 800;
}
.qr-print-sheet {
    display: none;
}
.qr-print-preview {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 10px 0;
    text-align: center;
}
.qr-print-preview strong {
    color: var(--text);
    font-size: 26px;
}
.qr-print-preview span {
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
}
.qr-print-preview img {
    width: 220px;
    height: 220px;
    object-fit: contain;
    background: #fff;
}
.qr-print-preview small {
    max-width: 280px;
    overflow-wrap: anywhere;
    color: var(--muted);
}

.mobile-shell {
    width: min(480px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    background: #fffaf2;
    padding: 18px;
}
.mobile-shell:has(.cart-bar) {
    padding-bottom: 260px;
}
.customer-hero {
    padding: 24px 0;
}
.customer-hero span, .menu-header span {
    color: var(--accent);
    font-weight: 800;
}
.customer-hero h1, .menu-header h1 {
    margin: 6px 0;
    font-size: 32px;
}
.session-note {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.running-bill {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #eadfce;
    border-radius: 8px;
    background: #fff;
}
.running-bill-head,
.running-bill-lines div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.running-bill-head span,
.running-bill-head small,
.running-bill-lines span {
    color: var(--muted);
    font-size: 13px;
}
.running-bill-head strong {
    display: block;
    margin-top: 3px;
    font-size: 20px;
}
.running-bill-lines {
    display: grid;
    gap: 8px;
    max-height: 128px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}
.running-bill-lines strong {
    white-space: nowrap;
}
.bottom-form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}
.menu-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fffaf2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 12px;
}
.menu-header-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
    flex: 0 0 auto;
}
.language-switch {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.language-switch button {
    min-width: 36px;
    min-height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}
.language-switch button.active {
    background: var(--primary);
    color: #fff;
}
.cart-button, .qty-add {
    border: 0;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    font-weight: 800;
}
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    position: sticky;
    top: 74px;
    background: #fffaf2;
    z-index: 9;
}
.category-tabs button {
    white-space: nowrap;
    border: 0;
    background: #f3e8d0;
    border-radius: 999px;
    padding: 9px 13px;
    font-weight: 700;
    cursor: pointer;
}
.category-tabs button.active {
    background: var(--primary);
    color: #fff;
}
.menu-section { padding-bottom: 18px; }
.menu-section h2 { font-size: 18px; }
.menu-item {
    display: grid;
    grid-template-columns: 86px 1fr 48px;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eadfce;
}
.menu-photo {
    width: 86px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3e8d0;
}
.menu-photo-empty {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
}
.menu-item p {
    margin: 5px 0;
    color: var(--muted);
    font-size: 14px;
}
.menu-item span { font-weight: 800; color: var(--accent); }
.cart-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 40;
    width: min(480px, 100%);
    margin: 0;
    padding: 14px 18px 18px;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 30px rgba(31, 41, 51, 0.08);
    transform: translateX(-50%);
    display: grid;
    gap: 10px;
}
.cart-lines {
    display: grid;
    gap: 8px;
    max-height: 168px;
    overflow-y: auto;
}
.cart-empty {
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 6px 0;
}
.cart-line {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
}
.cart-line div:first-child {
    display: grid;
    gap: 3px;
}
.cart-line span {
    color: var(--muted);
    font-size: 13px;
}
.cart-controls {
    display: grid;
    grid-template-columns: 32px 28px 32px;
    align-items: center;
    text-align: center;
}
.cart-controls button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f3e8d0;
    color: var(--text);
    font-weight: 900;
}
.cart-controls span {
    color: var(--text);
    font-weight: 800;
}
.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-bar .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.staff-cart-panel {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.staff-category-tabs {
    margin-top: 16px;
}
.success-card {
    margin-top: 80px;
    padding: 28px;
    text-align: center;
}
.success-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}
.success-order {
    display: grid;
    gap: 10px;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    text-align: left;
}
.success-order div {
    display: grid;
    gap: 4px;
}
.success-order span {
    color: var(--muted);
    font-size: 13px;
}
.success-order strong {
    color: var(--text);
}
.success-order-line {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar-hidden .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        padding: 12px;
    }
    .sidebar-hidden .sidebar {
        display: none;
    }
    .sidebar nav {
        display: flex;
        overflow-x: auto;
    }
    .brand {
        margin: -12px -12px 0;
        padding: 12px 12px 10px;
    }
    .sidebar a { white-space: nowrap; }
    .content { padding: 14px; }
    .topbar {
        align-items: flex-start;
        margin: -14px -14px 14px;
        padding: 12px 14px;
    }
    .section-tabs {
        top: 69px;
        margin-top: -2px;
    }
    .panel[id] {
        scroll-margin-top: 132px;
    }
    .payment-summary {
        grid-template-columns: 1fr;
    }
    .filter-bar {
        grid-template-columns: 1fr;
    }
    .dashboard-stats,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .kitchen-board {
        grid-template-columns: 1fr;
    }
    .kitchen-column-head {
        top: 69px;
    }
    .stats-grid { grid-template-columns: 1fr; }
    .user-pill { display: none; }
}

@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    body { background: #fff; }
    .app-shell, .content { display: block; padding: 0; }
    body.printing-receipt .content > *:not(.receipt-panel) {
        display: none !important;
    }
    body.printing-receipt .receipt-panel {
        display: block !important;
        border: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    body.printing-receipt .receipt-panel > *:not(.receipt) {
        display: none !important;
    }
    body.printing-qr .content > *:not(.qr-print-sheet),
    body:has(.qr-print-sheet) .content > *:not(.qr-print-sheet) {
        display: none !important;
    }
    .qr-print-sheet {
        display: grid;
        place-items: center;
        gap: 8px;
        width: 72mm;
        margin: 0 auto;
        padding: 6mm 0;
        text-align: center;
        color: #111827;
    }
    .qr-print-sheet h1,
    .qr-print-sheet h2,
    .qr-print-sheet p {
        margin: 0;
    }
    .qr-print-sheet h1 {
        font-size: 26px;
    }
    .qr-print-sheet h2 {
        font-size: 18px;
    }
    .qr-print-sheet img {
        width: 54mm;
        height: 54mm;
        object-fit: contain;
    }
    .qr-print-sheet p {
        max-width: 64mm;
        overflow-wrap: anywhere;
        font-size: 10px;
        color: #4b5563;
    }
    .qr-grid { grid-template-columns: repeat(2, 1fr); }
    .qr-card { box-shadow: none; break-inside: avoid; }
    .receipt-panel {
        border: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    .receipt {
        width: 72mm;
        border: 0;
        padding: 0;
        margin: 0 auto;
        font-size: 12px;
    }
    .receipt-head strong { font-size: 16px; }
}
