/* ==========================================================================
   NASAQ — app.css
   One stylesheet for the whole product. Organised in this order:
     01 tokens        02 reset        03 type        04 buttons
     05 forms         06 surfaces     07 tables      08 navigation
     09 splash/auth   10 panes        11 overlays    12 responsive/print
   Rules: no !important, logical properties only (RTL/LTR safe), every colour
   comes from a token, and every text/background pair is contrast-checked.
   ========================================================================== */

/* ---------------------------------------------------------------- 01 tokens */
@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/alexandria-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Alexandria';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/alexandria-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bungee';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/bungee-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}

:root {
  /* surfaces */
  --bg: #FAF8F4;          /* chalk white */
  --surface: #FFFFFF;
  --surface-2: #F2EEE8;
  --surface-3: #E7E1D8;
  --line: #E3DDD4;
  --line-strong: #8A7F76;  /* 3.90:1 on #FFFFFF — inputs, dividers that carry meaning */

  /* ink — 15.5 / 7.3 / 5.6 on --bg, 16.4 / 7.8 / 5.2 on --surface */
  --ink: #2B1A26;
  --ink-2: #5E4E59;
  --ink-3: #6E5F69;

  /* brand: deep plum */
  --brand: #422038;
  --chart-a: #5A2E4C;      /* chart bar top: maroon family, no grey */
  --chart-b: #422038;      /* chart bar bottom */
  --brand-2: #33192B;
  --brand-3: #5A2E4C;
  --on-brand: #FFFFFF;     /* 14.04:1 on --brand */

  /* glacier blue: selection, tint, focus */
  --glacier: #8A9FB5;
  --glacier-tint: #E9EEF4;
  --glacier-ink: #33475C;
  --focus: #7E97AE;

  /* status */
  --ok: #2F6B4F;   --ok-bg: #E4EFE9;
  --warn: #8A5A12; --warn-bg: #F6EAD6;
  --bad: #A83A2E;  --bad-bg: #F7E4E0;
  --info: #33546E; --info-bg: #E6EEF5;

  /* type */
  --font-ui: 'Alexandria', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bungee', 'Alexandria', system-ui, sans-serif;

  /* geometry */
  --r-xs: 8px; --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  /* elevation */
  --shadow-1: 0 1px 2px rgba(43, 26, 38, .05);
  --shadow-2: 0 1px 2px rgba(43, 26, 38, .05), 0 10px 28px rgba(43, 26, 38, .06);
  --shadow-3: 0 18px 48px rgba(43, 26, 38, .16);

  --ring: 0 0 0 3px color-mix(in srgb, var(--focus) 34%, transparent);
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --speed: .18s;
}

html[data-theme='dark'] {
  --bg: #15111A;
  --surface: #1E1826;
  --surface-2: #272031;
  --surface-3: #322A3D;
  --line: #332B3E;
  --line-strong: #857A92;  /* 4.28:1 on --surface */

  --ink: #F6F1F7;          /* 16.7 on --bg, 15.5 on --surface */
  --ink-2: #C6BACB;        /* 10.0 / 9.3 */
  --ink-3: #A99CAD;        /* 7.1 / 6.6 */

  --brand: #C98AA8;
  --chart-a: #E0B0C6;
  --chart-b: #C98AA8;
  --brand-2: #B9789A;
  --brand-3: #E0B0C6;
  --on-brand: #1A0E16;     /* 6.87:1 on --brand */

  --glacier: #8FA7BF;
  --glacier-tint: #2B3A48;
  --glacier-ink: #D7E5F2;
  --focus: #9FB6CC;

  --ok: #6FC79B;   --ok-bg: #1C2E26;
  --warn: #E0B061; --warn-bg: #2E2718;
  --bad: #F08A7C;  --bad-bg: #33201E;
  --info: #9CC3E2; --info-bg: #1B2733;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .38);
  --shadow-3: 0 20px 54px rgba(0, 0, 0, .55);
}

/* ----------------------------------------------------------------- 02 reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; max-width: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
html [hidden] { display: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--glacier-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--glacier-tint); color: var(--ink); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------------ 03 type */
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.01em; line-height: 1.35; }
h1 { font-size: 21px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
small { font-size: 12.5px; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .92em; }

/* --------------------------------------------------------------- 04 buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink);
  font-size: 14.5px; font-weight: 500; line-height: 1;
  transition: background var(--speed), border-color var(--speed), color var(--speed), transform var(--speed);
  white-space: nowrap; user-select: none;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--brand-2); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--soft { background: var(--glacier-tint); color: var(--glacier-ink); }
.btn--soft:hover { background: color-mix(in srgb, var(--glacier) 28%, var(--surface)); }
.btn--danger { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn--danger:hover { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-xs); }
.btn--sm svg { width: 16px; height: 16px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: .55; cursor: not-allowed; transform: none; }
.btn.is-busy { color: transparent; position: relative; }
.btn.is-busy::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  color: var(--on-brand); animation: spin .7s linear infinite;
}
.btn--ghost.is-busy::after, .btn--soft.is-busy::after { color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-sm); color: var(--ink-2); position: relative;
  transition: background var(--speed), color var(--speed);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 7px; inset-inline-end: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--bad); border: 2px solid var(--surface);
}
.link {
  color: var(--glacier-ink); font-size: 13.5px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px;
}
.link:hover { color: var(--ink); }

/* ----------------------------------------------------------------- 05 forms */
.field { display: block; margin-bottom: 14px; border: 0; padding: 0; }
.field__label {
  display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.field__wrap { position: relative; display: block; }
.field__eye {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-3); border-radius: 8px;
}
.field__eye:hover { color: var(--ink); background: var(--surface-2); }
.field__wrap input { padding-inline-end: 46px; }
.field__hint { margin-top: 5px; font-size: 12px; color: var(--ink-3); }

input[type='text'], input[type='email'], input[type='password'], input[type='number'],
input[type='tel'], input[type='search'], input[type='date'], input[type='time'], input[type='file'],
select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color var(--speed), box-shadow var(--speed), background var(--speed);
  font-size: 14.5px;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
select { appearance: none; padding-inline-end: 34px; background-image: none; }
select + .sel-arrow, .sel { position: relative; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--focus); box-shadow: var(--ring); background: var(--surface);
}
input[dir='ltr'], .ltr { text-align: start; }
input[type='checkbox'], input[type='radio'] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink-2); padding: 6px 0; cursor: pointer; }
.check input { flex: none; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 42px; height: 24px; min-height: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; transition: background var(--speed); }
.switch input::after { content: ''; position: absolute; inset-inline-start: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: inset-inline-start var(--speed); }
.switch input:checked { background: var(--brand); border-color: var(--brand); }
.switch input:checked::after { inset-inline-start: 20px; background: var(--on-brand); }
.form-msg { min-height: 20px; margin: 2px 0 10px; font-size: 13px; color: var(--bad); }
.form-msg:empty { min-height: 0; margin: 0; }
.form-msg.is-ok { color: var(--ok); }

