/* ==========================================================================
   EvalPOS — design system
   Dark surfaces + lime accent. Plus Jakarta Sans for display & numbers,
   Inter for UI text. Both bundled locally so the app works offline.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("../fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #0b0c0c;
  --sidebar: #111312;
  --surface: #161918;
  --surface-2: #1d201f;
  --surface-3: #252927;
  --line: #262a28;
  --line-2: #323735;
  --text: #f3f5f2;
  --text-2: #b0b7b1;
  --muted: #737b75;
  --accent: #b4f461;
  --accent-hover: #c4f97e;
  --accent-ink: #10200a;
  --accent-soft: rgba(180, 244, 97, .10);
  --accent-line: rgba(180, 244, 97, .28);
  --primary: #b4f461;
  --primary-hover: #c4f97e;
  --primary-ink: #10200a;
  --primary-glow: 0 6px 18px rgba(180, 244, 97, .18);
  --green: #8fdc5a;
  --green-2: #4caf50;
  --green-3: #2e6b2f;
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, .11);
  --amber: #f5c451;
  --amber-soft: rgba(245, 196, 81, .11);
  --blue: #7cc4ff;
  --blue-soft: rgba(124, 196, 255, .11);
  --violet: #b59cff;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 64px rgba(0, 0, 0, .45);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 1px 2px rgba(0, 0, 0, .3);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Jakarta", "Inter", system-ui, sans-serif;
  --sidebar-w: 252px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  /* Warm, low-glare paper tones; brand green carries the contrast. */
  --bg: #f1f2ec;
  --sidebar: #f8f8f4;
  --surface: #fcfcf9;
  --surface-2: #f3f4ee;
  --surface-3: #e7e9e1;
  --line: #e2e4dc;
  --line-2: #d2d6cb;
  --text: #182018;
  --text-2: #465047;
  --muted: #687168;
  --accent: #7fc63a;
  --accent-hover: #6fb52c;
  --accent-ink: #14260c;
  --accent-soft: rgba(110, 175, 40, .13);
  --accent-line: rgba(90, 150, 30, .32);
  --primary: #1f3b1c;
  --primary-hover: #2a4d26;
  --primary-ink: #d4f99c;
  --primary-glow: 0 6px 16px rgba(31, 59, 28, .18);
  --green: #2f7d16;
  --green-2: #3f9a22;
  --green-3: #b9dc94;
  --red: #c43d3d;
  --red-soft: rgba(196, 61, 61, .09);
  --amber: #9a6a05;
  --amber-soft: rgba(205, 150, 20, .13);
  --blue: #2a6fb8;
  --blue-soft: rgba(42, 111, 184, .1);
  --violet: #6b4fd0;
  --shadow: 0 18px 48px rgba(40, 52, 30, .12);
  --shadow-sm: 0 1px 2px rgba(40, 52, 30, .05), 0 0 0 1px rgba(40, 52, 30, .015);
  color-scheme: light;
}
:root[data-theme="light"] .promo {
  background: radial-gradient(120% 80% at 20% 0%, rgba(160, 230, 80, .45), transparent 55%), linear-gradient(165deg, #23431f, #142612 72%);
}
:root[data-theme="light"] .tone-0 { background: rgba(110, 175, 40, .15); color: #3d7a12; }
:root[data-theme="light"] .tone-1 { background: rgba(42, 111, 184, .12); color: #2a6fb8; }
:root[data-theme="light"] .tone-2 { background: rgba(205, 150, 20, .15); color: #8a5f04; }
:root[data-theme="light"] .tone-3 { background: rgba(107, 79, 208, .12); color: #5a40b8; }
:root[data-theme="light"] .tone-4 { background: rgba(220, 100, 60, .12); color: #b24a26; }
:root[data-theme="light"] .tone-5 { background: rgba(30, 150, 125, .12); color: #17806a; }
:root[data-theme="light"] .tone-6 { background: rgba(200, 70, 150, .11); color: #a8337e; }
:root[data-theme="light"] .tone-7 { background: rgba(70, 80, 71, .1); color: #465047; }
:root[data-theme="light"] .meter.grad > i, :root[data-theme="light"] .bar-row .fill { background: linear-gradient(90deg, #9fd46a, #4f9a22); }
:root[data-theme="light"] .net { background: rgba(110, 175, 40, .12); color: #2f7d16; border-color: rgba(90, 150, 30, .3); }
:root[data-theme="light"] .auth-art, :root[data-theme="light"] .receipt-paper { box-shadow: var(--shadow); }
:root[data-theme="light"] .toast { background: var(--surface); }
:root[data-theme="light"] .modal, :root[data-theme="light"] .palette { background: rgba(30, 40, 25, .35); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -.015em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.xs { width: 13px; height: 13px; }
svg.i.lg { width: 22px; height: 22px; }

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.up { color: var(--green); }
.down { color: var(--red); }
.warn-text { color: var(--amber); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.num, .mono { font-variant-numeric: tabular-nums; }
.display { font-family: var(--display); }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overline { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.mt-lg { margin-top: 24px; }

/* ==========================================================================
   Shell
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.app.has-aside { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 320px; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 6px 20px rgba(180, 244, 97, .25);
}
.brand-mark.brand-logo { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); overflow: hidden; padding: 3px; }
.brand-mark.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand .brand-name.ellipsis { min-width: 0; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font); font-weight: 500; font-size: 11.5px; color: var(--muted); letter-spacing: 0; margin-top: 2px; }

.branch-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin: 0 2px 6px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  position: relative;
}
.branch-card .bi { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.branch-card .bl { font-size: 11px; color: var(--muted); line-height: 1.2; }
.branch-card .bn { font-size: 13px; font-weight: 600; line-height: 1.25; }
.branch-card select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.nav-section { margin: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 10px; margin: 1px 0;
  border-radius: 10px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a svg { color: var(--muted); transition: color .12s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:hover svg { color: var(--text-2); }
.nav a.active { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.nav a.active svg { color: var(--primary-ink); }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--red); color: #fff; }
.nav a.active .count { background: var(--primary-ink); color: var(--primary); }
.nav .kbd-hint { margin-left: auto; font-size: 10.5px; color: var(--muted); }

.me {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
}
.me .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.me .role { font-size: 11.5px; color: var(--muted); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font: 700 12px/1 var(--display); color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), #57c46f);
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.avatar.c1 { background: linear-gradient(135deg, #ffd27a, #ff8a65); color: #2a1406; }
.avatar.c2 { background: linear-gradient(135deg, #8ec5ff, #7c6cff); color: #0e1430; }
.avatar.c3 { background: linear-gradient(135deg, #f7a6d8, #c06cff); color: #2a0b2a; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 64px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.crumbs b { color: var(--text); font-weight: 600; }
.crumbs svg { width: 13px; height: 13px; opacity: .6; }
.cmd-trigger {
  display: flex; align-items: center; gap: 10px;
  height: 38px; width: min(380px, 34vw); padding: 0 8px 0 12px; margin-left: 18px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 13px; cursor: pointer; text-align: left;
}
.cmd-trigger:hover { border-color: var(--line-2); color: var(--text-2); }
.cmd-trigger span { flex: 1; }
.kbd { font: 600 10.5px/1 var(--font); padding: 4px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 99px; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
.menu-btn { display: none; }
.net {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; margin-right: 6px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.net::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.net.off { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }

.content { padding: 26px 28px 48px; flex: 1; width: 100%; max-width: 1560px; }

/* Page header */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; line-height: 1.15; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.back-link:hover { color: var(--text); }

/* ==========================================================================
   Right aside (overview)
   ========================================================================== */
.aside {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 22px 20px;
  background: var(--sidebar);
  border-left: 1px solid var(--line);
}
.aside-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.aside-title h3 { font-size: 15px; }
.aside section + section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 11px; padding: 8px 0; position: relative; }
.feed .ico { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feed .ico.warn { background: var(--red-soft); color: var(--red); }
.feed .ico.amber { background: var(--amber-soft); color: var(--amber); }
.feed .ico svg { width: 15px; height: 15px; }
.feed .t { font-size: 13px; line-height: 1.4; }
.feed .s { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.feed.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 40px; bottom: -6px; width: 1px; background: var(--line-2); }
.contact { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 12px; }
.contact:hover { background: var(--surface-2); }
.contact.hl { background: var(--primary); color: var(--primary-ink); }
.contact.hl .muted { color: color-mix(in srgb, var(--primary-ink) 70%, transparent); }
.contact .acts { margin-left: auto; display: flex; gap: 4px; }
.contact .acts a { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); }
.contact .acts a:hover { background: var(--surface-3); }
.contact.hl .acts a { background: var(--primary-ink); color: var(--primary); }

/* ==========================================================================
   Layout grids & cards
   ========================================================================== */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; }
.g-form { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.card.flush { padding: 0; overflow: hidden; }
.card.pad-sm { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-height: 32px; }
.card.flush > .card-head { padding: 18px 20px 0; }
.card-head h2 { font-size: 16.5px; }
.card-head h3 { font-size: 15px; }
.card-head .desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-family: var(--font); }
.card-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.link { color: var(--accent); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

/* Stat card */
.stat { position: relative; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.stat-top { display: flex; align-items: center; gap: 10px; }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.stat-ico.lime { background: var(--accent-soft); color: var(--accent); }
.stat-ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat-ico.red { background: var(--red-soft); color: var(--red); }
.stat-ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat-value { font: 650 28px/1.1 var(--display); letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value .cur { font: 600 13px var(--font); color: var(--muted); margin-right: 6px; letter-spacing: 0; vertical-align: 5px; }
.stat-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.stat .spark { position: absolute; right: 16px; top: 18px; width: 68px; height: 30px; opacity: .95; }
.stat.has-spark .stat-top { padding-right: 74px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.delta.is-up { background: var(--accent-soft); color: var(--green); }
.delta.is-down { background: var(--red-soft); color: var(--red); }
.delta svg { width: 12px; height: 12px; stroke-width: 2.4; }
/* legacy */
.kpi .label { font-size: 13px; color: var(--text-2); }
.kpi .value { font: 650 26px/1.15 var(--display); margin: 8px 0 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value .cur { font: 600 13px var(--font); color: var(--muted); margin-right: 6px; vertical-align: 4px; }
.kpi .delta { padding: 0; background: none; font-weight: 400; color: var(--muted); font-size: 12px; }

/* Quick actions */
.quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.qa {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s, transform .1s, background .15s;
}
.qa:hover { border-color: var(--accent-line); background: var(--surface-2); }
.qa:active { transform: translateY(1px); }
.qa .qi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); flex: none; }
.qa.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.qa.primary .qi { background: color-mix(in srgb, var(--primary-ink) 14%, transparent); color: var(--primary-ink); }
.qa.primary .qs { color: color-mix(in srgb, var(--primary-ink) 70%, transparent); }
.qa .qt { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.qa .qs { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* Lists inside cards */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-sub { font-size: 12px; color: var(--muted); }
.list-item .li-end { text-align: right; flex: none; }
.rank { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font: 700 11.5px var(--display); background: var(--surface-3); color: var(--text-2); flex: none; }
.rank.r1 { background: var(--primary); color: var(--primary-ink); }

/* Thumb (product initials) */
.thumb {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  font: 700 13px var(--display); letter-spacing: -.02em;
  background: var(--surface-3); color: var(--text);
}
.thumb.sm { width: 32px; height: 32px; font-size: 12px; border-radius: 9px; }
.tone-0 { background: rgba(180, 244, 97, .14); color: var(--accent); }
.tone-1 { background: rgba(124, 196, 255, .14); color: var(--blue); }
.tone-2 { background: rgba(245, 196, 81, .14); color: var(--amber); }
.tone-3 { background: rgba(181, 156, 255, .15); color: var(--violet); }
.tone-4 { background: rgba(255, 138, 101, .14); color: #ff9a76; }
.tone-5 { background: rgba(94, 214, 190, .14); color: #5ed6be; }
.tone-6 { background: rgba(247, 166, 216, .14); color: #f7a6d8; }
.tone-7 { background: rgba(176, 183, 177, .14); color: var(--text-2); }

/* Meter */
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter.amber > i { background: var(--amber); }
.meter.red > i { background: var(--red); }
.meter.grad > i { background: linear-gradient(90deg, var(--green-3), var(--accent)); }

/* Promo card (lime gradient) */
.promo {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(180, 244, 97, .38), transparent 55%),
    linear-gradient(165deg, #1e3a1b, #0e180d 72%);
  border-color: rgba(180, 244, 97, .22);
  color: #f3f5f2;
}
.promo .muted { color: #b9c7b4; }
.promo .tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: rgba(0, 0, 0, .3); font-size: 12px; font-weight: 600; }
.promo .big { font: 650 44px/1 var(--display); letter-spacing: -.03em; margin: 16px 0 6px; }

/* Charts */
.chart { width: 100%; height: 240px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .tip {
  position: absolute; pointer-events: none; z-index: 5;
  padding: 8px 11px; border-radius: 10px; min-width: 120px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: 12px; line-height: 1.55; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s;
}
.chart .tip b { font-family: var(--display); }
.chart .tip.on { opacity: 1; }
.axis text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.gridline { stroke: var(--line); stroke-dasharray: 2 5; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .c b { font: 650 24px var(--display); display: block; letter-spacing: -.02em; }
.donut .c span { font-size: 12px; color: var(--muted); }

.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10px; color: var(--muted); }
.heat .cell { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); }
.heat .lbl { display: flex; align-items: center; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; font-size: 13px; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-3), var(--accent)); }

/* ==========================================================================
   Toolbar, tabs, filters
   ========================================================================== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search { flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13.5px; color: var(--text); }
.search input::placeholder { color: var(--muted); }

.tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 12px 13px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  border: 0; background: none; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on { color: var(--text); font-weight: 600; }
.tabs .on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs .n { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.tabs .on .n { background: var(--accent-soft); color: var(--accent); }
.tabs .n.amber { background: var(--amber-soft); color: var(--amber); }
.tabs .n.red { background: var(--red-soft); color: var(--red); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg a, .seg button { padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); border: 0; background: none; cursor: pointer; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--text); }
.seg .on { background: var(--primary); color: var(--primary-ink); font-weight: 650; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input, .toolbar .input { width: auto; min-width: 150px; height: 38px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 650; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface);
}
table.t td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tr.clickable { cursor: pointer; }
table.t .r { text-align: right; }
table.t .r, table.t .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t td.actions { width: 1%; white-space: nowrap; text-align: right; }
.cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell .n { font-weight: 600; line-height: 1.3; }
.cell .e { font-size: 12px; color: var(--muted); line-height: 1.3; }
.cell-user { display: flex; align-items: center; gap: 11px; }
.cell-user .n { font-weight: 600; }
.cell-user .e { font-size: 12px; color: var(--muted); }
.code { font: 600 12.5px ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); }
.row-actions { display: inline-flex; gap: 4px; opacity: .75; }
tr:hover .row-actions { opacity: 1; }

/* ==========================================================================
   Buttons & forms
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: transform .06s, background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: var(--primary-glow); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.lg { height: 50px; font-size: 15px; padding: 0 22px; border-radius: 13px; }
.btn.xl { height: 60px; font-size: 17px; padding: 0 24px; border-radius: 15px; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 13px; color: var(--text); font-weight: 550; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 13px;
  border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); outline: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
select.input {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23838b85' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea.input { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--muted); }
.input:hover { border-color: color-mix(in srgb, var(--line-2) 60%, var(--muted)); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.input[readonly] { color: var(--muted); }
.input.sm { height: 34px; font-size: 13px; padding: 0 10px; border-radius: 9px; }
select.input.sm { padding-right: 28px; background-position: right 8px center; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { white-space: nowrap; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.input-group .addon:first-child { border-radius: 11px 0 0 11px; border-right: 0; }
.input-group .addon:last-child { border-radius: 0 11px 11px 0; border-left: 0; }
.input-group .input:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; }
.err { color: var(--red); font-size: 12px; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch input:checked { background: var(--primary); border-color: var(--primary); }
.switch input:checked::after { transform: translateX(16px); background: var(--primary-ink); }

/* Settings-style form sections */
.section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.section:first-child { padding-top: 4px; }
.section:last-of-type { border-bottom: 0; }
.section-info h3 { font-size: 15px; }
.section-info p { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 0; margin-top: 8px; background: linear-gradient(transparent, var(--bg) 30%); }

.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-nav a.on { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }

/* Badges / pills */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--accent-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.lime { background: var(--primary); color: var(--primary-ink); }
.badge.outline { background: transparent; border: 1px solid var(--line-2); }

/* Flash → toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px; border-radius: 14px;
  background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 13.5px; animation: toast-in .25s ease-out;
}
.toast .ti { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--primary); color: var(--primary-ink); }
.toast.error .ti { background: var(--red); color: #fff; }
.toast .ti svg { width: 14px; height: 14px; stroke-width: 2.4; }
.toast button { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 13.5px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.flash.error { background: var(--red-soft); color: var(--red); border-color: rgba(255, 107, 107, .25); }
.flash.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.callout { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); margin-bottom: 16px; }
.callout .ci { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber); flex: none; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .ei { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); margin-bottom: 8px; }
.empty .ei svg { width: 22px; height: 22px; }
.empty b { color: var(--text); font-size: 14.5px; font-family: var(--display); }
.empty .btn { margin-top: 10px; }

.pagination { display: flex; gap: 6px; justify-content: flex-end; align-items: center; padding: 14px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.pagination .info { margin-right: auto; font-size: 12.5px; color: var(--muted); }
.pagination a, .pagination span.p { min-width: 34px; height: 34px; padding: 0 10px; display: grid; place-items: center; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); }
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.pagination .off { opacity: .35; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.modal.open { display: grid; animation: fade .15s ease-out; }
.modal .box { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.modal .box.wide { max-width: 680px; }
.modal .box.xwide { max-width: 860px; }
.modal .head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal .head h3 { font-size: 18px; }
.modal .head .desc { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal .head .icon-btn { margin-left: auto; margin-top: -6px; margin-right: -6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Command palette */
.palette { position: fixed; inset: 0; z-index: 150; display: none; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.palette.open { display: flex; animation: fade .12s; }
.palette .pbox { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; animation: pop .15s ease-out; }
.palette .pin { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 58px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette .pin input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; color: var(--text); }
.palette .pres { max-height: 420px; overflow-y: auto; padding: 8px; }
.palette .pgroup { padding: 10px 10px 4px; }
.palette .pitem { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; cursor: pointer; }
.palette .pitem.sel, .palette .pitem:hover { background: var(--surface-2); }
.palette .pitem .pi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.palette .pitem .pt { font-weight: 600; font-size: 13.5px; }
.palette .pitem .ps { font-size: 12px; color: var(--muted); }
.palette .pitem .pe { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.palette .pfoot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

/* ==========================================================================
   POS
   ========================================================================== */
body.pos-page .content { padding: 18px 20px; max-width: none; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; height: calc(100vh - 64px - 36px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; }
.pos-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.pos-bar .search { flex: 1; height: 48px; border-radius: 13px; font-size: 14.5px; background: var(--surface); }
.pos-bar .search input { font-size: 14.5px; }
.pos-bar .seg { height: 48px; align-items: center; border-radius: 13px; background: var(--surface); }
.pos-bar .seg button { padding: 9px 14px; border-radius: 10px; }
.pos-bar .btn { height: 48px; border-radius: 13px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.cats .chip { height: 36px; }
.cats .chip .n { font-size: 11px; opacity: .6; }
.products-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 2px 2px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; align-content: start; }
.p-card {
  position: relative; cursor: pointer; text-align: left;
  padding: 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .12s, transform .08s, background .12s;
  user-select: none;
}
.p-card:hover { border-color: var(--accent-line); background: var(--surface-2); }
.p-card:active { transform: scale(.98); }
.p-card .p-head { display: flex; align-items: flex-start; gap: 10px; }
.p-card .pn { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .pc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.p-card .p-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.p-card .pp { font: 650 16px var(--display); letter-spacing: -.01em; }
.p-card .pp small { font: 500 11.5px var(--font); color: var(--muted); }
.p-card .ps { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.p-card.low .ps { background: var(--amber-soft); color: var(--amber); }
.p-card.out { opacity: .55; }
.p-card.out .ps { background: var(--red-soft); color: var(--red); }
.p-card .in-cart { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font: 700 11px var(--display); box-shadow: 0 0 0 3px var(--bg); }

.cart { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.cart-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); }
.cart-head .ct { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cart-head h3 { font-size: 16px; }
.cust-pick { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); cursor: pointer; width: 100%; text-align: left; }
.cust-pick:hover { border-color: var(--accent-line); }
.cust-pick.set { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); }
.cust-pick .cn { font-weight: 600; font-size: 13.5px; }
.cust-pick .cs { font-size: 11.5px; color: var(--muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 4px 12px; }
.line { padding: 12px 6px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
.line:last-child { border-bottom: 0; }
.line .ln { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.line .lm { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.line .lt { font: 650 14px var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.line .ctl { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.line .ctl .input { height: 34px; padding: 0 9px; font-size: 13px; border-radius: 9px; }
.line .q { width: 64px; text-align: center; }
.line .u { width: 86px; }
.line .pr { width: 96px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.stepper button { width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); font-size: 16px; line-height: 1; }
.stepper button:hover { background: var(--surface-3); color: var(--text); }
.stepper input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; height: 32px !important; }
.cart-foot { padding: 16px 18px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; background: var(--surface); }
.sum-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--text-2); }
.sum-row .num { color: var(--text); }
.sum-row.total { font: 650 22px var(--display); color: var(--text); letter-spacing: -.02em; padding-top: 4px; }
.charge-btn { height: 58px; border-radius: 15px; font-size: 16px; justify-content: space-between; padding: 0 20px; }
.charge-btn .amt { font-family: var(--display); font-size: 18px; }
.queue-pill { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 14px; border-radius: 13px; background: var(--amber-soft); color: var(--amber); cursor: pointer; border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); font-weight: 600; font-size: 12.5px; }

/* Unit picker */
.unit-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.unit-opt { padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface-2); cursor: pointer; text-align: left; }
.unit-opt:hover { border-color: var(--muted); }
.unit-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.unit-opt b { display: block; font: 650 16px var(--display); }
.unit-opt span { font-size: 12px; color: var(--muted); }
.quick-qty { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-qty button { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.quick-qty button:hover { color: var(--text); border-color: var(--muted); }
.big-qty { display: flex; align-items: center; gap: 10px; }
.big-qty button { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 22px; cursor: pointer; color: var(--text); }
.big-qty input { flex: 1; height: 52px; text-align: center; font: 650 22px var(--display); border-radius: 14px; }

/* Payment */
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.pay-total { padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.pay-total .pl { font-size: 12.5px; color: var(--muted); }
.pay-total .pv { font: 700 36px/1.1 var(--display); letter-spacing: -.03em; margin-top: 4px; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pay-methods button { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 13px; border: 1.5px solid var(--line-2); background: var(--surface-2); font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text-2); text-align: left; }
.pay-methods button svg { color: var(--muted); }
.pay-methods button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.pay-methods button.on svg { color: var(--accent); }
.tender { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tender button { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); font: 650 14px var(--display); cursor: pointer; color: var(--text); }
.tender button:hover { border-color: var(--accent-line); }
.tender button.exact { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font: 600 19px var(--display); cursor: pointer; color: var(--text); }
.keypad button:hover { background: var(--surface-3); }
.keypad button:active { transform: scale(.97); }
.paid-display { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--accent); background: var(--surface); margin-bottom: 10px; }
.paid-display .pl { font-size: 12.5px; color: var(--muted); }
.paid-display .pv { font: 650 26px var(--display); font-variant-numeric: tabular-nums; }
.change-box { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-top: 12px; font-weight: 600; }
.change-box b { font: 700 22px var(--display); }
.change-box.short { background: var(--red-soft); color: var(--red); }
.success-mark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); margin: 0 auto 12px; box-shadow: 0 10px 40px rgba(180, 244, 97, .35); }
.success-mark svg { width: 30px; height: 30px; stroke-width: 2.6; }

/* Units editor */
.unit-row { display: grid; grid-template-columns: 1.4fr 1.3fr 1fr 1fr auto auto; gap: 10px; align-items: end; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.unit-row + .unit-row { margin-top: 10px; }
.unit-row .contains { display: flex; align-items: center; gap: 6px; }
.unit-row .contains span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.unit-row .input { background: var(--surface); }

/* ==========================================================================
   Login
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-art {
  position: relative; overflow: hidden; padding: 44px 52px; margin: 14px; border-radius: 26px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(70% 60% at 15% 5%, rgba(180, 244, 97, .5), transparent 60%),
    radial-gradient(60% 60% at 95% 100%, rgba(46, 125, 50, .65), transparent 60%),
    #0d150c;
  color: #f3f5f2;
}
.auth-art h1 { font-size: 44px; line-height: 1.06; letter-spacing: -.035em; max-width: 500px; }
.auth-art p { color: #cdd8c9; max-width: 440px; margin-top: 16px; font-size: 15px; }
.auth-form { display: grid; place-items: center; padding: 32px 24px; }
.auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 480px; }
.feature-list div { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #e2ebde; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .06); }
.auth-stats { display: flex; gap: 28px; }
.auth-stats b { display: block; font: 700 26px var(--display); }
.auth-stats span { font-size: 12.5px; color: #b9c7b4; }

/* Receipt preview */
.receipt-paper { width: 100%; max-width: 330px; margin: 0 auto; background: #fff; color: #111; padding: 18px 16px; border-radius: 6px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.receipt-paper .c { text-align: center; }
.receipt-paper hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.receipt-paper table { width: 100%; border-collapse: collapse; }
.receipt-paper td { padding: 1px 0; vertical-align: top; }
.receipt-paper .r { text-align: right; }
.receipt-paper .tot td { font-weight: 700; font-size: 13.5px; }

/* Detail key/value */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 550; }
.totals-box { padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.totals-box .sum-row + .sum-row { margin-top: 8px; }

/* Status timeline steps (quotation) */
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--surface-3); }
.steps span.on { background: var(--accent); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1440px) {
  .app.has-aside { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .app.has-aside .aside { display: none; }
}
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-main, .g-side, .g-form { grid-template-columns: minmax(0, 1fr); }
  .pos-layout { grid-template-columns: minmax(0, 1fr) 380px; }
  .cmd-trigger { width: 240px; }
}
@media (max-width: 960px) {
  .app, .app.has-aside { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); z-index: 60; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); }
  .menu-btn { display: grid; }
  .pos-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .products-scroll { max-height: 56vh; }
  .cart { min-height: 460px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .g-3 { grid-template-columns: minmax(0, 1fr); }
  .section { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .pay-grid { grid-template-columns: minmax(0, 1fr); }
  .crumbs { display: none; }
  .cmd-trigger { margin-left: 4px; flex: 1; width: auto; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; gap: 6px; height: 58px; }
  .content { padding: 18px 16px 36px; }
  body.pos-page .content { padding: 14px 16px; }
  .hide-sm, .cmd-trigger span, .cmd-trigger .kbd { display: none; }
  .cmd-trigger { flex: none; width: 38px; padding: 0; justify-content: center; margin: 0; }
  .net { padding: 0 9px; }
  .net span { display: none; }
  .g-4, .g-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-row { grid-template-columns: 1fr 1fr; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .toolbar .search { max-width: none; min-width: 100%; }
  .toolbar .input { flex: 1; min-width: 0; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .pos-bar { flex-wrap: wrap; }
  .pos-bar .search { min-width: 100%; }
  .stat-value { font-size: 24px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
}

@media print {
  .sidebar, .topbar, .aside, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
}

/* Mobile till: sticky total + charge */
.mobile-bar { display: none; }
@media (max-width: 960px) {
  .mobile-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
  body.pos-page .content { padding-bottom: 96px; }
}

/* ==========================================================================
   Motion — short, purposeful, and off for people who ask for less motion
   ========================================================================== */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop-in { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes dot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes flash-ring { 0% { box-shadow: 0 0 0 0 var(--accent-line); border-color: var(--accent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes check-draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* Page entrance: header, then cards in a gentle cascade */
.content > .page-head, .content > .back-link { animation: rise .45s var(--ease) both; }
.content > * { animation: rise .5s var(--ease) both; animation-delay: .04s; }
.content > *:nth-child(2) { animation-delay: .08s; }
.content > *:nth-child(3) { animation-delay: .12s; }
.content > *:nth-child(4) { animation-delay: .16s; }
.content > *:nth-child(5) { animation-delay: .2s; }
.content > *:nth-child(n+6) { animation-delay: .24s; }
.grid > .card, .grid > .stack > .card, .quick > .qa { animation: rise .5s var(--ease) both; }
.grid > :nth-child(2), .quick > :nth-child(2) { animation-delay: .06s; }
.grid > :nth-child(3), .quick > :nth-child(3) { animation-delay: .12s; }
.grid > :nth-child(4), .quick > :nth-child(4) { animation-delay: .18s; }
.grid > :nth-child(5), .quick > :nth-child(5) { animation-delay: .24s; }

/* Table rows and list items fade in one after another */
table.t tbody tr { animation: fade-in .4s var(--ease) both; }
table.t tbody tr:nth-child(2) { animation-delay: .03s; } table.t tbody tr:nth-child(3) { animation-delay: .06s; }
table.t tbody tr:nth-child(4) { animation-delay: .09s; } table.t tbody tr:nth-child(5) { animation-delay: .12s; }
table.t tbody tr:nth-child(6) { animation-delay: .15s; } table.t tbody tr:nth-child(7) { animation-delay: .18s; }
table.t tbody tr:nth-child(8) { animation-delay: .21s; } table.t tbody tr:nth-child(n+9) { animation-delay: .24s; }
.list-item, .feed li { animation: rise .4s var(--ease) both; }
.list-item:nth-child(2), .feed li:nth-child(2) { animation-delay: .05s; }
.list-item:nth-child(3), .feed li:nth-child(3) { animation-delay: .1s; }
.list-item:nth-child(4), .feed li:nth-child(4) { animation-delay: .15s; }
.list-item:nth-child(n+5), .feed li:nth-child(n+5) { animation-delay: .2s; }

/* Bars, meters and donuts fill up */
.meter > i, .bar-row .fill { transform-origin: left center; animation: grow-x .9s var(--ease) both; animation-delay: .25s; }
.donut svg circle + circle { animation: fade-in .6s var(--ease) both; }
.donut svg circle:nth-of-type(2) { animation-delay: .2s; } .donut svg circle:nth-of-type(3) { animation-delay: .3s; }
.donut svg circle:nth-of-type(4) { animation-delay: .4s; } .donut svg circle:nth-of-type(5) { animation-delay: .5s; }
.donut svg circle:nth-of-type(n+6) { animation-delay: .6s; }
.donut { animation: pop-in .7s var(--ease) both; animation-delay: .1s; }
.heat .cell { animation: fade-in .5s var(--ease) both; animation-delay: calc(var(--d, 0) * 1ms); }

/* Charts (classes added by app.js) */
.col-bar { transform-box: fill-box; transform-origin: bottom; animation: grow-y .7s var(--ease) both; }
.line-draw { animation: draw 1.2s var(--ease) forwards; }
.area-fill { animation: fade-in .9s var(--ease) both; animation-delay: .35s; }
.spark path:last-child { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 1.1s var(--ease) forwards; animation-delay: .3s; }
.spark path:first-of-type { animation: fade-in .8s var(--ease) both; animation-delay: .6s; }

/* Hover & press feedback */
.card.stat, .qa, a.card, .p-card, .unit-opt, .pay-methods button, .tender button, .chip, .list-item[data-cid] { transition: transform .18s var(--ease), border-color .18s, background .18s, box-shadow .18s; }
.card.stat:hover, .qa:hover, a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm), 0 10px 30px rgba(0, 0, 0, .18); }
:root[data-theme="light"] .card.stat:hover, :root[data-theme="light"] .qa:hover, :root[data-theme="light"] a.card:hover { box-shadow: 0 10px 26px rgba(40, 52, 30, .1); }
.p-card:hover { transform: translateY(-2px); }
.btn { transition: transform .12s var(--ease), background .15s, border-color .15s, color .15s, box-shadow .2s; }
.btn:active, .chip:active, .tender button:active, .keypad button:active, .pay-methods button:active { transform: scale(.96); }
.btn.primary:hover { box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 35%, transparent); }
.nav a svg { transition: transform .2s var(--ease), color .12s; }
.nav a:hover svg { transform: translateX(2px); }
.nav a.active { box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 25%, transparent); }
.icon-btn { transition: background .15s, color .15s, transform .12s; }
.icon-btn:active { transform: scale(.92); }
[data-theme-toggle] svg { transition: transform .5s var(--ease-spring); }
[data-theme-toggle]:hover svg { transform: rotate(40deg); }
table.t tbody tr td { transition: background .12s; }
.tabs .on::after { animation: grow-x .3s var(--ease) both; transform-origin: center; }
.seg a, .seg button { transition: background .2s var(--ease), color .2s; }

/* Live status */
.net::before { animation: pulse-ring 2s ease-out infinite; }
.net.off::before { animation-duration: 1s; }
.icon-btn .dot, .nav .count { animation: dot-pulse 2.4s ease-in-out infinite; }

/* POS moments */
.p-card.added { animation: flash-ring .6s var(--ease); }
.p-card.added .in-cart { animation: pop-in .35s var(--ease) both; }
.line.new { animation: slide-in .35s var(--ease) both; }
.bump { animation: bump .35s var(--ease); }
.success-mark { animation: pop-in .5s var(--ease-spring) both; }
.success-mark svg path { stroke-dasharray: 30; animation: check-draw .45s var(--ease) .25s both; }
.change-box b { transition: color .2s; }
.pitem { animation: fade-in .2s var(--ease) both; }

/* Smooth theme switch */
html.theme-anim, html.theme-anim * { transition: background-color .35s ease, border-color .35s ease, color .25s ease !important; }

/* Loading skeleton (used while the till downloads products) */
.skeleton { border-radius: 16px; min-height: 118px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .line-draw, .spark path:last-child { stroke-dashoffset: 0 !important; }
}

/* Category colours (donut / legends) per theme */
:root { --cat-1: #b4f461; --cat-2: #5fbf3a; --cat-3: #2e7d32; --cat-4: #e9f9d4; --cat-5: #5c665f; }
:root[data-theme="light"] { --cat-1: #8fd14f; --cat-2: #4f9a22; --cat-3: #24561d; --cat-4: #c9e7a6; --cat-5: #9aa59b; }
:root[data-theme="light"] .link { color: var(--green); }
:root[data-theme="light"] .tabs .on .n { color: var(--green); }
:root[data-theme="light"] .delta.is-up, :root[data-theme="light"] .badge.ok { color: var(--green); }

/* ==========================================================================
   Restaurant: floor & kitchen
   ========================================================================== */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tbl {
  position: relative; text-align: left; cursor: pointer; min-height: 132px;
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 18px;
  background: var(--surface); border: 1.5px dashed var(--line-2); color: var(--text);
  transition: transform .15s var(--ease), border-color .15s, background .15s;
}
.tbl:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.tbl .tn { font: 700 22px/1 var(--display); letter-spacing: -.02em; }
.tbl .ts { font-size: 12px; color: var(--muted); }
.tbl .tf { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tbl.busy { border-style: solid; border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.tbl.busy .amt { font: 650 16px var(--display); }
.tbl.ready { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: ready-glow 1.6s ease-in-out infinite; }
.tbl.long { border-color: color-mix(in srgb, var(--amber) 55%, transparent); }
@keyframes ready-glow { 50% { box-shadow: 0 0 0 7px transparent; } }
.tbl .flag { position: absolute; top: 10px; right: 10px; }
.area-title { margin: 22px 0 10px; }
.area-title:first-child { margin-top: 0; }

.kds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kds-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 12px; min-height: 60vh; }
.kds-col h3 { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-size: 15px; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; animation: rise .35s var(--ease) both; }
.ticket-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ticket-head .tt { font: 700 16px var(--display); }
.ticket-head .tm { margin-left: auto; font: 700 13px var(--display); padding: 3px 8px; border-radius: 99px; background: var(--surface-3); }
.ticket-head .tm.warn { background: var(--amber-soft); color: var(--amber); }
.ticket-head .tm.late { background: var(--red-soft); color: var(--red); }
.ticket-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.ticket-item:last-of-type { border-bottom: 0; }
.ticket-item:hover { background: var(--surface-2); }
.ticket-item .q { font: 800 16px var(--display); min-width: 28px; }
.ticket-item .nm { font-weight: 600; font-size: 14px; line-height: 1.3; }
.ticket-item .nt { margin-top: 3px; font-size: 12.5px; font-weight: 700; color: var(--amber); }
.ticket-item.done .nm { text-decoration: line-through; opacity: .55; }
.ticket-foot { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
.note-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--amber); }
.line.sent { background: color-mix(in srgb, var(--surface-2) 60%, transparent); border-radius: 10px; }
.line .kstat { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.line .kstat.ready { background: var(--accent); color: var(--accent-ink); }
.line .kstat.preparing { background: var(--amber-soft); color: var(--amber); }
.order-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); margin-bottom: 10px; }
.order-bar b { font-family: var(--display); }
@media (max-width: 960px) { .kds { grid-template-columns: minmax(0, 1fr); } .kds-col { min-height: 0; } }
.tbl .flag ~ .tn { margin-top: 20px; }

/* Till: guest bar & quick-sale steps */
.guest-bar { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.guest-bar button { flex: none; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.guest-bar button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.guest-bar button .n { opacity: .7; font-weight: 700; margin-left: 4px; }
.steps-bar { display: flex; gap: 4px; margin-bottom: 10px; }
.steps-bar .st { flex: 1; display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.steps-bar .st b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 10.5px; flex: none; }
.steps-bar .st.on { background: var(--accent-soft); color: var(--text); }
.steps-bar .st.on b { background: var(--accent); color: var(--accent-ink); }
.steps-bar .st.done b { background: var(--green); color: #fff; }
.guest-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 6px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.otp.sel { border-style: solid; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Table round: every guest's order in one popup */
#addModal { z-index: 110; }
.modal .box.round-box { max-width: 1120px; height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 20px; overflow: hidden; }
.round-box .head { margin-bottom: 12px; }
.round { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
.round-guests { overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.r-guest { border: 1.5px solid var(--line-2); border-radius: 16px; padding: 12px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.r-guest:hover { border-color: var(--accent-line); }
.r-guest.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.r-guest .rg-head { display: flex; align-items: center; gap: 8px; }
.r-guest .rg-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px var(--display); background: var(--surface-3, var(--line)); color: var(--text-2); flex: none; }
.r-guest.on .rg-no { background: var(--accent); color: var(--accent-ink); }
.r-guest .rg-name { font-weight: 650; font-size: 14px; }
.r-guest .rg-sub { margin-left: auto; font: 700 14px var(--display); }
.r-guest .rg-empty { font-size: 12px; color: var(--muted); margin-top: 6px; }
.r-line { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.r-line .rl-name { flex: 1; min-width: 0; line-height: 1.3; }
.r-line .rl-name small { display: block; color: var(--muted); font-size: 11.5px; }
.r-line .rl-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.r-line.sent { opacity: .65; }
.r-line .mini { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 700; display: grid; place-items: center; padding: 0; }
.r-line .mini:hover { border-color: var(--accent); }
.r-add-guest { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 12px; background: none; color: var(--text-2); font-weight: 600; cursor: pointer; }
.r-add-guest:hover { border-color: var(--accent); color: var(--accent); }
.round-menu { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.round-who { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font-weight: 650; font-size: 14px; }
.round-items { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding: 2px; }
.r-item { position: relative; text-align: left; border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; background: var(--surface-2); color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 92px; transition: transform .12s, border-color .15s; }
.r-item:hover { border-color: var(--accent-line); }
.r-item:active { transform: scale(.97); }
.r-item.out { opacity: .45; pointer-events: none; }
.r-item .nm { font-weight: 650; font-size: 13.5px; line-height: 1.3; }
.r-item .ct { font-size: 11.5px; color: var(--muted); }
.r-item .pr { margin-top: auto; font: 700 14px var(--display); }
.r-item .cnt { position: absolute; top: 8px; right: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.r-item.added { animation: pop .25s ease-out; }
.round-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.round-total { display: flex; align-items: baseline; gap: 10px; }
.round-total span { color: var(--muted); font-size: 13px; }
.round-total b { font: 700 24px var(--display); }
@media (max-width: 820px) {
  .modal .box.round-box { height: auto; max-height: calc(100vh - 32px); overflow: auto; padding: 16px; }
  .round { grid-template-columns: 1fr; }
  .round-guests { max-height: 34vh; }
  .round-items { max-height: 46vh; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .round-foot .btn { flex: 1 1 auto; }
}
.r-guest.faint { opacity: .7; }
@media (max-width: 820px) {
  .modal:has(.round-box) { padding: 8px; }
  .modal .box.round-box { height: calc(100dvh - 16px); max-height: none; overflow: hidden; padding: 14px; }
  .round-box .head { margin-bottom: 8px; }
  .round-box .head .desc { display: none; }
  .round { display: flex; flex-direction: column; gap: 10px; }
  .round-guests { flex: none; max-height: 26dvh; }
  .round-menu { flex: 1; }
  .round-items { max-height: none; }
  .round-foot { margin-top: 10px; padding-top: 10px; gap: 8px; }
  .round-foot .grow { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .round-foot .grow .tiny { order: 2; text-align: right; max-width: 55%; }
  .round-total b { font-size: 20px; }
  .round-foot .btn { flex: 1 1 40%; }
  #roundPay { flex-basis: 100%; }
}

/* Till tiles: bigger, taller photo; price sits on the right */
.p-card .p-head .thumb { width: 72px; height: 92px; border-radius: 12px; font-size: 20px; flex: none; }
.p-card .p-foot { flex-direction: row-reverse; align-items: center; }
.p-card .pp { text-align: right; margin-left: auto; }
@media (max-width: 820px) { .p-card .p-head .thumb { width: 60px; height: 78px; font-size: 17px; } }
.flash.info { background: var(--blue-soft, rgba(90,140,255,.12)); color: var(--blue, #8fb3ff); border-color: transparent; }
.saas-bar .grow { min-width: 0; }
.saas-bar form { margin: 0; }

/* ---------- Eva (intelligence) ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.admin-split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.sum-row:last-child { border-bottom: 0; }
.sum-row span { color: var(--text-2); }
.sum-row.total { font-weight: 700; border-bottom-style: solid; }
.sum-row.total span { color: var(--text); }
.rank { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); font: 700 12px var(--display); flex: none; }
.eva-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, var(--accent), #7be3a8); color: var(--accent-ink); box-shadow: 0 10px 24px -12px var(--accent); }
.eva-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 18px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.eva-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.eva-tabs a:hover { color: var(--text); }
.eva-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.eva-top { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: stretch; }
.eva-story { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 60%); }
.eva-headline { font-size: 20px; line-height: 1.35; margin-top: 4px; }
.eva-lines { margin: 14px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.eva-lines li { margin-bottom: 4px; }
.eva-score { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; align-content: center; flex: none; border: 5px solid var(--accent); text-align: center; }
.eva-score b { font: 800 26px/1 var(--display); }
.eva-score span { font-size: 10px; color: var(--muted); font-weight: 600; margin-top: 2px; max-width: 66px; line-height: 1.1; }
.eva-score.smid { border-color: var(--amber); } .eva-score.slow { border-color: var(--red); }
.eva-ask { display: flex; flex-direction: column; }
.eva-chat { flex: 1; min-height: 180px; max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.eva-chat .msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; animation: pop .2s ease-out; }
.eva-chat .msg.eva { background: var(--surface-2); border-bottom-left-radius: 4px; }
.eva-chat .msg.me { background: var(--accent); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 600; }
.eva-chat .msg.typing { color: var(--muted); font-style: italic; }
.eva-action:hover .li-title { color: var(--accent); }
.eva-alert.read { opacity: .75; }
.eva-hours, .eva-months { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.eva-hours > div, .eva-months > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.eva-hours span, .eva-months span { width: 100%; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--accent) 45%, var(--surface-3)); transition: height .6s; }
.eva-hours span.pk { background: var(--amber); }
.eva-months span { background: var(--accent); }
.eva-hours i, .eva-months i { font-style: normal; font-size: 10px; color: var(--muted); height: 12px; }
@media (max-width: 1100px) { .eva-top, .admin-split { grid-template-columns: minmax(0, 1fr); } }
@media print { .sidebar, .topbar, .eva-tabs, .page-head .actions, .btn { display: none !important; } .main { margin: 0 !important; } .card { break-inside: avoid; } }

/* POS: shift + mobile money */
.shift-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.shift-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green, #36c95c); }
.momo-box { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); }
.momo-box .input { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* Settings → Logo & photos */
.logo-preview { width: 96px; height: 96px; border-radius: 16px; border: 1px dashed var(--line, rgba(127,127,127,.35)); background: #fff; display: grid; place-items: center; overflow: hidden; padding: 8px; flex: none; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* Sales saved offline in this browser (offline-guard.js) */
.offline-guard { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 16px; font-size: 13.5px; background: var(--amber-soft); color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.offline-guard[data-tone="info"] { background: var(--blue-soft); border-bottom-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.offline-guard[hidden] { display: none; }
.offline-guard .og-err { color: var(--red); }
