/* ScanServe — admin panel styles. No build step: edit this file directly. */

:root {
    --bg: #f6f3ef;
    --surface: #ffffff;
    --surface-2: #faf7f3;
    --border: #ebe4dc;
    --border-strong: #dcd2c6;
    --text: #1d1713;
    --text-2: #40362f;
    --muted: #7d7167;
    --primary: #e8590c;
    --primary-700: #c2410c;
    --primary-50: #fff3ea;
    --primary-100: #fde0cb;
    --green: #15803d;
    --green-50: #eaf7ef;
    --amber: #b45309;
    --amber-50: #fdf4e3;
    --red: #b91c1c;
    --red-50: #fdecec;
    --blue: #1d4ed8;
    --blue-50: #eaf0fe;
    --violet: #6d28d9;
    --violet-50: #f2ecfe;
    --sidebar-bg: #1d1713;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(45, 30, 18, .05), 0 4px 14px rgba(45, 30, 18, .04);
    --shadow-lg: 0 12px 32px rgba(45, 30, 18, .16);
    --sidebar: 252px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Arabic", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
img { max-width: 100%; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--text-2); }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-small { width: 14px; height: 14px; }
.icon-xl { width: 40px; height: 40px; stroke-width: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.text-amber { color: var(--amber); }
.empty { color: var(--muted); padding: 22px 4px; text-align: center; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.eyebrow a { color: var(--muted); }
.alt-name { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; align-self: flex-start; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column;
    background: var(--sidebar-bg); color: #d8cdc3; padding: 20px 14px; z-index: 30;
    background-image: radial-gradient(420px 260px at 0% 0%, rgba(232, 89, 12, .16), transparent 70%);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(140deg, #fb923c, #e8590c 55%, #c2410c); color: #fff; flex: none; box-shadow: 0 6px 16px rgba(232, 89, 12, .35); }
.brand-mark .icon { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: #fff; font-size: 16px; letter-spacing: -.01em; }
.brand-text small { color: #a8998c; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-heading { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8a7b6e; margin: 18px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: #cfc3b8; font-weight: 500; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.is-active { background: rgba(251, 146, 60, .15); color: #fff; box-shadow: inset 3px 0 0 #fb923c; }
.nav-link.is-active .icon { color: #fdba74; }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #e8590c; color: #fff; font-size: 12px; display: grid; place-items: center; }
.nav-live { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 12px; border: 1px dashed rgba(255, 255, 255, .18); color: #e7ddd4; margin-top: 12px; }
.nav-live:hover { background: rgba(255, 255, 255, .05); text-decoration: none; color: #fff; }
.nav-live span { display: flex; flex-direction: column; line-height: 1.25; }
.nav-live small { color: #a8998c; font-size: 12px; }
.nav-live-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: #fff; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
    height: 64px; padding: 0 28px; background: rgba(246, 243, 239, .86); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-date { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar .sidebar-toggle { display: none; }
.content { padding: 26px 28px 48px; max-width: 1660px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-open { color: var(--green); background: var(--green-50); }
.status-open i { box-shadow: 0 0 0 3px rgba(21, 128, 61, .18); animation: pulse 2s infinite; }
.status-paused { color: var(--amber); background: var(--amber-50); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(21, 128, 61, 0); } }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 12px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13.5px; }
.user-meta small { color: var(--muted); font-size: 12px; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.user-menu-panel a, .user-menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: linear-gradient(140deg, #fb923c, #c2410c); color: #fff; font-weight: 700; font-size: 14px; }
.avatar-soft { background: var(--primary-50); color: var(--primary-700); width: 32px; height: 32px; font-size: 13px; }

/* ---------- Buttons ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.button:hover { text-decoration: none; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(194, 65, 12, .3); }
.button-primary:hover { background: var(--primary-700); }
.button-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.button-ghost:hover { border-color: var(--primary); color: var(--primary-700); }
.button-danger-ghost { background: transparent; color: var(--red); border-color: #f2c9c9; }
.button-danger-ghost:hover { background: var(--red-50); }
.button-small { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.button-block { width: 100%; }
.button-count { background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 20px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 18px; line-height: 1; flex: none; }
.icon-button:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.icon-button-muted { border-color: transparent; background: transparent; color: var(--muted); }
.icon-button-muted:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.link { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Page structure ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card > h2 { margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title .icon { color: var(--primary); }
.card-head .section-title { margin-bottom: 0; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.group-title:first-of-type { margin-top: 6px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dash-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; align-items: stretch; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.detail-side, .side-stack { display: flex; flex-direction: column; gap: 20px; }
.side-form { position: sticky; top: 84px; }
.side-stack .side-form { position: static; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.settings-main, .settings-side { display: flex; flex-direction: column; gap: 20px; }
.settings-side { position: sticky; top: 84px; }

/* ---------- Alerts, tags, pills ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 11px; font-weight: 500; border: 1px solid; }
.alert-success { background: var(--green-50); color: #14532d; border-color: #c6ebd2; }
.alert-error { background: var(--red-50); color: #7f1d1d; border-color: #f5c9c9; }
.alert-info { background: var(--blue-50); color: #1e3a8a; border-color: #d3defb; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tag-popular { background: var(--amber-50); color: var(--amber); border-color: #f6dfbd; }
.tag-new { background: var(--blue-50); color: var(--blue); border-color: #d3defb; }
.tag-spicy { background: var(--red-50); color: var(--red); border-color: #f5c9c9; }
.tag-veg { background: var(--green-50); color: var(--green); border-color: #c6ebd2; }
.tag-chef { background: var(--violet-50); color: var(--violet); border-color: #e2d6fb; }
.role-admin { background: var(--text); color: #fff; border-color: var(--text); }
.role-staff { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-100); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill-ok { background: var(--green-50); color: var(--green); }
.pill-info { background: var(--blue-50); color: var(--blue); }
.badge { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; text-transform: none; letter-spacing: 0; }
.status-badge { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge-large { font-size: 13px; padding: 5px 12px; }
.badge-new { background: #fee2e2; color: #b91c1c; }
.badge-accepted { background: var(--blue-50); color: var(--blue); }
.badge-preparing { background: var(--amber-50); color: var(--amber); }
.badge-ready { background: var(--green-50); color: var(--green); }
.badge-completed { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }

/* ---------- Dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 8px; }
.tone-brand { background: var(--primary-50); color: var(--primary); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-violet { background: var(--violet-50); color: var(--violet); }
.stat-label { color: var(--muted); font-weight: 500; font-size: 13px; }
.stat-value { font-size: 27px; font-weight: 750; letter-spacing: -.02em; }
.stat-foot { color: var(--muted); font-size: 12.5px; }
.chart-card { display: flex; flex-direction: column; }
.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; height: 240px; align-items: end; padding-top: 8px; flex: 1; }
.bar-chart-14 { grid-template-columns: repeat(14, 1fr); gap: 8px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar { width: 100%; max-width: 34px; height: 4px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #fdba74, #e8590c); transition: height .6s ease; opacity: .82; }
.bar-today { opacity: 1; box-shadow: 0 0 0 3px rgba(232, 89, 12, .18); }
.bar-value { font-weight: 700; font-size: 12px; color: var(--text-2); }
.bar-label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.bar-label small { font-size: 10.5px; opacity: .8; }
.chart-legend { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(180deg, #fdba74, #e8590c); }
.live-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.live-row { display: grid; grid-template-columns: 70px 1fr auto auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.live-row.status-new { border-color: #fecaca; background: linear-gradient(90deg, #fff5f5, #fff 55%); }
.live-no { font-weight: 800; font-size: 16px; color: var(--text); }
.live-main { display: flex; flex-direction: column; min-width: 0; }
.live-main strong { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.live-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rank-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--primary-50); color: var(--primary-700); display: grid; place-items: center; font-weight: 750; font-size: 12.5px; }
.rank-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rank-main strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-value { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.inline-track { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.inline-bar { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #fdba74, #e8590c); transition: width .6s ease; }
.inline-bar-violet { background: linear-gradient(90deg, #c4b5fd, #7c3aed); }
.share-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.share-list li { display: grid; grid-template-columns: 112px 1fr 44px; gap: 10px; align-items: center; }
.share-label { font-weight: 600; display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.share-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.share-fill { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .6s ease; }
.type-dine_in { background: #e8590c; }
.type-takeaway { background: #f59e0b; }
.type-delivery { background: #3b82f6; }
.share-value { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.menu-health { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; }
.menu-health a { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 10px; background: var(--surface-2); color: var(--text); }
.menu-health a:hover { text-decoration: none; background: var(--primary-50); }
.menu-health strong { font-size: 22px; }
.menu-health span { font-size: 12px; color: var(--muted); }

/* ---------- Order board ---------- */
.live-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.live-indicator i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); animation: pulse 2s infinite; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -6px -20px 16px; padding: 0 16px; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--primary-700); border-bottom-color: var(--primary); }
.tab-count { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; color: var(--muted); }
.tab.is-active .tab-count { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-700); }
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.order-card { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 12px; background: var(--surface); position: relative; overflow: hidden; }
.order-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--border-strong); }
.order-card.status-new::before { background: #ef4444; }
.order-card.status-accepted::before { background: #3b82f6; }
.order-card.status-preparing::before { background: #f59e0b; }
.order-card.status-ready::before { background: #22c55e; }
.order-card.status-new { box-shadow: 0 0 0 3px rgba(239, 68, 68, .08); }
.order-card.status-completed, .order-card.status-cancelled { background: var(--surface-2); }
.order-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-no { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.order-type { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.order-guest { font-size: 13px; font-weight: 600; }
.order-lines { list-style: none; margin: 2px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 13.5px; }
.order-lines b { display: inline-block; min-width: 28px; color: var(--primary-700); }
.order-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; background: var(--amber-50); color: #92400e; padding: 6px 8px; border-radius: 8px; }
.order-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.order-card-foot strong { font-size: 15px; }
.order-actions { display: flex; align-items: center; gap: 6px; }
.order-actions form { display: inline; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--text); font-size: 16px; }
.stepper { list-style: none; margin: 0; padding: 14px 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stepper li { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); position: relative; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 13px; flex: none; }
.stepper li.is-done { color: var(--text); }
.stepper li.is-done .step-dot { background: var(--green); border-color: var(--green); color: #fff; }
.stepper li.is-current { color: var(--primary-700); }
.stepper li.is-current .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(232, 89, 12, .18); }
.status-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: var(--text); color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); animation: toast-in .3s ease; }
.toast-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary); }
.toast-text { display: flex; flex-direction: column; line-height: 1.3; }
.toast-text small { color: #cfc3b8; }
.toast .icon-button-muted { color: #cfc3b8; }
@keyframes toast-in { from { transform: translateY(16px); opacity: 0; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: #fcfaf7; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a { font-weight: 600; color: var(--text); }
.table a:hover { color: var(--primary-700); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .link { color: var(--primary-700); }
.row-muted td { color: var(--muted); }
.person { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- Menu items ---------- */
.item-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 80px 110px 150px 34px; gap: 14px; align-items: center; padding: 9px 12px 9px 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.item-row:hover { border-color: var(--border-strong); }
.item-row.is-hidden { background: var(--surface-2); }
.item-row.is-hidden .item-main a { color: var(--muted); }
.item-thumb { width: 56px; height: 56px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-row.is-soldout .item-thumb img { filter: grayscale(1); opacity: .6; }
.item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-main a { font-weight: 650; color: var(--text); }
.item-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.item-tags .tag { font-size: 11px; padding: 0 7px; }
.item-sold { font-size: 12.5px; color: var(--muted); text-align: right; }
.item-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.item-price s { color: var(--muted); font-size: 12px; }
.item-price strong { font-size: 15px; }
.switch-form { display: flex; justify-content: flex-end; }
.switch { display: inline-flex; align-items: center; gap: 9px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--muted); font-weight: 600; font-size: 13px; padding: 4px; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .2s; flex: none; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.is-on { color: var(--green); }
.switch.is-on .switch-track { background: #22c55e; }
.switch.is-on .switch-thumb { transform: translateX(16px); }
.switch-label { min-width: 62px; text-align: left; }
.item-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.item-form-actions { grid-column: 1 / -1; }
.photo-card { position: sticky; top: 84px; }
.photo-preview { aspect-ratio: 1; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); display: grid; place-items: center; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.badge-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-option { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-weight: 600; font-size: 13px; }
.badge-option input { accent-color: var(--primary); margin: 0; }
.fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fieldset legend { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.check-row { display: flex; gap: 24px; flex-wrap: wrap; padding-top: 4px; }

/* ---------- Tables & QR ---------- */
.general-qr { display: grid; grid-template-columns: 170px 1fr; gap: 22px; align-items: center; padding: 6px 4px 18px; border-bottom: 1px solid var(--border); }
.general-qr h2 { font-size: 19px; margin-bottom: 6px; }
.general-qr-text { display: flex; flex-direction: column; gap: 8px; }
.qr-box { width: 170px; height: 170px; border-radius: 14px; background: #fff; border: 1px solid var(--border); padding: 10px; display: grid; place-items: center; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-box-small { width: 92px; height: 92px; padding: 6px; border-radius: 10px; }
.copy-field { display: flex; gap: 8px; max-width: 520px; }
.copy-field input { height: 32px; font-size: 13px; color: var(--muted); }
.qr-downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.table-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.table-card { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.table-card.is-off { background: var(--surface-2); }
.table-card.is-off .qr-box { opacity: .35; }
.table-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.table-card-body strong { font-size: 16px; }
.table-card-actions { display: flex; gap: 6px; margin-top: 6px; position: relative; }
.table-edit summary { list-style: none; }
.table-edit summary::-webkit-details-marker { display: none; }
.table-edit-panel { position: absolute; right: 0; top: calc(100% + 6px); width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px; z-index: 10; display: flex; flex-direction: column; gap: 8px; }
.how-it-works ol { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Forms ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar-wrap { flex-wrap: wrap; }
.search { flex: 1; min-width: 220px; position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input[type="search"] { padding-left: 38px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.inline-field input { width: 160px; }
.select-auto { width: auto; min-width: 200px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], select, textarea {
    width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
    font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 64px; }
input[type="file"] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232, 89, 12, .14); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field em { color: var(--red); font-style: normal; }
.field-small { max-width: 120px; }
.field-error { color: var(--red); font-size: 12.5px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nested-grid { gap: 12px; }
.span-2 { grid-column: span 2; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-card { display: flex; flex-direction: column; gap: 18px; }
.form-narrow { max-width: 720px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.form-actions-split { justify-content: space-between; align-items: center; }
.form-actions-right { display: flex; gap: 10px; }
.form-subhead { font-weight: 700; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.check-small { font-size: 12.5px; }
.check-small input { width: 14px; height: 14px; }
.switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface-2); }
.toggle input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none; margin-top: 1px; transition: background .2s; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle input:checked + .toggle-ui { background: #22c55e; }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-ui { box-shadow: 0 0 0 3px rgba(232, 89, 12, .25); }
.toggle-text { display: flex; flex-direction: column; line-height: 1.35; }
.toggle-text small { color: var(--muted); font-size: 12.5px; }
.theme-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.theme-option { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.swatch { width: 40px; height: 40px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.theme-option input:checked + .swatch { box-shadow: 0 0 0 2px var(--text); }
.theme-option input:focus-visible + .swatch { box-shadow: 0 0 0 3px rgba(232, 89, 12, .45); }
.theme-option small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.theme-swatch-saffron .swatch { background: linear-gradient(135deg, #fb923c, #c2410c); }
.theme-swatch-emerald .swatch { background: linear-gradient(135deg, #34d399, #047857); }
.theme-swatch-crimson .swatch { background: linear-gradient(135deg, #fb7185, #be123c); }
.theme-swatch-indigo .swatch { background: linear-gradient(135deg, #818cf8, #4338ca); }
.theme-swatch-teal .swatch { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.theme-swatch-charcoal .swatch { background: linear-gradient(135deg, #78716c, #1c1917); }
.upload-row { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: start; }
.upload-preview { width: 88px; height: 88px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-cover { height: 56px; margin-top: 22px; }

/* ---------- Detail views ---------- */
.details { margin: 0 0 14px; display: flex; flex-direction: column; }
.details div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; text-align: right; }
.bill { margin: 14px 0 0; max-width: 360px; margin-left: auto; }
.bill div { display: flex; justify-content: space-between; padding: 7px 0; }
.bill dt { color: var(--muted); }
.bill dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px !important; }
.bill-total dd { font-size: 19px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; margin-top: 16px; }
.callout-warn { background: var(--amber-50); color: #78350f; }

/* ---------- Users ---------- */
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.role-grid-2 { grid-template-columns: repeat(2, 1fr); }
.role-grid p { margin-top: 8px; color: var(--text-2); }

/* ---------- Pagination & misc ---------- */
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.pagination-info { color: var(--muted); font-size: 13px; }
.pagination-links { display: flex; gap: 8px; }
.error-page { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.error-code { font-size: 64px; font-weight: 800; color: var(--primary); line-height: 1; }
.minimal-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 520px) 1fr; }
.auth-panel { background: var(--surface); padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-panel .brand { color: var(--text); padding: 0 0 18px; }
.auth-panel .brand-text strong { color: var(--text); font-size: 20px; }
.auth-panel .brand-text small { color: var(--muted); }
.brand-large .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
.auth-title { font-size: 28px; }
.auth-aside { background: radial-gradient(900px 520px at 85% 0%, rgba(251, 146, 60, .55) 0%, transparent 60%), linear-gradient(155deg, #c2410c, #3b1d0e 62%, #1d1713); color: #fbeee4; display: flex; align-items: center; padding: 64px; }
.auth-aside-inner { max-width: 540px; display: flex; flex-direction: column; gap: 22px; }
.auth-aside .eyebrow { color: #fed7aa; }
.auth-aside h2 { font-size: 38px; font-weight: 750; line-height: 1.15; color: #fff; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 16px; }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fdba74; }
.auth-receipt { margin-top: 8px; max-width: 360px; background: #fffaf5; color: var(--text); border-radius: 16px; padding: 16px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); transform: rotate(-2deg); }
.auth-receipt p, .auth-receipt-foot { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.auth-receipt-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--border-strong); }
.auth-receipt-foot { border-top: 1px dashed var(--border-strong); margin-top: 6px; padding-top: 10px; font-weight: 700; }
.demo-box { border: 1px dashed var(--primary-100); background: var(--primary-50); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.demo-title { font-weight: 700; color: var(--primary-700); }
.demo-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-role { min-width: 0; border: 1px solid var(--primary-100); background: var(--surface); border-radius: 10px; padding: 10px; cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 2px; text-align: left; }
.demo-role:hover { border-color: var(--primary); }
.demo-role small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.checklist .ok { color: var(--green); }
.checklist .fail { color: var(--red); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .item-row { grid-template-columns: 56px minmax(0, 1fr) 100px 140px 34px; }
    .item-sold { display: none; }
}
@media (max-width: 1100px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { position: fixed; inset: 0; background: rgba(29, 23, 19, .45); z-index: 25; }
    .main { margin-left: 0; }
    .topbar .sidebar-toggle { display: inline-grid; }
    .dash-layout, .split-layout, .detail-layout, .settings-layout, .item-form { grid-template-columns: 1fr; }
    .side-form, .settings-side, .photo-card { position: static; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}
@media (max-width: 720px) {
    .topbar { padding: 0 16px; }
    .topbar-date, .user-meta, .status-dot { display: none; }
    .content { padding: 18px 16px 40px; }
    .stat-grid, .grid-3, .form-grid, .form-grid-2, .switch-grid, .role-grid, .form-row { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .stepper { grid-template-columns: 1fr; }
    .general-qr { grid-template-columns: 1fr; }
    .item-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
    .item-thumb { width: 48px; height: 48px; }
    .item-price { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 8px; }
    .switch-form { grid-column: 2 / 4; justify-content: flex-start; }
    .live-row { grid-template-columns: 60px 1fr; }
    .live-time, .live-row .status-badge { grid-column: 2; justify-self: start; }
    .bar-chart-14 { gap: 3px; }
    .bar-value { font-size: 10px; }
    .theme-picker { grid-template-columns: repeat(3, 1fr); }
    .auth-panel { padding: 32px 20px; }
    .toast { left: 16px; right: 16px; bottom: 16px; }
}
