/* =====================================================================
   DineFlow — base design system
   Tokens, shared components and helpers. Screen rules live in site.css
   (website + QR ordering), staff.css (kitchen, waiter, POS) and admin.css.
   Rule: colours only through the variables declared in :root. Brand
   colours and fonts are overridden by /theme.css (Settings › Appearance).
   ===================================================================== */

:root {
    --font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font: "Plus Jakarta Sans", var(--font-fallback);
    --font-display: var(--font);

    /* brand (overridden by /theme.css) */
    --brand: #f2711c;
    --brand-2: #ff8a3d;
    --dark: #1f1a17;
    --accent: #f5b335;

    /* derived */
    --brand-deep: color-mix(in srgb, var(--brand) 78%, var(--black));
    --brand-soft: color-mix(in srgb, var(--brand) 8%, var(--white));
    --brand-soft-2: color-mix(in srgb, var(--brand) 15%, var(--white));
    --brand-line: color-mix(in srgb, var(--brand) 28%, var(--white));
    --dark-2: color-mix(in srgb, var(--dark) 86%, var(--white));
    --dark-3: color-mix(in srgb, var(--dark) 74%, var(--white));
    --dark-line: color-mix(in srgb, var(--white) 10%, transparent);
    --grad-brand: linear-gradient(135deg, var(--brand-2), var(--brand) 60%, var(--brand-deep));
    --grad-side: linear-gradient(180deg, var(--dark) 0%, var(--dark) 100%);
    --grad-soft: linear-gradient(135deg, var(--cream), var(--brand-soft) 60%, var(--white));
    --grad-dark: linear-gradient(110deg, var(--dark) 0%, var(--dark-2) 55%, var(--brand-deep) 130%);

    /* palette */
    --c-purple: #8b5cf6;
    --c-pink: #e0457b;
    --c-orange: #f2711c;
    --c-blue: #3b82f6;
    --c-green: #1f9d55;
    --c-red: #e5383b;
    --c-gold: #f5b335;
    --c-teal: #14a39a;
    --veg: #1f9d3a;
    --nonveg: #e0282e;
    --star: #f5a623;

    --success: #1f9d55;
    --success-2: #2fb36a;
    --success-bg: #e5f6ec;
    --warning: #d9730d;
    --warning-bg: #fff0e0;
    --danger: #e0282e;
    --danger-bg: #fde8e8;
    --info: #2f6fdc;
    --info-bg: #e3edfd;
    --purple: #7c4dff;
    --purple-bg: #efe8ff;
    --muted-bg: #f1ece7;

    --white: #ffffff;
    --black: #000000;
    --wood: #c98b4f;
    --wood-dark: #9a6634;
    --floor: #f6e7d2;
    --floor-2: #efd9bb;

    /* surfaces */
    --bg: #fbf4ec;
    --cream: #fff8f1;
    --surface: #ffffff;
    --surface-2: #fffaf5;
    --border: #f1e4d6;
    --border-strong: #e6d3c0;
    --text: #1f1a17;
    --text-2: #4b4038;
    --muted: #8a7d72;
    --on-brand: #ffffff;
    --on-dark: #ffffff;
    --on-dark-muted: color-mix(in srgb, var(--white) 72%, transparent);
    --on-brand-muted: color-mix(in srgb, var(--white) 80%, transparent);
    --on-brand-line: color-mix(in srgb, var(--white) 18%, transparent);

    --shadow-sm: 0 1px 3px color-mix(in srgb, var(--dark) 6%, transparent);
    --shadow: 0 6px 22px color-mix(in srgb, var(--dark) 7%, transparent);
    --shadow-lg: 0 18px 48px color-mix(in srgb, var(--dark) 16%, transparent);
    --shadow-brand: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --header-h: 72px;
    --side-w: 250px;
    --side-w-mini: 84px;
    --container: 1220px;
    --bottom-nav-h: 64px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- icons ---------- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 26px; height: 26px; }
.icon-xl { width: 34px; height: 34px; }
.icon-fill { fill: currentColor; }

/* ---------- typography helpers ---------- */
.text-muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { font-weight: 800; color: var(--brand); }
.price small { font-weight: 500; color: var(--text-2); font-size: 13px; }
.highlight { color: var(--brand-2); }