/* -------------------------------------------------------------- 06 surfaces */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card__head h3 { font-size: 15.5px; }
.card__head .spacer { flex: 1; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-sm); font-size: 13.5px;
  background: var(--surface-2); color: var(--ink-2); margin-bottom: 14px;
}
.callout svg { width: 18px; height: 18px; margin-top: 2px; }
.callout p { margin: 0; word-break: break-word; }
.callout--info { background: var(--info-bg); color: var(--info); }
.callout--warn { background: var(--warn-bg); color: var(--warn); }
.callout--bad { background: var(--bad-bg); color: var(--bad); }
.callout--ok { background: var(--ok-bg); color: var(--ok); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: 12px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--glacier { background: var(--glacier-tint); color: var(--glacier-ink); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px; display: grid; gap: 10px; box-shadow: var(--shadow-1);
}
.kpi__top { display: flex; align-items: center; gap: 10px; }
.kpi__ic {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--glacier-tint); color: var(--glacier-ink); flex: none;
}
.kpi__ic svg { width: 18px; height: 18px; }
.kpi__label { font-size: 12.5px; color: var(--ink-2); }
.kpi__value { font-size: 24px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__foot { font-size: 12px; color: var(--ink-3); }
.kpi--brand .kpi__ic { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); }

/* ---------------------------------------------------------------- 07 tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
.tbl th, .tbl td { padding: 11px 12px; text-align: start; vertical-align: middle; }
.tbl th {
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
.tbl td { border-bottom: 1px solid var(--line); font-size: 14px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .cell-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .cell-actions { text-align: end; white-space: nowrap; }
.tbl .cell-actions .icon-btn { width: 32px; height: 32px; }
.tbl .cell-actions .icon-btn svg { width: 16px; height: 16px; }
.empty {
  padding: 34px 18px; text-align: center; color: var(--ink-3); font-size: 13.5px;
}
.empty svg { width: 30px; height: 30px; margin-bottom: 8px; color: var(--line-strong); }
.skel { height: 12px; border-radius: 6px; background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ------------------------------------------------------------ 08 navigation */
.scrim {
  position: fixed; inset: 0; z-index: 55; background: rgba(21, 17, 26, .44);
  backdrop-filter: blur(2px); animation: fade .18s ease;
}
.scrim[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.scrim {
  position: fixed; inset: 0; z-index: 55; background: rgba(21, 17, 26, .44);
  backdrop-filter: blur(2px); animation: fade .18s ease;
}
.scrim[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.app { display: flex; min-height: 100%; }
.sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #4A2540 0%, #3D1D34 58%, #331A2C 100%);
  color: #F2E9EF; padding: 10px 12px 8px; position: sticky; top: 0; height: 100vh;
  border-inline-end: 1px solid rgba(255, 255, 255, .06);
}
html[data-theme='dark'] .sidebar { background: linear-gradient(180deg, #2A1726 0%, #221320 60%, #1B0F1A 100%); }
.sidebar__brand { padding: 0 8px 6px; }
.sidebar__brand img { width: 118px; height: auto; opacity: .96; }
.sidebar__store {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r-md); margin-bottom: 8px;
}
.sidebar__store-ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #F2E9EF; flex: none;
}
.sidebar__store-tx { display: grid; min-width: 0; }
.sidebar__store-tx b { font-size: 14px; font-weight: 500; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__store-tx small { font-size: 11.5px; color: #D9C7D3; }
.sidebar__nav { display: grid; gap: 1px; overflow-y: auto; flex: 1; min-height: 0; padding-inline-end: 2px; }
.sidebar__nav.is-scroll { mask-image: linear-gradient(180deg, transparent 0, #000 6px, #000 calc(100% - 10px), transparent 100%); }
.sidebar__nav > * { scroll-margin: 8px; }
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 99px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px;
  border-radius: var(--r-sm); color: #EADCE5; font-size: 13.5px; font-weight: 400;
  transition: background var(--speed), color var(--speed); text-align: start; width: 100%;
}
.nav-item svg { width: 17px; height: 17px; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .09); color: #FFFFFF; }
.nav-item.is-active { background: var(--glacier-tint); color: #2B1A26; font-weight: 500; }
.nav-item.is-active svg { opacity: 1; color: #2B1A26; }
.nav-group { margin: 7px 10px 2px; font-size: 10.5px; letter-spacing: .02em; color: #C7B2C1; }
.sidebar__foot { display: grid; gap: 0; padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 4px; }
.side-btn {
  display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px;
  border-radius: var(--r-sm); color: #EADCE5; font-size: 13px; width: 100%; text-align: start;
}
.side-btn:hover { background: rgba(255, 255, 255, .09); color: #FFFFFF; }
.side-btn svg { width: 17px; height: 17px; }
.sidebar__who { padding: 4px 11px 0; font-size: 10.5px; color: #C7B2C1; word-break: break-all; }

.app__main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar__menu { display: none; }
.topbar__ic {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--glacier-tint); color: var(--glacier-ink); flex: none;
}
.topbar__store { display: grid; min-width: 0; }
.topbar__store h1 { font-size: 19px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__store p { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.content { flex: 1; padding: 22px 24px 32px; max-width: 1280px; width: 100%; margin: 0 auto; }
.tabbar { display: none; }

/* ------------------------------------------------------------ 09 splash/auth */
.splash {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 50% 0%, var(--brand-3) 0%, var(--brand-2) 55%, var(--brand) 100%);
  transition: opacity .3s ease, visibility .3s;
}
.splash__inner { display: grid; justify-items: center; gap: var(--sp-6); }
.splash__lockup { width: min(260px, 62vw); height: auto; }
.splash__bar { width: 120px; height: 3px; border-radius: var(--r-pill); background: rgba(255,255,255,.18); overflow: hidden; }
.splash__bar span { display: block; height: 100%; width: 40%; border-radius: var(--r-pill); background: var(--glacier-tint); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }
.splash.is-done { opacity: 0; visibility: hidden; }

.landing { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); }

/* nav ---------------------------------------------------------------------- */
.nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
}
.nav__links { display: flex; gap: clamp(12px, 2vw, 30px); }
.nav__links a { color: var(--ink-2); font-size: 14px; font-weight: 400; }
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__brand { display: grid; justify-items: center; }
.nav__brand img { width: clamp(120px, 12vw, 150px); height: auto; }
.nav__brand .brand-dark, .auth-card__brand .brand-dark { display: none; }
html[data-theme='dark'] .nav__brand .brand-light, html[data-theme='dark'] .auth-card__brand .brand-light { display: none; }
html[data-theme='dark'] .nav__brand .brand-dark, html[data-theme='dark'] .auth-card__brand .brand-dark { display: block; }
.nav__side { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.nav__btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  border-radius: var(--r-pill); color: var(--ink-2); font-size: 13px; border: 1px solid transparent;
}
.nav__btn:hover { color: var(--ink); background: var(--surface-2); }
.nav__btn svg { width: 16px; height: 16px; }
.nav__btn--bare { font-weight: 500; letter-spacing: .02em; }
.nav__cta {
  height: 36px; padding: 0 16px; border-radius: var(--r-pill); background: var(--brand); color: var(--on-brand);
  font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center;
}
.nav__cta:hover { background: var(--brand-2); text-decoration: none; }

/* body --------------------------------------------------------------------- */
.landing__body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: clamp(24px, 4vw, 56px);
  align-items: center; padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 56px);
  max-width: 1280px; margin: 0 auto; width: 100%;
}
.pitch { display: grid; gap: var(--sp-5); justify-items: start; order: 1; }
.pitch__title { font-size: clamp(30px, 3.6vw, 46px); font-weight: 500; line-height: 1.28; letter-spacing: -.02em; color: var(--ink); }
.pitch__sub { font-size: clamp(14px, 1.2vw, 16px); color: var(--ink-2); line-height: 1.85; max-width: 34ch; }
.pitch__feats { font-size: 13px; color: var(--ink-3); letter-spacing: .01em; }
.btn--pill { border-radius: var(--r-pill); height: 44px; padding: 0 24px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-weight: 500; }
.btn--pill:hover { background: var(--surface-2); }
.btn--outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--outline:hover { background: var(--surface-2); }
.btn--lg { min-height: 46px; font-size: 15px; }

/* maroon stage + white card ------------------------------------------------- */
.stage { order: 2; display: grid; }
.stage__card {
  background: linear-gradient(160deg, var(--brand-3) 0%, var(--brand) 55%, var(--brand-2) 100%);
  border-radius: var(--r-xl); padding: clamp(14px, 2vw, 30px);
  box-shadow: var(--shadow-3);
}
html[data-theme='dark'] .stage__card {
  background: linear-gradient(160deg, #3A2033 0%, #2C1627 55%, #241019 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.auth-card {
  background: var(--surface); border-radius: var(--r-lg); padding: clamp(18px, 2vw, 26px);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.auth-card__brand { display: grid; justify-items: center; margin-bottom: var(--sp-5); }
.auth-card__brand img { width: clamp(150px, 15vw, 176px); height: auto; }
.auth-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.auth-card__head h2 { font-size: clamp(19px, 1.6vw, 22px); }
.step { font-size: 12px; color: var(--brand); font-weight: 500; }
.auth-card__sub { margin: var(--sp-2) 0 var(--sp-5); font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.auth-card__row { display: flex; justify-content: center; margin-top: var(--sp-3); }
.auth-card__dl { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.dl {
  display: flex; align-items: center; gap: var(--sp-2); padding: 10px 12px; text-align: start;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  transition: border-color var(--speed), background var(--speed);
}
.dl:hover { border-color: var(--line-strong); background: var(--surface-2); }
.dl svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.dl span { display: grid; gap: 1px; min-width: 0; }
.dl b { font-size: 12.5px; font-weight: 500; }
.dl small { font-size: 10.5px; color: var(--ink-3); line-height: 1.4; }
#view-login .btn--primary { margin-top: var(--sp-2); }
#view-login .btn--outline { margin-top: var(--sp-2); }

/* stats strip -------------------------------------------------------------- */
.stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 3vw, 44px);
  padding: var(--sp-4) clamp(16px, 4vw, 48px); border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 12.5px;
}
.stats b { color: var(--ink); font-weight: 500; font-size: 14px; margin-inline-end: 4px; font-variant-numeric: tabular-nums; }

.ind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); max-height: 240px; overflow-y: auto; padding: 2px; }
.ind-tile {
  display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); font-size: 11.5px; color: var(--ink-2); text-align: center;
}
.ind-tile svg { width: 19px; height: 19px; color: var(--ink-3); }
.ind-tile:hover { border-color: var(--line-strong); }
.ind-tile.is-on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); color: var(--ink); }
.ind-tile.is-on svg { color: var(--brand); }

/* ----------------------------------------------------------------- 10 panes */
.pane { display: grid; gap: 16px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head__tx { display: grid; gap: 4px; }
.page-head h2 { font-size: 22px; }
.page-head p { font-size: 13.5px; color: var(--ink-2); }
.page-head__actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 180px; }
.toolbar .search svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }
.toolbar .search input { padding-inline-start: 36px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button {
  height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.chart { width: 100%; height: 190px; display: block; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.chart-bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart-bars i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--chart-a) 0%, var(--chart-b) 100%); min-height: 3px; }
html[data-theme='dark'] .chart-bars i { background: linear-gradient(180deg, var(--chart-a) 0%, var(--chart-b) 100%); }
.chart-bars span { font-size: 10.5px; color: var(--ink-3); }
.hero-band {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-3) 100%); color: var(--on-brand);
  position: relative; overflow: hidden;
}
.hero-band::after {
  content: ''; position: absolute; inset-block-start: -60px; inset-inline-end: -40px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255, 255, 255, .07);
}
.hero-band h2 { font-size: 20px; color: var(--on-brand); }
.hero-band p { font-size: 13px; opacity: .88; }
.hero-band .hero-band__ic { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.hero-band .hero-band__ic svg { width: 24px; height: 24px; }

/* -------------------------------------------------------------- 11 overlays */
.toasts { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 120; display: grid; gap: 8px; justify-items: end; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow-3);
  animation: toast-in .22s ease;
}
.toast svg { width: 17px; height: 17px; }
.toast--ok svg { color: #8FE0B4; }
.toast--bad svg { color: #FFB3A7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-back { position: fixed; inset: 0; z-index: 110; background: rgba(24, 12, 20, .55); display: grid; place-items: center; padding: 18px; animation: fade .16s ease; backdrop-filter: blur(2px); }
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 36px); overflow: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  animation: modal-in .2s cubic-bezier(.2, .8, .3, 1);
}
.modal--wide { max-width: 760px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal__head h3 { flex: 1; }
.modal__body { padding: 18px; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }

/* --------------------------------------------------- 12 responsive & print */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  /* phone: headline first, then the card; a thin maroon frame, no wasted gutter */
  .landing__body { grid-template-columns: 1fr; gap: 10px; padding: 2px 10px 12px; }
  .pitch { order: 1; justify-items: center; text-align: center; gap: 6px; padding: 4px 8px 0; }
  .pitch__title { font-size: 22px; line-height: 1.28; }
  .pitch__sub { font-size: 12.5px; max-width: 38ch; line-height: 1.7; }
  .pitch__feats { display: none; }
  .btn--pill { height: 36px; padding: 0 18px; font-size: 13px; }
  .stage { order: 2; }
  .stage__card { padding: 5px; border-radius: 20px; }
  .auth-card { width: 92%; margin-inline: auto; padding: 16px 14px 14px; border-radius: 16px; }
  .auth-card__brand { margin-bottom: var(--sp-3); }
  .auth-card__brand img { width: 132px; }
  .auth-card__head h2 { font-size: 18px; }
  .auth-card__sub { margin: 4px 0 14px; font-size: 12.5px; }
  .field { margin-bottom: 14px; }
  .field__label { font-size: 13px; color: var(--ink); }
  .field input, .field select { min-height: 48px; font-size: 15px; }
  .btn--lg { min-height: 48px; }
  #view-login .btn--outline { margin-top: 8px; }
  .auth-card__row { margin-top: 10px; }
  .auth-card__dl { margin-top: 20px; padding-top: 14px; gap: 7px; grid-template-columns: 1fr 1fr; }
  .dl { padding: 7px 8px; gap: 5px; }
  .dl svg { width: 17px; height: 17px; }
  .dl b { font-size: 11.5px; }
  .dl small { font-size: 9.5px; }
  .nav { padding: 10px 12px; gap: 8px; }
  .nav__brand img { width: 118px; }
  .nav__cta { height: 32px; padding: 0 12px; font-size: 12.5px; }
  .stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 10px 14px;
    font-size: 11px; text-align: center; border-top: 1px solid var(--line);
  }
  .stats b { font-size: 12.5px; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; width: 280px;
    transform: translateX(calc(100% + 12px)); transition: transform .24s ease; height: 100dvh;
  }
  html[dir='ltr'] .sidebar { transform: translateX(calc(-100% - 8px)); }
  .sidebar { visibility: hidden; transition: transform .24s ease, visibility 0s linear .24s; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-3); visibility: visible; transition: transform .24s ease, visibility 0s; }
  .topbar { height: 58px; padding: 0 12px; gap: 10px; }
  .topbar__menu { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); }
  .topbar__ic { width: 34px; height: 34px; border-radius: 10px; }
  .topbar__store h1 { font-size: 17px; }
  .topbar__store p { font-size: 11px; }
  .content { padding: 14px 14px calc(76px + env(safe-area-inset-bottom)); }
  .page-head h2 { font-size: 19px; }
  .page-head__actions { width: 100%; margin-inline-start: 0; }
  .page-head__actions .btn { flex: 1; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed;
    inset-block-end: 0; inset-inline: 0; z-index: 50; background: var(--surface);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar button {
    display: grid; justify-items: center; gap: 3px; padding: 8px 2px 7px; font-size: 10.5px;
    color: var(--ink-3); border-radius: 0; min-height: 54px;
  }
  .tabbar button svg { width: 21px; height: 21px; }
  .tabbar button.is-active { color: var(--brand); }
  .tabbar button.is-active svg { stroke-width: 2; }
  .field-row { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px; }
  .kpi__value { font-size: 20px; }
  .toasts { inset-inline: 12px; inset-block-end: calc(70px + env(safe-area-inset-bottom)); justify-items: stretch; }
  .card__body { padding: 14px; }
  .modal { max-width: none; }
  .modal-back { padding: 0; align-items: end; }
  .modal { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; }
  .ind-grid { grid-template-columns: repeat(3, 1fr); }
  .dl-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .nav { grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 14px; }
  .nav__links { display: none; }
  .nav__brand img { width: 104px; }
  .nav__side { gap: 2px; min-width: 0; }
  .nav__btn { height: 32px; padding: 0 8px; font-size: 12.5px; }
  .nav__cta { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .nav__btn--bare span { display: none; }
}
@media (max-width: 560px) {
  .nav { grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 14px; }
  .nav__links { display: none; }
  .nav__brand img { width: 104px; }
  .nav__side { gap: 2px; min-width: 0; }
  .nav__btn { height: 32px; padding: 0 8px; font-size: 12.5px; }
  .nav__cta { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .nav__btn--bare span { display: none; }
}
@media (max-width: 420px) {
  .nav__btn span[data-theme-label] { display: none; }
  .dl small { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi__value { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms; transition-duration: .001ms; }
}
@media print {
  .sidebar, .topbar, .tabbar, .toasts, .page-head__actions, .toolbar { display: none; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* --------------------------------------------------------- overview helpers */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--sp-4); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex; align-items: center; gap: var(--sp-3); padding: 11px 16px;
  border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list__tx { display: grid; min-width: 0; flex: 1; }
.mini-list__tx b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list__tx small { color: var(--ink-3); font-size: 11.5px; }
.rank {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--glacier-tint); color: var(--glacier-ink); font-size: 11.5px; font-weight: 500; flex: none;
}
.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: flex; align-items: center; gap: var(--sp-3); padding: 9px 16px; font-size: 13px; color: var(--ink-2); }
.feed__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--glacier); flex: none; }
.feed li small { margin-inline-start: auto; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }


