@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --gold: #e3a81f;
  --gold-bright: #f2bd3a;
  --gold-deep: #a8740a;
  --gold-soft: #fff3d1;
  --ink: #1b1a17;
  --muted: #8a857a;
  --line: #ece8de;
  --bg: #f6f5f1;
  --card: #fff;
  --red: #c8412f;
  --red-soft: #fdeae6;
  --green: #2f8f5b;
  --green-soft: #e3f4ea;
  --blue: #3b6fd1;
  --blue-soft: #e6eefc;
  --orange: #d9741a;
  --orange-soft: #fdeedd;
  --violet: #7a58c9;
  --violet-soft: #efe9fb;
  --teal: #1b8f93;
  --teal-soft: #dff3f3;
  --shadow: 0 6px 20px rgba(40, 32, 10, .07);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--bg); font-size: 14px; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
.ui-icon { width: 1em; height: 1em; flex: none; vertical-align: -.15em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn, .btn-gold, .btn-dark, .btn-danger { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); font-size: 13px; font-weight: 700; transition: filter .15s, background .15s; white-space: nowrap; }
.btn:hover { background: #faf8f2; }
.btn-gold { border-color: var(--gold); color: #1b1405; background: var(--gold); box-shadow: 0 5px 14px rgba(227, 168, 31, .28); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-dark { border-color: #1b1405; color: #fff; background: #1b1405; }
.btn-danger { border-color: var(--red); color: #fff; background: var(--red); }
.btn-ghost-danger { color: var(--red); }
.btn-sm { min-height: 32px; padding: 0 11px; border-radius: 10px; font-size: 12px; }
.btn:disabled, .btn-gold:disabled, .btn-dark:disabled, .btn-danger:disabled { opacity: .45; box-shadow: none; filter: none; }
.btn.full, .btn-gold.full { width: 100%; }
.icon-button { position: relative; display: grid; width: 40px; height: 40px; flex: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); font-size: 19px; }
.icon-button .dot { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid #fff; border-radius: 9px; color: #1b1405; background: var(--gold); font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; }
.link-btn { padding: 0; border: 0; color: var(--gold-deep); background: none; font-size: 12px; font-weight: 700; }

/* ---------- Login ---------- */
.login-view { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: radial-gradient(900px 420px at 80% -10%, var(--gold-soft), transparent), var(--bg); }
.login-card { width: min(100%, 420px); padding: 32px 28px 26px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.login-logo { display: block; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; background: #0c0b09; object-fit: cover; }
.login-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; text-align: center; }
.login-card .sub { margin: 4px 0 20px; color: var(--muted); font-size: 13px; text-align: center; }
.login-note { display: flex; gap: 8px; margin-top: 18px; padding: 11px 12px; border-radius: 12px; color: #6e5410; background: var(--gold-soft); font-size: 12px; line-height: 1.45; }
.alert-inline { display: flex; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; color: var(--red); background: var(--red-soft); font-size: 13px; font-weight: 600; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.shell-main { min-width: 0; }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; gap: 6px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--card); overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; }
.sb-brand img { width: 42px; height: 42px; border-radius: 50%; background: #0c0b09; object-fit: cover; }
.sb-brand strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.2px; }
.sb-brand span { color: var(--muted); font-size: 11px; }
.sb-close { display: none; margin-left: auto; }
.nav-group { margin: 12px 10px 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border-radius: 12px; color: #4b473e; font-size: 14px; font-weight: 600; }
.nav-item .ui-icon { font-size: 19px; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { color: #1b1405; background: var(--gold-soft); font-weight: 800; }
.nav-item.active .ui-icon { color: var(--gold-deep); }
.nav-item.locked { opacity: .5; }
.nav-badge { min-width: 20px; margin-left: auto; padding: 1px 7px; border-radius: 10px; color: #1b1405; background: var(--gold); font-size: 11px; font-weight: 800; text-align: center; }
.sb-foot { margin-top: auto; padding: 12px 10px 0; color: var(--muted); font-size: 11px; }
.scrim { position: fixed; z-index: 40; inset: 0; background: rgba(27, 20, 5, .4); }

.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: 14px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: rgba(246, 245, 241, .92); backdrop-filter: blur(12px); }
.nav-toggle { display: none; }
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; }
.search-box { display: flex; flex: 1; max-width: 420px; align-items: center; gap: 9px; height: 42px; margin-left: auto; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--card); font-size: 17px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-box:focus-within { border-color: var(--gold); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.branch-switch-wrap { display: grid; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.branch-switch-wrap select { max-width: 190px; height: 36px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 12px; font-weight: 700; }
.pop-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 12px 0 5px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); text-align: left; }
.avatar { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 50%; color: #1b1405; background: var(--gold-bright); font-size: 12px; font-weight: 800; }
.user-chip .who { display: grid; line-height: 1.15; }
.user-chip .who b { max-width: 120px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { color: var(--muted); font-size: 10px; }
.popover { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: 300px; max-width: calc(100vw - 24px); padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 14px 40px rgba(40, 32, 10, .16); }
.pop-item { display: flex; width: 100%; align-items: flex-start; gap: 10px; padding: 10px; border: 0; border-radius: 10px; background: none; font-size: 13px; text-align: left; }
.pop-item:hover { background: var(--bg); }
.pop-title { padding: 8px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.notice-bar .notice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 28px; color: #fff; background: var(--red); font-size: 13px; font-weight: 700; }

.view { max-width: 1336px; margin: 0 auto; padding: 24px 28px 60px; outline: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h2 { font-size: 18px; font-weight: 800; }
.page-head p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Cards & grids ---------- */
.card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 2px 10px rgba(40, 32, 10, .03); }
.card + .card { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; font-weight: 800; }
.card-head small { color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: grid; gap: 4px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--gold-deep); background: var(--gold-soft); font-size: 19px; }
.kpi-value { margin-top: 4px; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.kpi-value small { font-size: 13px; font-weight: 700; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--muted); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.pill.gold { color: var(--gold-deep); background: var(--gold-soft); }
.pill.blue { color: var(--blue); background: var(--blue-soft); }
.pill.orange { color: var(--orange); background: var(--orange-soft); }
.pill.violet { color: var(--violet); background: var(--violet-soft); }
.pill.teal { color: var(--teal); background: var(--teal-soft); }
.pill.green { color: var(--green); background: var(--green-soft); }
.pill.red { color: var(--red); background: var(--red-soft); }
.pill.grey { color: #6b675d; background: #eeece5; }
.role-badge { display: inline-block; padding: 2px 9px; border-radius: 8px; color: #1b1405; background: var(--gold-bright); font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.role-badge.manager { background: var(--blue-soft); color: var(--blue); }
.role-badge.cashier, .role-badge.chef, .role-badge.waiter { background: #eeece5; color: #6b675d; }
.role-badge.owner { background: #eee8ff; color: #6b4bb5; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field > label, .field > .label { font-size: 12px; font-weight: 700; color: #4b473e; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=tel], .field input[type=url], .field input[type=date], .field input[type=time], .field select, .field textarea, .input, .select { width: 100%; min-height: 42px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .select:focus, .input:focus { border-color: var(--gold); outline: 0; box-shadow: 0 0 0 3px rgba(227, 168, 31, .18); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12px; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.repeat-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 36px; gap: 8px; margin-bottom: 8px; }
.repeat-row .icon-button { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.list li.btn-li { padding: 2px 0; }
.list li.btn-li .pop-item { align-items: center; }
.product-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-img img[data-fallback] { padding: 28px; background: #0c0b09; object-fit: contain; }
.thumb[data-fallback] { background: #0c0b09; }
.repeat-row .input { min-height: 38px; }
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: #d8d4c8; transition: background .15s; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); content: ""; transition: transform .15s; }
.switch input:checked + span { background: var(--gold); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .5; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { display: block; font-size: 14px; }
.setting-row span.hint { display: block; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .search-box { flex: 1 1 220px; max-width: 360px; margin: 0; height: 40px; }
.toolbar .select { width: auto; min-height: 40px; padding-right: 30px; }
.chips { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 20px; color: #4b473e; background: var(--card); font-size: 12px; font-weight: 600; }
.chip.active { border-color: var(--gold); color: #1b1405; background: var(--gold-soft); font-weight: 800; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.table-wrap.plain { border: 0; border-radius: 0; background: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .4px; text-align: left; text-transform: uppercase; white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: #fcfbf7; }
.tbl .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tbl .right, .tbl th.right { text-align: right; }
.cell-main { display: grid; gap: 1px; min-width: 0; }
.cell-main b { font-weight: 700; }
.cell-main small { color: var(--muted); font-size: 12px; }
.thumb { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--gold-soft) center / cover; object-fit: cover; }
.cell-with-thumb { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; color: var(--muted); font-size: 12px; }
.pager .btn { min-height: 34px; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 44px 16px; color: var(--muted); text-align: center; }
.empty .ui-icon { font-size: 34px; color: #cfc9b8; }
.empty b { color: var(--ink); }

/* ---------- Dashboard widgets ---------- */
.chart { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--gold-bright); }
.chart .bar.today { fill: var(--gold-deep); }
.chart .grid-line { stroke: var(--line); }
.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.donut { width: 150px; height: 150px; flex: none; }
.legend { display: grid; flex: 1; gap: 7px; min-width: 140px; font-size: 12px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; }
.rank { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rank li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.rank .n { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; color: var(--gold-deep); background: var(--gold-soft); font-size: 12px; font-weight: 800; }
.rank .bar-track { height: 6px; margin-top: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.rank .bar-fill { height: 100%; border-radius: 3px; background: var(--gold); }
.list { display: grid; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li:first-child { padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b, .list .grow small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .grow small { color: var(--muted); font-size: 12px; }
.alert-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; font-size: 13px; font-weight: 600; text-align: left; }
.alert-item + .alert-item { margin-top: 8px; }
.alert-item.red { color: var(--red); background: var(--red-soft); }
.alert-item.gold { color: var(--gold-deep); background: var(--gold-soft); }
.alert-item.orange { color: var(--orange); background: var(--orange-soft); }
.alert-item.blue { color: var(--blue); background: var(--blue-soft); }
.alert-item .ui-icon { font-size: 18px; }
.log-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-item:last-child { border-bottom: 0; }
.log-item time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Menu grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.product-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.product-card.off { opacity: .8; }
.product-img { position: relative; height: 140px; background: var(--gold-soft) center / cover; }
.product-img .pill { position: absolute; top: 10px; left: 10px; background: #fff; }
.product-img .disc { position: absolute; top: 10px; right: 10px; padding: 3px 8px; border-radius: 8px; color: #1b1405; background: var(--gold-bright); font-size: 11px; font-weight: 800; }
.product-body { display: grid; flex: 1; gap: 6px; padding: 14px; }
.product-body h4 { font-size: 15px; font-weight: 800; }
.product-body p { color: var(--muted); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 14px; }
.price { font-size: 16px; font-weight: 800; }
.price s { margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.view-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.view-toggle button { display: grid; width: 34px; height: 32px; place-items: center; border: 0; border-radius: 9px; background: none; font-size: 17px; }
.view-toggle button.active { background: var(--gold-soft); color: var(--gold-deep); }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }

/* ---------- Zones, couriers ---------- */
.zone-card.disabled { opacity: .7; }
.zone-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.zone-head h3 { font-size: 16px; font-weight: 800; }
.stat-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.stat-line:last-child { border-bottom: 0; }
.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix th { color: var(--muted); font-size: 11px; font-weight: 700; }
.matrix .yes { color: var(--green); font-weight: 800; }
.matrix .no { color: #cfc9b8; }
.matrix-wrap { overflow-x: auto; }

/* ---------- Drawer & modal ---------- */
.drawer-overlay { position: fixed; z-index: 60; inset: 0; display: flex; justify-content: flex-end; background: rgba(27, 20, 5, .42); animation: fade .15s; }
.drawer { display: flex; width: min(100%, 540px); height: 100%; flex-direction: column; background: var(--bg); box-shadow: -14px 0 40px rgba(40, 32, 10, .2); animation: slide .2s ease-out; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.drawer-head h2 { font-size: 17px; font-weight: 800; }
.drawer-head small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.drawer-body { flex: 1; padding: 18px 20px; overflow-y: auto; }
.drawer-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--card); }
.drawer-body .card { margin-bottom: 14px; padding: 15px; }
.modal-overlay { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(27, 20, 5, .5); animation: fade .15s; }
.modal { width: min(100%, 440px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; border-radius: 20px; background: var(--card); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.modal h2 { margin-bottom: 6px; font-size: 18px; font-weight: 800; }
.modal .msg { margin-bottom: 16px; color: #4b473e; font-size: 14px; line-height: 1.5; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pin-box { margin: 12px 0; padding: 16px; border-radius: 14px; color: #1b1405; background: var(--gold-soft); font-size: 32px; font-weight: 800; letter-spacing: 8px; text-align: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .6; } }

.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 0 0 14px 22px; font-size: 13px; }
.timeline li::before { position: absolute; top: 4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); content: ""; }
.timeline li::after { position: absolute; top: 16px; bottom: -2px; left: 4px; width: 2px; background: var(--line); content: ""; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.cancel::before { background: var(--red); }
.timeline time { color: var(--muted); font-size: 12px; }
.item-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.item-line:last-child { border-bottom: 0; }
.item-line small { display: block; color: var(--muted); font-size: 12px; }
.total-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.total-line.big { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 16px; font-weight: 800; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; color: #fff; background: #1b1405; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: 13px; font-weight: 600; pointer-events: auto; animation: slide .2s ease-out; }
.toast.error { background: var(--red); }
.toast .ui-icon { color: var(--gold-bright); font-size: 18px; flex: none; }
.toast.error .ui-icon { color: #fff; }

.print-area { display: none; }
.receipt-preview { padding: 6px; border: 1px dashed var(--line); border-radius: 14px; background: #ecebe7; max-height: 62vh; overflow-y: auto; }
.modal.wide { width: min(100%, 860px); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(290px, 86vw); height: 100%; transform: translateX(-102%); transition: transform .2s ease-out; box-shadow: 14px 0 40px rgba(40, 32, 10, .2); }
  .sidebar.open { transform: none; }
  .sb-close { display: grid; }
  .nav-toggle { display: grid; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .page-title { flex: 1; overflow: hidden; font-size: 17px; text-overflow: ellipsis; }
  .search-box { order: 5; flex: 1 1 100%; max-width: none; margin: 0; }
  .view { padding: 18px 16px 50px; }
  .notice-bar .notice { padding: 10px 16px; }
  .user-chip .who { display: none; }
  .user-chip { padding: 0 5px; }
}

@media (max-width: 700px) {
  .grid-even, .grid-3, .row3 { grid-template-columns: minmax(0, 1fr); }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap:has(.stack) { border: 0; background: none; overflow: visible; }
  .tbl.stack tr { margin-bottom: 12px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
  .tbl.stack td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); text-align: right; }
  .tbl.stack td:last-child { border-bottom: 0; }
  .tbl.stack td::before { flex: none; color: var(--muted); content: attr(data-label); font-size: 11px; font-weight: 700; text-align: left; text-transform: uppercase; }
  .tbl.stack td[data-label=""]::before { display: none; }
  .tbl.stack td.cell-first { display: block; text-align: left; }
  .tbl.stack td.cell-first::before { display: none; }
  .tbl.stack .actions { justify-content: flex-end; }
  .tbl.stack td .cell-main { text-align: right; }
  .tbl.stack td.cell-first .cell-main { text-align: left; }
  .toolbar .search-box { max-width: none; }
  .toolbar .select { flex: 1 1 140px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .drawer { width: 100%; }
  .toasts { right: 12px; bottom: 12px; }
}

@media (max-width: 480px) {
  .grid-kpi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi-value { font-size: 20px; }
  .kpi .kpi-icon { display: none; }
  .card { padding: 14px; }
  .login-card { padding: 26px 18px 20px; }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  body > *:not(#print-area) { display: none !important; }
  .print-area { display: block !important; }
  body { background: #fff; }
}


/* ===== Partner theme (shared look with GKCuisine) ===== */
:root { --bg: #f2f2f0; --line: #e4e4e0; --shadow: 0 1px 3px rgba(0,0,0,.08); --dark: #1c1c1a; --ready: #1f9d57; --new: #f5a300; --prep: #2f6fed; }
.sidebar { background: var(--dark); color: #fff; border-right: 0; }
.sb-brand strong { color: #fff; }
.sb-brand span, .nav-group, .sb-foot { color: #9a9a94; }
.nav-item { color: #d6d6d0; border-radius: 999px; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: #fff; color: var(--dark); }
.nav-item.active .ui-icon { color: var(--dark); }
.topbar { background: #fff; border-bottom: 0; box-shadow: var(--shadow); }
.page-title { font-size: 22px; }
.card { border: 0; border-radius: 16px; box-shadow: var(--shadow); }
.page-head h2 { font-size: 24px; }
.btn, .btn-gold, .btn-dark, .btn-danger { min-height: 44px; border-radius: 14px; }
.btn { border-width: 2px; }
.btn-gold { background: var(--ready); border-color: var(--ready); color: #fff; box-shadow: none; }
.btn-dark { background: var(--dark); border-color: var(--dark); }
.btn-sm { min-height: 34px; }
.kpi { border-left: 5px solid var(--new); background: var(--card); }
.kpi-icon { background: #f0f0ec; color: var(--dark); }
.kpi-value { font-size: 28px; }
.chips .chip, .chip { border-radius: 999px; }
.user-chip { border-radius: 999px; }
.avatar { background: var(--dark); color: var(--gold); }
.login-view { background: var(--dark); }
.login-card { border-radius: 22px; }
.login-logo { box-shadow: none; }

.live-slot { height: calc(100vh - 210px); min-height: 420px; }