/* ---------- layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.flex { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.items-start { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.gap-xs { gap: 4px; } .gap-sm { gap: 8px; } .gap { gap: 14px; } .gap-lg { gap: 22px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border-radius: var(--radius-sm);
    border: 1.5px solid transparent; background: none;
    font-weight: 600; font-size: 14.5px; white-space: nowrap; line-height: 1;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-brand); color: var(--on-brand); box-shadow: var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: var(--surface); }
.btn-outline:hover { background: var(--brand-soft); }
.btn-light { background: var(--brand-soft); color: var(--brand); }
.btn-light:hover { background: var(--brand-soft-2); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn-danger { background: var(--danger); color: var(--on-brand); }
.btn-danger-outline { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-success { background: var(--success); color: var(--on-brand); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 7px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; gap: 5px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.icon-btn {
    position: relative; display: inline-grid; place-items: center;
    width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--text);
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }
.link { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.link:hover { text-decoration: underline; }
button.link { border: 0; background: none; padding: 0; cursor: pointer; }
.link-danger { color: var(--danger); }
.count-badge {
    position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: var(--radius-pill); background: var(--danger); color: var(--on-brand);
    font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface);
}
.dot-badge { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

/* ---------- cards ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-tint { background: var(--grad-soft); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head + .card-body { padding-top: 14px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; color: var(--text); }
.card-title .icon { color: var(--brand); width: 24px; height: 24px; }
.card-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); }

/* tinted icon bubble — tones */
.tile-icon {
    width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; flex: none;
    background: var(--brand-soft); color: var(--brand);
}
.tile-icon .icon { width: 26px; height: 26px; }
.tone-purple { --tone: var(--c-purple); }
.tone-pink { --tone: var(--c-pink); }
.tone-orange { --tone: var(--c-orange); }
.tone-blue { --tone: var(--c-blue); }
.tone-green { --tone: var(--c-green); }
.tone-gold { --tone: var(--c-gold); }
.tone-red { --tone: var(--c-red); }
[class*="tone-"].tile-icon { background: color-mix(in srgb, var(--tone) 12%, var(--white)); color: var(--tone); }

/* ---------- stat card ---------- */
.stat-card { display: flex; align-items: center; gap: 16px; padding: 18px; }
.stat-value, .stat-label { display: block; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--text); }
.stat-label { color: var(--text-2); font-size: 14px; margin-top: 3px; }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; margin-top: 4px; }
.stat-trend.is-up { color: var(--success); }
.stat-trend.is-down { color: var(--danger); }
.stat-trend.is-flat { color: var(--muted); }