/* ------------------------------------------------------- tone-on-tone art */
.bg-art {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  color: var(--ink); opacity: .07;
  mask-image: radial-gradient(130% 90% at 50% 0%, rgba(0,0,0,.45) 0%, #000 62%);
}
html[data-theme='dark'] .bg-art { opacity: .075; }
.bg-art svg { width: 100%; height: 100%; display: block; }
.bg-art svg * { stroke: currentColor; fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pane { position: relative; }
.pane > *:not(.bg-art) { position: relative; z-index: 1; }
.landing { position: relative; }
.landing > *:not(.bg-art) { position: relative; z-index: 1; }

/* --------------------------------------------------------- overview helpers */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex; align-items: center; gap: var(--sp-3); padding: 11px 16px;
  border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list__tx { display: grid; min-width: 0; flex: 1; }
.mini-list__tx b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list__tx small { color: var(--ink-3); font-size: 11.5px; }
.rank {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--glacier-tint); color: var(--glacier-ink); font-size: 11.5px; font-weight: 500; flex: none;
}
.feed { list-style: none; margin: 0; padding: 4px 0; }
.feed li { display: flex; align-items: center; gap: var(--sp-3); padding: 9px 16px; font-size: 13px; color: var(--ink-2); }
.feed__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--glacier); flex: none; }
.feed li small { margin-inline-start: auto; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }


