/* POS Sate Gajah — admin UI foundation (no frameworks, responsive) */

/* Unified POS theme (Phase 3K) — warm restaurant palette shared by ALL roles.
   Design tokens live here; component styles reference only these variables. */
:root {
    --primary: #C0392B;
    --primary-dark: #96281B;
    --primary-light: #E74C3C;
    --accent: #F39C12;
    --accent-light: #F1C40F;
    --bg: #FFF9F2;
    --bg-soft: #FDF3E7;
    --card: #ffffff;
    --text: #2C1810;
    --muted: #8B7355;
    --border: #EFE3D3;
    --danger: #E74C3C;
    --success: #27AE60;
    --success-light: #2ECC71;
    --warning: #F39C12;
    --sidebar-w: 240px;
    /* aliases used by the pelayan screen components (kept for one
       source of truth — same values as --bg / --bg-soft / --muted) */
    --secondary: #FFF9F2;
    --cream: #FDF3E7;
    --text-light: #8B7355;
}

/* Keep native scrolling and pinch zoom; suppress double-tap zoom in nested scrollers too. */
* { box-sizing: border-box; touch-action: manipulation; }

body {
    margin: 0;
    font-family: system-ui, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #F7E9E2;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transition: transform .2s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-mark {
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 15px;
}
.brand-name { font-weight: 700; }
.brand-sub { font-size: 12px; opacity: .75; }

.nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-link {
    display: block;
    color: #F7E9E2;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-link:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav-link.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-logout { color: #f3c5b4; }
.sidebar-foot { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.12); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-title { font-weight: 700; font-size: 17px; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
}

.content { padding: 24px 20px; max-width: 1280px; width: 100%; }

/* ---------- components ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.card h2, .card h3 { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { text-align: center; }
.stat .stat-value { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat .stat-label { font-size: 13px; color: var(--muted); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-role { background: var(--bg-soft); color: #9A5B05; }
.badge-active { background: #e3f4ea; color: var(--success); }
.badge-inactive { background: #fdeaea; color: var(--danger); }
.badge-owner { background: #fdf0dc; color: #9a5b05; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--card);
}
table.data th, table.data td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data th { background: var(--bg-soft); font-weight: 700; color: var(--text); white-space: nowrap; }
table.data tr:hover td { background: var(--bg-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.row-inactive td { color: var(--muted); }

/* ---------- forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.form-group .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

input[type=text], input[type=password], input[type=number], input[type=email], input[type=date], input[type=month], select, textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font: inherit;
    background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #F3C1B8; border-color: var(--primary); }

.btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

.form-actions { display: flex; gap: 10px; margin-top: 18px; }

.checkbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.checkbox-list label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-list input { width: auto; }

/* ---------- flash ---------- */
.flash {
    padding: 11px 16px;
    border-radius: 8px;
    margin: 14px 20px 0;
    font-size: 14px;
}
.flash-success { background: #e3f4ea; color: #125c38; border: 1px solid #b5dfc6; }
.flash-error { background: #fdeaea; color: #8e2b1d; border: 1px solid #f2c1b8; }

/* ---------- auth pages ---------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    padding: 16px;
}
.auth-card {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.auth-brand { border-bottom: none; padding: 0 0 18px; }
.auth-brand .brand-name, .auth-brand .brand-sub { color: var(--text); }

/* ---------- responsive sidebar ---------- */
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-block; }
}

/* ---------- tablet-oriented POS screens ---------- */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.table-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.table-card button, .table-card a { display: block; width: 100%; }
.table-card > form { margin: 0; }
.table-card button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 22px 12px;
    text-align: center;
    font: inherit;
    color: inherit;
    width: 100%;
}
.table-card { display: block; text-decoration: none; color: inherit; padding: 22px 12px; text-align: center; }
.table-available { background: #eef7f0; border-color: #bfe0c9; }
.table-occupied { background: #fdf3e2; border-color: #f0d5a4; }
.table-code { font-size: 24px; font-weight: 800; }
.table-status { font-weight: 700; margin-top: 2px; }
.table-available .table-status { color: var(--success); }
.table-occupied .table-status { color: #9a5b05; }
.table-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.order-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .order-layout { grid-template-columns: 1fr; } }
.order-total { font-size: 26px; font-weight: 800; color: var(--primary); margin-top: 8px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.product-card { border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: hidden; }
.product-card button {
    width: 100%; border: none; background: none; cursor: pointer; padding: 14px;
    font: inherit; text-align: left; color: inherit;
}
.product-card:hover { border-color: var(--primary); }
.product-name { font-weight: 700; font-size: 15px; }
.product-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.batch-row { border-bottom: 1px solid var(--border); padding: 10px 0; }
.batch-row:last-child { border-bottom: none; }

/* Phase 3N-D: kitchen tickets wrap side-by-side and fall to the next row
   when width runs out — no horizontal scrolling, no forced single column. */
.kitchen-tickets { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.kitchen-tickets .ticket {
    flex: 1 1 280px;
    min-width: 240px;
    max-width: 100%;
    margin-bottom: 0;
}
.kitchen-col-head { margin: 0 0 10px; padding: 8px 10px; }
.ticket {
    background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: 8px; padding: 12px; margin-bottom: 10px;
}
.ticket-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 16px; }
.ticket-items { margin: 8px 0; }
.ticket-item { font-size: 15px; padding: 2px 0; }
.ticket-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- receipt (customer document; browser print, printer-agnostic) ---------- */
.receipt-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.receipt-paper {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 420px;
    margin: 0 auto;
    padding: 22px 18px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.45;
}
.receipt-header { text-align: center; }
.receipt-business { font-size: 17px; font-weight: 700; }
.receipt-branch { font-weight: 600; margin-top: 2px; }
.receipt-meta { font-size: 12px; }
.receipt-custom-header { font-size: 12px; margin-top: 4px; white-space: pre-line; }
.receipt-divider { text-align: center; font-size: 12px; color: #444; margin: 8px 0; }
.receipt-items { width: 100%; border-collapse: collapse; }
.receipt-items td { padding: 1px 0; }
.receipt-qty { font-size: 12px; }
.receipt-num { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-totals > div { display: flex; justify-content: space-between; }
.receipt-total-row { font-size: 15px; font-weight: 700; margin-top: 4px; }
.receipt-pay-row { font-size: 12px; }
.receipt-pay-row.muted, .receipt-pay-row.muted span { color: var(--muted); }
.receipt-footer { text-align: center; margin-top: 8px; font-size: 12px; white-space: pre-line; }

@media print {
    .sidebar, .topbar, .flash, .no-print, .receipt-actions { display: none !important; }
    .main { margin: 0 !important; }
    .content { padding: 0 !important; max-width: none !important; }
    .receipt-paper { border: none; border-radius: 0; max-width: 100%; padding: 0; }
    body { background: #fff; }
    @page { margin: 6mm; }
}

/* ---------- misc ---------- */
.pagination { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
code.mono { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
pre.code { background: #111827; color: #d1fae5; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

/* ---------- B-1 CSP remediation (Phase 3H-1) ----------
   Classes replacing former inline style="" attributes in views/.
   Declared AFTER the component rules on purpose: same-specificity
   conflicts (e.g. .m-0 vs .form-group, .btn-block vs .btn) are won by
   later declaration, exactly as the removed inline styles always won. */
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-18 { font-size: 18px; }
.fw-800 { font-weight: 800; }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 2px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-6 { margin-bottom: 6px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.ml-20 { margin-left: 20px; }
.w-auto { width: auto; }
.w-full { width: 100%; }
.mw-340 { max-width: 340px; }
.mw-640 { max-width: 640px; }
.mw-680 { max-width: 680px; }
.mw-760 { max-width: 760px; }
.mw-860 { max-width: 860px; }
.min-w-44 { min-width: 44px; }
.min-w-140 { min-width: 140px; }
.min-w-160 { min-width: 160px; }
.d-inline { display: inline; }
.inline-flex { display: inline-flex; gap: 4px; align-items: center; }
.flex-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-row-6 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.flex-row-10 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-center { display: flex; gap: 10px; align-items: center; }
.flex-row-end { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.flex-1 { flex: 1; }
.row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.row-between-tight { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.row-between-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.text-center { text-align: center; }
.btn-block { width: 100%; font-size: 17px; padding: 12px; }
.btn-block-16 { width: 100%; font-size: 16px; padding: 12px; }
.btn-lg { font-size: 16px; padding: 10px 20px; }
.btn-xl { font-size: 18px; padding: 14px 28px; }
.form-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.list-row { border-bottom: 1px solid var(--border); padding: 10px 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card-edge-success { border-left: 4px solid var(--success); }
.card-edge-accent { border-left: 4px solid var(--accent); }
.card-edge-primary { border-left: 4px solid var(--primary); }
.card-edge-danger { border-left: 4px solid var(--danger); }
.card-primary { border: 2px solid var(--primary); }
.card-warning { border: 2px solid #d97706; }
.card-plain { display: flex; gap: 8px; flex-wrap: wrap; border: none; padding: 0; background: none; }
/* Element-qualified widths: input/select rules (specificity 0,1,1) set
   width:100%; these must win for the specific-width fields. */
input.w-110, select.w-110 { width: 110px; }
input.w-140, select.w-140 { width: 140px; }
input.w-180, select.w-180 { width: 180px; }
input.w-280, select.w-280 { width: 280px; }
input.w-auto, select.w-auto { width: auto; }

/* ---------- PELAYAN MODE (owner design reference: contoh_tampilan_pelayan.html) ----------
   Full-screen warm sate theme for the PELAYAN role only. No external fonts,
   no inline styles (strict CSP). Sidebar/topbar hidden; logout lives in the
   pelayan header. */
body.pelayan-mode {
    background-image:
        radial-gradient(circle at 10% 0%, rgba(243, 156, 18, 0.08), transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(192, 57, 43, 0.06), transparent 40%);
    overflow: hidden;
}
body.pelayan-mode .sidebar,
body.pelayan-mode .topbar,
body.pelayan-mode .flash { display: none !important; }

/* Phase 3K.1 — TRUE fixed viewport: an explicit height chain from the
   layout down to the order panel. Without it, every section was
   height:auto and the page could grow past 100vh (clipped by
   overflow:hidden) — which pushed the pagination below the fold at 100%
   browser zoom. */
body.pelayan-mode .layout { height: var(--pelayan-viewport-height, 100vh); min-height: 0; overflow: hidden; }
body.pelayan-mode .main {
    margin-left: 0 !important;
    height: var(--pelayan-viewport-height, 100vh);
    min-height: 0;
    display: flex;
    flex-direction: column;
}
body.pelayan-mode .content {
    padding: 0 !important;
    max-width: none !important;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
body.pelayan-mode .pelayan-header,
body.pelayan-mode .pelayan-tabs,
body.pelayan-mode .pelayan-tables-head { flex-shrink: 0; }
body.pelayan-mode .pelayan-order-layout { flex: 1; min-height: 0; }
body.pelayan-mode .pelayan-tables-grid {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

.pelayan-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: #fff;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 60px;
    box-shadow: 0 8px 24px rgba(192, 57, 43, 0.12);
    position: relative;
    overflow: hidden;
}
.pelayan-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(243, 156, 18, 0.3), transparent 70%);
    pointer-events: none;
}
.pelayan-brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.pelayan-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.pelayan-info { display: flex; gap: 10px; align-items: center; font-weight: 600; position: relative; z-index: 1; }
.pelayan-chip {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 14px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    white-space: nowrap;
}
.pelayan-chip form { display: inline; }
.pelayan-chip .logout-btn {
    background: none;
    border: none;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pelayan-badge {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(243, 156, 18, 0.5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pelayan-tables-head {
    padding: 26px 32px 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}
.pelayan-tables-head h1 { font-size: 28px; font-weight: 800; color: var(--text); margin: 0; }
.pelayan-tables-head h1 .sub { display: block; font-size: 14px; font-weight: 500; color: var(--text-light); margin-top: 4px; }
.pelayan-legend { display: flex; gap: 14px; font-size: 13px; font-weight: 600; align-items: center; }
.pelayan-legend .item { display: flex; align-items: center; gap: 8px; }
.pelayan-legend .dot { width: 12px; height: 12px; border-radius: 50%; }
.pelayan-legend .dot.kosong { background: var(--success); box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.15); }
.pelayan-legend .dot.sedang { background: var(--danger); box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.15); }
.pelayan-legend .dot.menunggu { background: var(--warning); box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.15); }
.pelayan-legend select { width: auto; }

.pelayan-tables-grid {
    padding: 16px 32px 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    align-content: start;
    overflow-y: auto;
    max-height: calc(100vh - 210px);
}
.pelayan-table-card {
    background: #fff;
    border-radius: 20px;
    padding: 22px 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.08);
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border);
    text-decoration: none;
    color: inherit;
}
.pelayan-table-card form { margin: 0; width: 100%; }
.pelayan-table-card .card-btn {
    width: 100%;
    min-height: 130px;
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 14px;
}
.pelayan-table-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
}
.pelayan-table-card.kosong::before { background: linear-gradient(90deg, var(--success), var(--success-light)); }
.pelayan-table-card.sedang::before { background: linear-gradient(90deg, var(--danger), #FF7B72); }
.pelayan-table-card.menunggu::before { background: linear-gradient(90deg, var(--warning), var(--accent-light)); }
.pelayan-table-card:hover { transform: translateY(-5px); box-shadow: 0 20px 48px rgba(192, 57, 43, 0.18); }
.pelayan-table-card .num {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--text), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.pelayan-table-card .status {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pelayan-table-card.kosong .status { background: rgba(39, 174, 96, 0.1); color: var(--success); }
.pelayan-table-card.sedang .status { background: rgba(231, 76, 60, 0.1); color: var(--danger); }
.pelayan-table-card.menunggu .status { background: rgba(243, 156, 18, 0.15); color: var(--warning); }
.pelayan-table-card .status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.pelayan-table-card .sub { font-size: 12px; color: var(--text-light); font-weight: 600; }

.pelayan-tabs {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.pelayan-tabs::-webkit-scrollbar { display: none; }
.pelayan-tabs .tab {
    min-height: 48px;
    padding: 0 20px;
    border: 2px solid transparent;
    background: #fff;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.08);
    transition: transform 0.25s, box-shadow 0.25s;
}
.pelayan-tabs .tab:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(192, 57, 43, 0.12); }
.pelayan-tabs .tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: var(--primary-dark);
    box-shadow: 0 8px 20px rgba(192, 57, 43, 0.35);
    transform: translateY(-2px);
}

.pelayan-order-layout { flex: 1; display: flex; overflow: hidden; }
.pelayan-products {
    flex: 1;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-content: start;
    overflow-y: auto;
}
.pelayan-product {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    transition: transform 0.25s, box-shadow 0.25s;
}
.pelayan-product:hover { transform: translateY(-5px); box-shadow: 0 20px 48px rgba(192, 57, 43, 0.18); }
.pelayan-product .img {
    position: relative;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #FDEBD0, #FAD7A1);
}
/* FIX — product name readability (photo cards): white caption on a bottom
   gradient scrim. The scrim is painted on the caption's own box so it grows
   with wrapped (long) names, keeps the photo visible, and needs no extra
   markup/JS beyond .name-overlay. */
.pelayan-product .img .name-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 8px 5px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0.42) 60%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}
.pelayan-product .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pelayan-product .name { font-size: 15px; font-weight: 700; line-height: 1.25; color: var(--text); }
.pelayan-product .price { font-size: 14px; color: var(--primary); font-weight: 800; }
.pelayan-product .add-btn {
    margin-top: auto;
    min-height: 44px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.35);
}
.pelayan-product .add-btn:active { transform: scale(0.96); }

.pelayan-panel {
    width: 360px;
    background: #fff;
    border-left: 1px solid var(--border);
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: manipulation;
    overscroll-behavior-y: contain;
    scroll-padding-block: 120px;
    flex-shrink: 0;
    min-height: 0; /* Phase 3K.1: flex child of a fixed-height row */
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.04);
}
.pelayan-panel .panel-head {
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pelayan-panel .panel-head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.pelayan-panel .panel-head { gap: 8px; }
.pelayan-panel .table-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 48%;
    overflow-wrap: anywhere;
}
.pelayan-cart { min-height: 0; overflow: visible; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pelayan-cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-light); gap: 10px; padding: 30px 16px; text-align: center; }
.pelayan-cart-empty .icon { font-size: 56px; opacity: 0.3; }
.pelayan-cart-item {
    /* Phase 3K.2 — items are flex children of a constrained-height,
       scrollable column: flex-shrink must be OFF, otherwise the boxes
       compress below their content height and the inner rows visually
       overlap the next item. Many items => container scrolls; items
       themselves never shrink. */
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    background: var(--cream);
    border-radius: 14px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    gap: 8px;
}
.pelayan-cart-item .name,
.pelayan-cart-item .opts { overflow-wrap: anywhere; }
.pelayan-cart-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
}
.pelayan-cart-item .info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.pelayan-cart-item .name { font-weight: 800; font-size: 14px; color: var(--text); }
.pelayan-cart-item .qty { font-size: 12px; color: var(--text-light); font-weight: 600; }
.pelayan-cart-item .opts {
    font-size: 11px;
    color: var(--text-light);
    background: #fff;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
    margin-top: 4px;
    width: fit-content;
    font-weight: 600;
    border: 1px solid var(--border);
}
.pelayan-cart-item .price { font-weight: 800; font-size: 14px; color: var(--primary); text-align: right; white-space: nowrap; }
.pelayan-cart-item .item-form { display: flex; gap: 6px; align-items: center; }
.pelayan-cart-item .qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
}
.pelayan-cart-item .del-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    color: var(--danger);
}
.pelayan-total {
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--cream), #FFF4E0);
    border-top: 2px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pelayan-total .label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-light); letter-spacing: 1px; }
.pelayan-total .value {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.pelayan-actions { padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.pelayan-send {
    min-height: 64px;
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.35);
}
.pelayan-send:active { transform: scale(0.98); }
.pelayan-back {
    min-height: 50px;
    background: #fff;
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pelayan-primary-actions { position: sticky; top: 0; bottom: 0; z-index: 2; background: #fff; box-shadow: 0 -4px 12px rgba(44, 24, 16, .06); }
.pelayan-panel .pelayan-total { padding: 8px 12px; }
.pelayan-panel .pelayan-total .value { font-size: 20px; }
.pelayan-panel .pelayan-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px 10px; gap: 8px; }
.pelayan-panel .pelayan-actions > form:only-child { grid-column: 1 / -1; }
.pelayan-panel .pelayan-send, .pelayan-panel .pelayan-back { min-height: 48px; padding: 6px; font-size: 14px; border-radius: 10px; white-space: normal; }
.pelayan-panel .pelayan-cart-item { flex-direction: column; padding: 10px; gap: 6px; }
.pelayan-panel .pelayan-cart-item .info { width: 100%; }
.pelayan-panel .pelayan-cart-item .item-form { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; gap: 6px; width: 100%; }
.pelayan-panel .pelayan-cart-item .qty-btn, .pelayan-panel .pelayan-cart-item .del-btn { width: 44px; height: 44px; }
.pelayan-panel .pelayan-cart-empty { padding: 16px 10px; gap: 6px; }
.pelayan-panel .pelayan-cart-empty .icon { font-size: 32px; }
.pelayan-panel-meta { overflow: visible; max-height: none; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pelayan-panel-meta .meta-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pelayan-panel-meta .meta-row > * { max-width: 100%; overflow-wrap: anywhere; }
.pelayan-panel-meta input[type=text], .pelayan-panel-meta select { width: auto; flex: 1; min-width: 120px; }
.pelayan-panel-meta details { font-size: 13px; }
.pelayan-panel-meta summary { font-weight: 700; color: var(--text); cursor: pointer; padding: 10px; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; list-style: none; }
.pelayan-panel-meta summary::-webkit-details-marker { display: none; }
.pelayan-panel-meta summary::after { content: '+'; font-size: 22px; color: var(--primary); }
.pelayan-panel-meta details[open] > summary::after { content: '−'; }
.pelayan-panel-meta details { border: 1px solid var(--border); border-radius: 10px; }
.pelayan-panel-meta .panel-section-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.pelayan-panel-meta details:not([open]) > .panel-section-body { display: none; }
.pelayan-panel-meta .panel-section-body > p { margin: 0; }
.pelayan-panel-meta .mini-form input, .pelayan-panel-meta .mini-form select { min-height: 44px; min-width: 0; max-width: 100%; flex: 1 1 140px; scroll-margin-block: 12px; }
.pelayan-panel-meta .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; white-space: normal; }
.pelayan-panel-short .pelayan-primary-actions { position: static; }
.pelayan-panel-short { scroll-padding-block: 12px; }
.pelayan-panel-meta .batch-line { display: flex; justify-content: space-between; flex-wrap: wrap; overflow-wrap: anywhere; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.pelayan-panel-meta .mini-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* product modal */
.pelayan-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 24, 16, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.pelayan-modal.open { display: flex; }
.pelayan-modal-content {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}
.pelayan-modal-head {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 22px;
    text-align: center;
}
.pelayan-modal-head .emoji { font-size: 48px; margin-bottom: 6px; }
.pelayan-modal-head h2 { font-size: 22px; font-weight: 800; margin: 0; }
.pelayan-modal-head .price { font-size: 15px; color: rgba(255, 255, 255, 0.9); margin-top: 4px; font-weight: 600; }
.pelayan-modal-body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.pelayan-modal-body .grp-label { font-weight: 800; font-size: 12px; text-transform: uppercase; color: var(--text-light); letter-spacing: 1px; }
.pelayan-qty { display: flex; align-items: center; justify-content: center; gap: 28px; }
.pelayan-qty button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: #fff;
    font-size: 26px;
    font-weight: 700;
    font-family: inherit;
    color: var(--primary);
    cursor: pointer;
}
.pelayan-qty button:active { background: var(--primary); color: #fff; }
.pelayan-qty .qty-value {
    width: 90px;
    max-width: 100%;
    padding: 4px;
    font-family: inherit;
    font-size: 40px;
    font-weight: 800;
    min-width: 70px;
    text-align: center;
    color: var(--primary);
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 12px;
}
.pelayan-options { display: flex; gap: 10px; flex-wrap: wrap; }
.pelayan-option {
    min-height: 52px;
    padding: 0 18px;
    border: 2px solid var(--border);
    background: #fff;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    flex: 1;
    min-width: 76px;
}
.pelayan-option.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(192, 57, 43, 0.3);
}
.pelayan-modal-body textarea {
    width: 100%;
    min-height: 74px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    background: var(--cream);
}
.pelayan-modal-foot { padding: 14px 22px 20px; display: flex; flex-direction: column; gap: 10px; }
/* X4.20: expense supervisor PIN modal body (reuses the pelayan-modal shell) */
.pin-modal-body { padding: 20px 22px 0; }
.pelayan-modal-add {
    min-height: 60px;
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.35);
}

@media (max-width: 1100px) {
    .pelayan-products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .pelayan-tables-grid { grid-template-columns: repeat(3, 1fr); padding: 16px 20px 20px; }
    .pelayan-panel { width: 300px; }
}
@media (max-width: 700px) {
    .pelayan-products { grid-template-columns: repeat(2, 1fr); }
    .pelayan-tables-grid { grid-template-columns: repeat(2, 1fr); }
    .pelayan-order-layout { flex-direction: column; }
    .pelayan-panel { width: 100%; height: 45%; border-left: none; border-top: 1px solid var(--border); }
}

/* ---------- Phase 3K UX refinement ----------
   Fixed-viewport product grid + server-side pagination, unified warm theme
   finishing touches for all roles. */

/* topbar + content polish (all roles) */
.topbar { box-shadow: 0 2px 10px rgba(192, 57, 43, 0.06); }
.card { box-shadow: 0 2px 8px rgba(192, 57, 43, 0.05); }

/* Fixed-screen pelayan layout: the product column owns a controlled height;
   the grid itself does not grow the page. */
.pelayan-products-col {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pelayan-products {
    flex: 1;
    min-height: 0;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-content: start;
    overflow-y: auto; /* fallback ONLY for very short screens (portrait); */
                      /* primary behavior = items fit without scrolling   */
    scrollbar-width: thin;
}
/* compact product cards: 3 rows of 4 (12 items) must fit tablet landscape */
.pelayan-product .img { height: 64px; font-size: 36px; }
.pelayan-product .body { padding: 10px 12px 12px; gap: 4px; }
.pelayan-product .name { font-size: 14px; }
.pelayan-product .price { font-size: 13px; }
.pelayan-product .add-btn { min-height: 40px; font-size: 13px; }
/* compact photo caption: smaller pad so the 64px photo stays visible */
.pelayan-product .img .name-overlay { padding: 12px 6px 4px; font-size: 11px; }

/* pagination bar: always visible, touch friendly, consistent space */
.pelayan-pagination {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 10px;
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid var(--border);
}
.pelayan-pagination .page-btn {
    min-width: 46px;
    min-height: 46px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
    border: 2px solid var(--border);
    color: var(--text);
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.pelayan-pagination .page-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(192, 57, 43, 0.15); }
.pelayan-pagination .page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(192, 57, 43, 0.3);
}
.pelayan-pagination .page-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ticket cards (dapur) get the warm cart-item accent */
.ticket {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.ticket-head strong { color: var(--primary); }

/* ---------- Phase 3L: read-back popup + payment info panels ---------- */
/* Phase 3N-C: compact order summary — single scroll region, pinned total
   and actions, compact grid rows (no per-item cards). Readable on
   320px+ portrait without horizontal overflow. */
#readback-modal { padding: 12px; }
.readback-content { max-height: 90vh; max-height: 90dvh; width: 100%; max-width: 480px; }
.readback-content .pelayan-modal-head { flex-shrink: 0; padding: 14px 16px; }
.readback-content .pelayan-modal-head .emoji { font-size: 28px; margin-bottom: 2px; }
.readback-content .pelayan-modal-head h2 { font-size: 18px; }
.readback-content .pelayan-modal-head .price { font-size: 13px; }
.readback-content .pelayan-modal-foot { flex-shrink: 0; padding: 12px 16px 16px; gap: 8px; }
.readback-content .pelayan-send { min-height: 48px; font-size: 14px; white-space: normal; }
.readback-content .pelayan-back { min-height: 44px; }
.readback-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 16px;
    display: flex;
    flex-direction: column;
}
.readback-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 4px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--border);
    align-items: baseline;
}
.readback-row:last-child { border-bottom: none; }
.readback-edit { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 6px; min-width: 0; }
.readback-edit button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 48px; width: 48px; height: 48px; min-width: 48px; min-height: 48px; padding: 0; font: inherit; font-size: 24px; line-height: 1; border: 1px solid var(--border); border-radius: 12px; background: var(--cream); color: var(--primary); cursor: pointer; touch-action: manipulation; }
.readback-quantity { min-width: 36px; text-align: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.readback-edit .readback-delete { margin-left: auto; background: #fff; color: var(--danger); }
.readback-edit button:active:not(:disabled) { background: var(--border); }
.readback-edit button:disabled { opacity: .45; }
#readback-modal .pelayan-send:disabled { opacity: .5; cursor: default; }
#readback-modal [data-readback-status]:empty { display: none; }
#readback-modal [data-readback-status] { margin: 0; color: var(--danger); font-size: 13px; }
#readback-modal [data-readback-reload] { min-height: 44px; font: inherit; }
.readback-row .name {
    grid-column: 1;
    grid-row: 1;
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text);
    overflow-wrap: anywhere;
    line-height: 1.3;
}
.readback-row .meta {
    grid-column: 1;
    grid-row: 2;
    font-size: 12.5px;
    color: var(--text-light);
    font-weight: 600;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.readback-row .meta .note { display: block; color: var(--muted); font-weight: 500; }
.readback-row .price {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    text-align: right;
    font-weight: 800;
    font-size: 14.5px;
    color: var(--primary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.readback-total {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    margin: 0 16px;
    border-top: 2px dashed var(--border);
}
.readback-total .label { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--text-light); letter-spacing: 1px; }
.readback-total .value { font-size: 21px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

.payment-info { display: none; padding: 10px 0 4px; }





/* ---------- Phase 3N-F: cashier payment focus ---------- */
.cashier-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
/* Payment = PRIMARY (first visually); order details = SECONDARY */
.cashier-primary { order: 1; min-width: 0; }
.cashier-secondary { order: 2; min-width: 0; }
.cashier-pay-card { border: 2px solid var(--primary); }
.cashier-total-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.cashier-total-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); }
.cashier-total-value { font-size: 34px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.15; }
.cashier-amount-input { font-size: 20px; padding: 12px 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cashier-pay-btn { font-size: 19px; min-height: 58px; }

@media (max-width: 900px) {
    .cashier-layout { grid-template-columns: 1fr; }
    /* payment first on mobile/portrait */
    .cashier-primary { order: 1; }
    .cashier-secondary { order: 2; }
}

/* ---------- Phase 3N-H: Chart.js chart containers ---------- */
.chart-box { position: relative; height: 240px; max-width: 100%; }
@media (max-width: 700px) { .chart-box { height: 210px; } }

/* X4.15: product photo thumbnails (builder grid + admin preview) */
.product-thumb { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.product-photo-preview { max-width: 140px; max-height: 140px; object-fit: cover; border-radius: 6px; margin: 8px 0; display: block; }