/* ---------- badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 11px; border-radius: var(--radius-pill);
    font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--muted); }
.badge-brand { background: var(--brand-soft-2); color: var(--brand); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-outline { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.badge .icon { width: 14px; height: 14px; }
.badge-lg { height: 30px; padding: 0 14px; font-size: 13.5px; }
.badge-solid { background: var(--grad-brand); color: var(--on-brand); }
.pill-label {
    display: inline-flex; align-items: center; height: 30px; padding: 0 16px; border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--c-pink) 12%, var(--white)); color: var(--brand); font-size: 13.5px; font-weight: 500;
}

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.label-hint { font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; height: 44px; padding: 0 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 110px; padding: 11px 14px; resize: vertical; }
.select {
    appearance: none; padding-right: 38px;
    background-image: url("../img/chevron-down.svg"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 15%, transparent); }
.input-sm, .select-sm { height: 36px; font-size: 13.5px; }
.is-invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; }
.field-hint { color: var(--muted); font-size: 12.5px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input, .input-icon > .select { padding-left: 42px; }
.input-lg { height: 52px; font-size: 16px; }
.input-icon > .input-lg { padding-left: 54px; }
.input-has-action > .input { padding-right: 52px; }
.input-action { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 8px; background: none; color: var(--text-2); display: grid; place-items: center; }
.input-action:hover { color: var(--brand); }
.input-action .i-hide, .input-action.is-visible .i-show { display: none; }
.input-action.is-visible .i-hide { display: block; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
/* File pickers (every .file-input): dashed drop area + brand "Choose file" button instead of the browser's plain one. */
.file-input { padding: 8px; height: auto; border-style: dashed; border-color: var(--brand-line); background: var(--brand-soft); color: var(--text-2); font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.file-input:hover, .file-input:focus-visible { border-color: var(--brand-2); background: var(--surface); }
.file-input::file-selector-button { margin-right: 12px; padding: 9px 18px; border: 0; border-radius: var(--radius-sm); background: var(--grad-brand); color: var(--white); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); transition: filter .15s; }
.file-input:hover::file-selector-button { filter: brightness(1.08); }
.file-input::-webkit-file-upload-button { margin-right: 12px; padding: 9px 18px; border: 0; border-radius: var(--radius-sm); background: var(--grad-brand); color: var(--white); font: inherit; font-weight: 600; cursor: pointer; }
/* Chosen-file thumbnails under a .file-input (built by app.js) */
.file-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.file-previews-note { grid-column: 1 / -1; color: var(--brand); font-size: 12.5px; font-weight: 600; }
.file-preview { position: relative; display: grid; gap: 4px; min-width: 0; }
.file-preview img, .file-preview-icon { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--brand-soft); }
.file-preview-icon { display: grid; place-items: center; color: var(--brand); font-weight: 700; font-size: 13px; }
.file-preview-name { overflow: hidden; color: var(--muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.file-preview-remove { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: var(--radius-pill); background: var(--surface); color: var(--danger); box-shadow: var(--shadow-sm); cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 42px; height: 24px; border-radius: var(--radius-pill); background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.color-input { width: 64px; height: 44px; padding: 4px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table th {
    text-align: left; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 11px 14px;
    background: var(--brand-soft); white-space: nowrap;
}
.table th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-compact td { padding: 9px 12px; font-size: 13px; }
.cell-media { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.cell-media img { width: 64px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.cell-media strong { display: block; font-size: 14px; }
.cell-sub { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.cell-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* ---------- avatar ---------- */
.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover;
    display: grid; place-items: center; font-weight: 700; font-size: 14px;
    background: var(--grad-brand); color: var(--on-brand);
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; border: 3px solid var(--on-brand-line); }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark { width: 50px; height: 38px; color: var(--accent); flex: none; }
.logo-img { height: 42px; width: auto; }
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-name { font-size: 25px; font-weight: 800; color: var(--brand-deep); line-height: 1.05; letter-spacing: -.02em; }
.logo-tagline { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.logo-light .logo-name, .logo-light .logo-tagline { color: var(--on-brand); }

/* ---------- restaurant brand (x-brand) ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 58px; height: 52px; flex: none; object-fit: contain; }
.brand-img { height: 54px; width: auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--text); white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--brand); }
.brand-tagline { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.brand-sm .brand-mark { width: 40px; height: 36px; }
.brand-sm .brand-name { font-size: 21px; }
.brand-sm .brand-tagline { font-size: 11px; }
.brand-lg .brand-mark { width: 72px; height: 64px; }
.brand-lg .brand-name { font-size: 36px; }

/* ---------- alerts / flash ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert ul { padding-left: 16px; list-style: disc; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .tile-icon { margin: 0 auto 12px; }
.empty-title { font-weight: 700; color: var(--text); font-size: 16px; }

/* ---------- pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 22px; }
.page-link {
    min-width: 38px; height: 38px; padding: 0 10px; border-radius: var(--radius-sm); display: grid; place-items: center;
    border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-2);
}
.page-link:hover { border-color: var(--brand); color: var(--brand); }
.page-link.is-active { background: var(--grad-brand); border-color: transparent; color: var(--on-brand); }
.page-link.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; z-index: 60; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    display: none;
}
.dropdown.is-open .dropdown-menu { display: block; }
.dropdown-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; border: 0; background: none;
    font-size: 14px; color: var(--text-2); text-align: left;
}
.dropdown-item:hover { background: var(--brand-soft); color: var(--brand); }
.dropdown-item .icon { width: 18px; height: 18px; }

/* ---------- tabs / chips ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tab.is-active, .tab:hover { color: var(--brand); border-bottom-color: var(--brand); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.chip.is-active, .chip:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* ---------- quick action tile ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
    min-height: 96px; padding: 14px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 14.5px; font-weight: 500; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.quick-tile .icon { width: 34px; height: 34px; color: var(--brand); stroke-width: 1.6; }
.quick-tile:hover { border-color: var(--brand-line); box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- food marks ---------- */
/* Veg / non-veg square with a dot (Indian menu convention). */
.food-mark { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border: 2px solid var(--veg); border-radius: 4px; background: var(--white); }
.food-mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--veg); }
.food-mark.is-nonveg { border-color: var(--nonveg); }
.food-mark.is-nonveg::after { background: var(--nonveg); }
.food-mark-lg { width: 24px; height: 24px; border-radius: 5px; }
.food-mark-lg::after { width: 11px; height: 11px; }
.food-mark-sm { width: 14px; height: 14px; border-width: 1.5px; border-radius: 3px; }
.food-mark-sm::after { width: 6px; height: 6px; }
.spice { display: inline-flex; gap: 1px; color: var(--nonveg); }
.spice .icon { width: 17px; height: 17px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; }
.spice .is-off { color: var(--border-strong); }
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text); }
.rating .icon { width: 15px; height: 15px; color: var(--star); fill: currentColor; stroke: none; }
.rating small { font-weight: 500; color: var(--muted); font-size: inherit; }

/* ---------- quantity stepper ---------- */
.qty { display: inline-flex; align-items: center; gap: 2px; height: 38px; padding: 0 4px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.qty button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; display: grid; place-items: center; color: var(--text); }
.qty button:hover { background: var(--brand-soft); color: var(--brand); }
.qty button .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.qty .qty-plus { color: var(--brand); }
.qty output, .qty input { min-width: 24px; text-align: center; font-weight: 700; font-size: 15px; border: 0; background: none; padding: 0; width: 28px; }
.qty-sm { height: 30px; }
.qty-sm button { width: 24px; height: 24px; }
.qty-sm output { font-size: 13px; }

/* ---------- section title with orange bar ("| Starters (12 items)") ---------- */
.bar-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text); }
.bar-title::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--brand); flex: none; }
.bar-title small { font-size: .72em; font-weight: 500; color: var(--text-2); }
.bar-title .icon { color: var(--brand); }