/* ------------------------------------------------------- tone-on-tone art */
.bg-art {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  color: var(--ink); opacity: .07;
  mask-image: radial-gradient(130% 90% at 50% 0%, rgba(0,0,0,.45) 0%, #000 62%);
}
html[data-theme='dark'] .bg-art { opacity: .075; }
.bg-art svg { width: 100%; height: 100%; display: block; }
.bg-art svg * { stroke: currentColor; fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pane { position: relative; }
.pane > *:not(.bg-art) { position: relative; z-index: 1; }
.landing { position: relative; }
.landing > *:not(.bg-art) { position: relative; z-index: 1; }


/* ------------------------------------------------------------ splash v2 */
.splash__stage {
  position: relative; width: min(302px, 74vw); aspect-ratio: 927 / 200;
  animation: splashCompose .62s cubic-bezier(.3, .8, .25, 1) .52s both;
}
.splash__mark { position: absolute; left: 0; top: 0; width: 21.57%; height: 100%; }
.splash__body, .splash__dot { position: absolute; inset: 0; width: 100%; height: 100%; }
.splash__word { position: absolute; left: 23.3%; top: 28.5%; width: 75.9%; height: auto; }
.splash__body { animation: splashMark .86s cubic-bezier(.16, .9, .24, 1) both; }
.splash__word { animation: splashWord .58s cubic-bezier(.2, .8, .2, 1) .54s both; }
.splash__dot { animation: splashDot .76s cubic-bezier(.24, .62, .2, 1) 1.14s both; }
@keyframes splashCompose { from { transform: translate3d(39.2%, 0, 0); } to { transform: none; } }
@keyframes splashMark {
  from { opacity: 0; transform: translate3d(-52%, 38%, 0) scale(.965); }
  60% { opacity: 1; }
  to { opacity: 1; transform: none; }
}
@keyframes splashWord {
  from { opacity: 0; transform: translate3d(2.2%, 4%, 0) scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes splashDot {
  0% { opacity: 0; transform: translate3d(-34%, -118%, 0) scale(.9); }
  18% { opacity: 1; transform: translate3d(-20%, -78%, 0) scale(.94); }
  62% { transform: translate3d(-4%, -16%, 0) scale(1.05); }
  84% { transform: translate3d(0, 2.5%, 0) scale(1.01); }
  100% { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  table.tbl { min-width: 0; }
  .tbl th, .tbl td { padding: 9px 7px; font-size: 12.5px; }
  .tbl th { font-size: 11px; }
  .tbl td, .tbl th { overflow-wrap: anywhere; }
  .chart-bars { gap: 4px; }
  .chart-bars span { font-size: 9.5px; white-space: normal; line-height: 1.15; text-align: center; }
  .mini-list li { gap: 8px; padding: 10px 12px; }
  .mini-list__tx b, .mini-list__tx small { overflow-wrap: anywhere; }
}

/* ------------------------------------------------------------------ cashier */
.pos { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.pos__catalog .card__body { padding: 16px; display: grid; gap: 12px; }
.pos__cats { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 12.5px;
}
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
html[data-theme='dark'] .chip.is-on { color: #1A0E16; }
.pos__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ptile {
  display: grid; gap: 8px; text-align: start; padding: 12px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.ptile:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.ptile:active { transform: none; }
.ptile__name { font-size: 13px; font-weight: 500; line-height: 1.45; min-height: 38px; }
.ptile__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.ptile__meta b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ptile__meta small { font-size: 11px; color: var(--ink-3); }
.pos__cart { display: flex; flex-direction: column; position: sticky; top: calc(var(--topbar-h) + 12px); }
.pos__lines { display: grid; gap: 0; max-height: 46vh; overflow-y: auto; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.line__tx { display: grid; min-width: 0; }
.line__tx b { font-size: 13px; font-weight: 500; }
.line__tx small { font-size: 11.5px; color: var(--ink-3); }
.line__qty { display: inline-flex; align-items: center; gap: 2px; }
.line__qty button { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; line-height: 1; }
.line__qty b { min-width: 22px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.line__net { font-size: 13px; font-variant-numeric: tabular-nums; }
.pos__totals { padding: 12px 16px 16px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.tot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.tot b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tot--grand { font-size: 15px; padding-top: 6px; border-top: 1px dashed var(--line); }
.tot--grand b { font-size: 20px; }
.tot__in { width: 96px; height: 34px; text-align: end; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 8px; }
.pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.pay__b { height: 38px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; }
.pay__b.is-on { border-color: var(--brand); background: var(--glacier-tint); color: var(--ink); font-weight: 500; }
.btn--block { width: 100%; justify-content: space-between; }
.btn--lg { height: 50px; font-size: 15px; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 980px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos__cart { position: static; }
  .pos__grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* sidebar active item: a tint of the sidebar's own accent, in both themes */
html[data-theme='dark'] .nav-item.is-active { background: rgba(201, 138, 168, .20); color: #F6F1F7; }
html[data-theme='dark'] .nav-item.is-active svg { color: #E8B8CF; }

/* cashier: mobile bar + sheet */
.pos__bar, .pos__close { display: none; }
.pos__close { width: 32px; height: 32px; place-items: center; border-radius: 9px; color: var(--ink-2); }
.pos__close svg { width: 18px; height: 18px; }
@media (max-width: 980px) {
  .pos__cart {
    position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 70; max-height: 88dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(105%); visibility: hidden;
    transition: transform .24s ease, visibility 0s linear .24s; overflow-y: auto; top: auto;
  }
  .pos__cart.is-open { transform: none; visibility: visible; transition: transform .24s ease, visibility 0s; box-shadow: var(--shadow-3); }
  .pos__close { display: grid; margin-inline-end: 8px; }
  .pos__lines { max-height: 32vh; }
  .pos__bar {
    display: block; position: fixed; inset-inline: 0; z-index: 52;
    inset-block-end: calc(54px + env(safe-area-inset-bottom)); padding: 8px 12px;
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .pos__bar button {
    width: 100%; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 0 16px; border-radius: var(--r-md); background: var(--brand); color: #FFFFFF; font-size: 15px;
  }
  html[data-theme='dark'] .pos__bar button { color: #1A0E16; }
  .pos__bar b { font-variant-numeric: tabular-nums; }
  .pos__bar .pill { background: rgba(255,255,255,.2); color: inherit; }
  #pane-cashier { padding-bottom: 64px; }
}

.tot-field { display: grid; gap: 6px; }
.tot-field input { width: 100%; min-height: 44px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 12px; font-size: 15px; }

@media (max-width: 980px) {
  html.sheet-open .pos__bar { display: none; }
  .pos__cart { inset-block-end: calc(54px + env(safe-area-inset-bottom)); max-height: calc(88dvh - 54px); }
}

/* page texture: hair-fine lines in the background's own tone, plus thin domain motifs */
html {
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 4.5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 4.5%, transparent) 1px, transparent 1px);
  background-size: 28px 28px; background-color: var(--bg);
}
.bg-domain { display: none; }
html[data-theme='dark'] .bg-domain { opacity: .11; }
.bg-domain svg { width: 100%; height: 100%; display: block; }
.bg-domain svg * { stroke: currentColor; fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.app, .landing { position: relative; z-index: 1; }
.app__main { background: transparent; }

/* full-page motif field: dense, tone-on-tone, static grid, gently drifting motifs */
.bg-field {
  position: fixed; inset: -24px; z-index: 0; pointer-events: none; color: var(--ink);
  opacity: .11;
  animation: bgDrift 34s ease-in-out infinite alternate;
  will-change: transform;
}
html[data-theme='dark'] .bg-field { opacity: .14; }
.bg-field svg { width: 100%; height: 100%; display: block; }
@keyframes bgDrift {
  from { transform: translate3d(-7px, -5px, 0) scale(1.005); }
  to { transform: translate3d(8px, 6px, 0) scale(1.005); }
}
@media (prefers-reduced-motion: reduce) { .bg-field { animation: none; } }

/* reservations + small overlays */
.kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi--sm { padding: 10px 15px; gap: 2px; align-content: center; }
.kpi--sm .kpi__value { font-size: 22px; line-height: 1.25; }
.kpi--sm .kpi__label { line-height: 1.4; }
.kpi--sm .kpi__sub { margin-top: 0; line-height: 1.3; }
.kpi__value--ok { color: var(--ok); }
.kpi__value--warn { color: var(--warn); }
.kpi__value--bad { color: var(--bad); }
/* reports: the gross-to-net ladder */
.recon { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.recon__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: var(--r-sm); font-size: 13.5px; }
.recon__row b { font-weight: 500; }
.recon__row--minus { color: color-mix(in srgb, var(--ink) 62%, transparent); }
.recon__row--total { background: var(--glacier-tint); color: var(--glacier-ink); font-weight: 500; }
.recon__row--bad b { color: var(--bad); }
/* cashier: the table row above the sale lines */
.pos__tables { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; }
.pos__tables .chip { font-size: 12.5px; padding: 4px 10px; }

/* kitchen: four columns of tickets */
.kboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: grid; gap: 8px; }
.kcol__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.kticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; display: grid; gap: 7px; }
.kticket--late { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.kticket__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
.kticket__items { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.kticket__items li { display: flex; justify-content: space-between; gap: 8px; }
.kticket__note { margin: 0; font-size: 12px; color: color-mix(in srgb, var(--ink) 66%, transparent); }
.kticket__late { margin: 0; font-size: 11.5px; color: var(--bad); }
@media (max-width: 900px) { .kboard { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* tables: the floor grid */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-3); }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 13px; display: grid; gap: 8px; box-shadow: var(--shadow-1); }
.tcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tcard__top b { font-size: 15px; }
.tcard__mid { display: flex; justify-content: space-between; font-size: 12.5px; color: color-mix(in srgb, var(--ink) 62%, transparent); }
.tcard__live { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.tcard__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.tcard--warn { border-color: color-mix(in srgb, var(--warn) 34%, var(--line)); }
.tcard--info { border-color: color-mix(in srgb, var(--info) 34%, var(--line)); }
.tcard--glacier { border-color: color-mix(in srgb, var(--glacier-ink) 26%, var(--line)); }

/* settings: section nav beside the cards */
.set-layout { display: flex; align-items: flex-start; gap: var(--sp-4); }
.set-body { order: 1; flex: 1 1 auto; }
.set-nav { order: 2; flex: 0 0 200px; }
.set-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 12px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; }
.set-nav__item { text-align: start; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink); background: none; border: 0; }
.set-nav__item:hover { background: var(--glacier-tint); color: var(--glacier-ink); }
.set-body { display: grid; gap: var(--sp-4); min-width: 0; }
.set-body .card__body { padding-top: 4px; }
.field--check { display: flex; align-items: center; gap: 8px; }
.field--check small { width: 100%; }
.mini-list--flat li { border: 0; padding: 8px 0; }
@media (max-width: 1080px) { .set-layout { display: block; } .set-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--sp-4); } }
.toolbar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.field--inline { margin: 0; }
.field--inline input, .field--inline select { min-height: 40px; }
.field--search input { min-width: 180px; }
.res-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cell-note { max-width: 220px; font-size: 12.5px; color: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-msg { margin: 4px 0 0; font-size: 12.5px; color: var(--bad); }
textarea { width: 100%; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 10px 12px; font-family: inherit; font-size: 14px; resize: vertical; }
html.modal-open { overflow: hidden; }
@media (max-width: 900px) {
  .kpis--4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .field--search input { min-width: 0; width: 100%; }
  .cell-note { max-width: 130px; }
}

.sidebar__tail { display: grid; gap: 1px; padding-top: 2px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar__tail .nav-group { margin-top: 4px; }

/* sidebar: soft flowing waves in the sidebar's own tone, drifting like water.
   The page background stays static. */
.sidebar { overflow: hidden; }
.sidebar::before {
  content: ''; position: absolute; inset: -40px -300px; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22280%22%20height%3D%22160%22%20viewBox%3D%220%200%20280%20160%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23FFFFFF%22%20stroke-opacity%3D%220.075%22%20stroke-width%3D%221.1%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M0%2018%20Q%2035%2011%2070%2018%20Q%20105%2025%20140%2018%20Q%20175%2011%20210%2018%20Q%20245%2025%20280%2018%22%2F%3E%3Cpath%20d%3D%22M0%2044%20Q%2035%2039%2070%2044%20Q%20105%2049%20140%2044%20Q%20175%2039%20210%2044%20Q%20245%2049%20280%2044%22%2F%3E%3Cpath%20d%3D%22M0%2070%20Q%2035%2063%2070%2070%20Q%20105%2077%20140%2070%20Q%20175%2063%20210%2070%20Q%20245%2077%20280%2070%22%2F%3E%3Cpath%20d%3D%22M0%2096%20Q%2035%2091%2070%2096%20Q%20105%20101%20140%2096%20Q%20175%2091%20210%2096%20Q%20245%20101%20280%2096%22%2F%3E%3Cpath%20d%3D%22M0%20122%20Q%2035%20115%2070%20122%20Q%20105%20129%20140%20122%20Q%20175%20115%20210%20122%20Q%20245%20129%20280%20122%22%2F%3E%3Cpath%20d%3D%22M0%20148%20Q%2035%20143%2070%20148%20Q%20105%20153%20140%20148%20Q%20175%20143%20210%20148%20Q%20245%20153%20280%20148%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
  background-size: 280px 160px;
  animation: sideWave 46s linear infinite;
  will-change: transform;
}
.sidebar > * { position: relative; z-index: 1; }
@keyframes sideWave {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-280px, 0, 0); }
}
@media (prefers-reduced-motion: reduce) { .sidebar::before { animation: none; } }
.kpi { padding: 11px 13px; gap: 6px; }
.kpi__value { font-size: 20px; }
.kpi__ic { width: 26px; height: 26px; }
.kpi__foot { font-size: 11.5px; }
.chart-bars { height: 132px; gap: 10px; }
.chart-bars i { border-radius: 8px 8px 3px 3px; }

/* top bar: search, ask, theme, bell, account */
.topbar__actions { position: relative; }
.icon-btn--ask img { width: 26px; height: 26px; object-fit: contain; display: block; }
.acct-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 220px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md, 14px); box-shadow: var(--shadow-3); z-index: 60; }
.acct-menu p { margin: 0 0 8px; color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
/* Ask Nasaq panel */
.ask { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: flex-start; align-items: stretch; }
.ask[hidden] { display: none; }
.ask__scrim { position: absolute; inset: 0; background: rgba(21, 17, 26, .45); }
.ask__sheet { position: relative; width: min(420px, 100%); background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: var(--shadow-3); }
.ask__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ask__head h2 { margin: 0; flex: 1; font-size: 18px; color: var(--ink); }
.ask__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ask__hint { color: var(--ink-3); font-size: 14px; margin: 0; }
.ask__msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.7; font-size: 15px; overflow-wrap: anywhere; }
.ask__msg--me { align-self: flex-start; background: var(--brand); color: var(--on-brand); }
.ask__msg--bot { align-self: flex-end; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.ask__form { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.ask__form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font: inherit; }
@media (max-width: 640px) { .ask__sheet { width: 100%; } }

/* date field: DD/MM/YYYY text over a hidden native ISO input */
.datef { position: relative; display: inline-flex; align-items: center; }
.datef__txt { width: 150px; padding-left: 12px; padding-right: 38px; text-align: left; }
.datef__btn { position: absolute; right: 4px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--ink-3); }
.datef__btn svg { width: 18px; height: 18px; }
.datef__native { position: absolute; right: 4px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.kpi__sub { margin-top: 4px; font-size: 12px; color: var(--ink-3); }

.kpi--sm { display: flex; flex-direction: column; justify-content: flex-start; }

/* invoices list: one tidy row on phones */
.tbl--inv td:first-child b { white-space: nowrap; }
.inv-cust { display: none; }
.tbl-wrap { max-width: 100%; overflow-x: auto; }
table.tbl--day { min-width: 0; }
table.tbl tr.tbl__total td { border-top: 1px solid var(--line); font-weight: 500; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.card, .toolbar { min-width: 0; }
@media (max-width: 640px) {
  .tbl--inv .col-cust, .tbl--inv .col-time, .tbl--inv .col-pay { display: none; }
  .inv-cust { display: inline; }
  .topbar__actions .icon-btn { width: 34px; height: 34px; }
  .topbar__actions .icon-btn--ask img { width: 24px; height: 24px; }
}
/* invoice detail */
.modal .tbl { min-width: 0; width: 100%; }
.modal .tbl th, .modal .tbl td { padding-inline: 8px; }
.sum { margin: 14px 0 0; display: grid; gap: 6px; }
.sum > div { display: flex; justify-content: space-between; gap: 12px; }
.sum dt { color: var(--ink-3); } .sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.sum > div:nth-last-child(1), .sum__net { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 8px; }
.err { color: var(--bad); margin: 8px 0 0; }

/* status badges: colour is the state, the label and the dot shape say it too */
.badge--dot::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-inline-end: 6px; vertical-align: 1px; }
.badge--ring::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.badge--half::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px currentColor; }
.badge--cross::before { content: '×'; width: auto; height: auto; background: none; font-weight: 700; line-height: 1; margin-inline-end: 5px; }
@media (max-width: 420px) { .topbar__ic { display: none; } }

/* overview KPI cards: same height as every four-up row */
.kpis:not(.kpis--4) .kpi { padding: 9px 14px; gap: 3px; }
.kpis:not(.kpis--4) .kpi__value { font-size: 22px; line-height: 1.25; }
/* products */
.field__err { color: var(--bad); font-size: 12.5px; margin-top: 3px; }
.field--check { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 12px; }
.field--check input { width: 18px; height: 18px; min-height: 0; }
.tbl--prod td:first-child b { overflow-wrap: anywhere; }
@media (max-width: 640px) { .tbl--prod .col-code, .tbl--prod .col-cost, .tbl--prod .col-margin { display: none; } }

/* camera scan: field button and sheet */
.field__wrap { position: relative; display: flex; align-items: center; }
.field__wrap input { flex: 1; padding-inline-end: 44px; }
.field__cam { position: absolute; inset-inline-end: 2px; width: 38px; height: 38px; color: var(--ink-2); }
.scan { position: fixed; inset: 0; z-index: 95; background: rgba(21, 17, 26, .6); display: grid; place-items: center; padding: 16px; }
.scan__sheet { width: min(420px, 100%); background: var(--surface); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-3); }
.scan__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.scan__head h3 { flex: 1; margin: 0; font-size: 17px; }
.scan__view { position: relative; background: #000; aspect-ratio: 4 / 3; }
.scan__view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan__frame { position: absolute; inset: 22% 12%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); }
.scan__hint { margin: 0; padding: 12px 14px; text-align: center; color: var(--ink-2); font-size: 14px; }

.badge--mute { background: var(--surface-3); color: var(--ink-3); }

/* Accounting: the statement's total rows read as totals, not as another line. */
.tbl tr.row-total td { font-weight: 600; border-top: 1px solid var(--line-strong, var(--line)); }
.tbl td.is-neg, .tbl .dim { color: var(--ink-2); }

/* Staff: the per-person permission matrix. The role is the floor, the tick is the person. */
.perm-grid { display: grid; gap: 10px; max-height: 52vh; overflow: auto; padding-inline-end: 4px; }
.perm-group { display: block; }
.perm-group h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; text-align: start; }
.perm-row { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13px; color: var(--ink); cursor: pointer; }
.perm-row:hover { border-color: var(--line-strong); }
.perm-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.perm-row__from { font-size: 11.5px; color: var(--ink-3); }