/* ---------- segmented buttons (Dine-in / Takeaway / Delivery, floors) ---------- */
.segments { display: flex; gap: 8px; flex-wrap: wrap; }
.segment { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: 15px; color: var(--text); }
.segment .icon { width: 22px; height: 22px; }
.segment:hover { border-color: var(--brand-line); }
.segment.is-active, .segment:has(input:checked) { background: var(--grad-brand); border-color: transparent; color: var(--on-brand); box-shadow: var(--shadow-brand); }
.segment input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- toggle row (icon · title + text · switch) ---------- */
.toggle-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row > .icon { width: 26px; height: 26px; color: var(--brand); }
.toggle-row strong { display: block; font-size: 15px; }
.toggle-row small { display: block; color: var(--text-2); font-size: 13px; }
.switch-lg .switch-track { width: 50px; height: 28px; }
.switch-lg .switch-track::after { width: 22px; height: 22px; }
.switch-lg input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:checked + .switch-track.is-green, .switch-green input:checked + .switch-track { background: var(--success); }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--text); }
dialog.modal::backdrop { background: color-mix(in srgb, var(--dark) 55%, transparent); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 18px; font-weight: 800; }
.modal-body { padding: 20px; }

/* ---------- description list ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.kv .kv-total { font-size: 17px; font-weight: 800; color: var(--brand); }

/* ---------- page header (panels) ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 26px; font-weight: 800; color: var(--text); }
.page-sub { color: var(--text-2); margin-top: 4px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 160px; flex: 1 1 160px; }

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* ---------- drawer (mobile menu) ---------- */
.drawer-backdrop { display: none; }
.site-drawer { display: none; }

/* ---------- star rating (components/stars) ---------- */
.stars-row { display: inline-flex; align-items: center; gap: 2px; color: var(--c-gold); }
.stars-row .icon { width: 18px; height: 18px; }
.stars-row .star-on { fill: currentColor; }
.stars-row .star-off { color: var(--border-strong); }

.review-reply { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--brand-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--brand-soft); font-size: 13px; }
.review-reply p { margin-top: 2px; color: var(--text-2); }

/* =====================================================================
   Responsive
   ===================================================================== */
.show-mobile, .show-mobile-block { display: none; }
.show-mobile-sm { display: none !important; }

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main-side { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Header: compact in steps so the menu never runs into the logo. */
@media (max-width: 1380px) {
    .site-header-inner { gap: 14px; }
    .main-nav { gap: 2px; }
    .main-nav a { padding: 8px 11px; }
    .header-user-name { display: none; }
}
@media (max-width: 1180px) {
    .header-search { display: none; }
    .header-book-text { display: none; }
    .header-book { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 1080px) {
    .main-nav { display: none; }
    .menu-toggle { display: inline-grid; }
    .site-header-inner > .header-actions { margin-left: auto; }
    /* Front-site drawer only; the admin sidebar becomes a drawer at 900px. */
    .site-drawer {
        display: block; position: fixed; inset: 0 0 0 auto; z-index: 90; width: min(300px, 86vw); background: var(--surface);
        transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility 0s .25s; overflow-y: auto; padding: 18px; box-shadow: var(--shadow-lg);
    }
    .drawer-open .site-drawer { transform: none; visibility: visible; transition: transform .25s; }
    .site-drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--dark) 50%, transparent); }
    .drawer-open .site-drawer-backdrop { display: block; }
    .site-drawer .drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px; font-weight: 500; }
    .site-drawer .drawer-nav a.is-active { background: var(--brand-soft); color: var(--brand); }
}

@media (max-width: 900px) {
    :root { --header-h: 64px; }
    .hide-mobile { display: none !important; }
    .show-mobile { display: revert; }
    .logo.show-mobile, .flex.show-mobile { display: flex; }
    .show-mobile-block { display: flex; }
    .main-nav, .header-actions .hide-tablet { display: none; }
    .menu-toggle { display: inline-grid; }
    .site-header-inner > .header-actions { margin-left: auto; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logo-name { font-size: 21px; }
    .logo-mark { width: 42px; height: 32px; }
    .logo-tagline { font-size: 11px; }
    .page-title { font-size: 23px; }

    /* drawer */
    .site-drawer { display: block; }
    .drawer {
        position: fixed; inset: 0 0 0 auto; z-index: 90; width: min(300px, 86vw); background: var(--surface);
        transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility 0s .25s; overflow-y: auto; padding: 18px; box-shadow: var(--shadow-lg);
    }
    .drawer-open .drawer { transform: none; visibility: visible; transition: transform .25s; }
    .drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--dark) 50%, transparent); }
    .drawer-open .drawer-backdrop { display: block; }
    .drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px; font-weight: 500; }
    .drawer-nav a.is-active { background: var(--brand-soft); color: var(--brand); }

    /* bottom navigation */
    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom);
        background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px color-mix(in srgb, var(--brand-deep) 6%, transparent);
    }
    .bottom-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--text-2); border-radius: 12px; }
    .bottom-link .icon { width: 23px; height: 23px; }
    .bottom-link.is-active { color: var(--brand); font-weight: 600; }
    .bottom-link.is-active .icon { fill: color-mix(in srgb, var(--brand) 85%, transparent); }
    .bottom-nav-pill .bottom-link.is-active { background: var(--grad-brand); color: var(--on-brand); }
    .bottom-nav-pill .bottom-link.is-active .icon { fill: none; }
    .has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + 24px); }
}

@media (max-width: 640px) {
    body { font-size: 14px; }
    .container { padding: 0 14px; }
    .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .quick-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .quick-grid-4 .quick-tile { min-height: 78px; font-size: 12px; padding: 10px 4px; gap: 6px; }
    .quick-grid-4 .quick-tile .icon { width: 26px; height: 26px; }
    .card-body { padding: 16px; }
    .card-head { padding: 16px 16px 0; }
    .card-title { font-size: 17px; }
    .stat-card { padding: 14px; gap: 12px; }
    .stat-card .tile-icon { width: 42px; height: 42px; }
    .stat-card .tile-icon .icon { width: 22px; height: 22px; }
    .stat-value { font-size: 19px; }
    .stat-label { font-size: 13px; }
    .footer-grid { grid-template-columns: 1fr; padding-top: 34px; }
    .hide-sm { display: none !important; }
    .show-mobile-sm { display: block !important; }
    span.show-mobile-sm, strong.show-mobile-sm { display: inline !important; }
    a.show-mobile-sm.btn { display: flex !important; }
}

@media print {
    .site-header, .site-footer, .bottom-nav, .no-print, .panel-sidebar, .admin-sidebar, .admin-topbar { display: none !important; }
    body { background: var(--white); }
}

/* User / admin panel footer */
.panel-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.panel-footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.panel-footer-links a { color: var(--text-2); font-weight: 600; }
.panel-footer-links a:hover { color: var(--brand); }
.panel-footer-version { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
@media (max-width: 640px) {
    .panel-footer { flex-direction: column; justify-content: center; text-align: center; margin-top: 20px; }
    .panel-footer-links { justify-content: center; }
}
.footer-pages a:hover { color: var(--on-brand); }
