/* ===========================================================================
   ArkStore — Clean modern SaaS · RTL · Tajawal · 3 switchable directions
   (studio · crisp · warm) · emerald accent
   =========================================================================== */

:root {
  /* accent — emerald, shared across directions */
  --accent: #10b981;
  --accent-strong: #059669;
  --accent-press: #047857;
  --accent-soft: #ecfdf5;
  --accent-soft-2: #d1fae5;
  --on-accent: #ffffff;

  /* status palettes */
  --st-pending-t: #b45309;  --st-pending-bg: #fffbeb;  --st-pending-bd: #fde68a;
  --st-prog-t: #1d4ed8;     --st-prog-bg: #eff6ff;     --st-prog-bd: #bfdbfe;
  --st-done-t: #047857;     --st-done-bg: #ecfdf5;     --st-done-bd: #a7f3d0;
  --st-cancel-t: #be123c;   --st-cancel-bg: #fff1f2;   --st-cancel-bd: #fecdd3;
  --st-draft-t: #4b5563;    --st-draft-bg: #f3f4f6;    --st-draft-bd: #e5e7eb;
  --st-label-t: #6d28d9;    --st-label-bg: #f5f3ff;    --st-label-bd: #ddd6fe;
  --st-closed-t: #334155;   --st-closed-bg: #f1f5f9;   --st-closed-bd: #cbd5e1;
  --st-voda-t: #4338ca;     --st-voda-bg: #eef2ff;     --st-voda-bd: #c7d2fe;

  --sidebar-w: 244px;
  --ease: cubic-bezier(.2,.8,.3,1);
}

/* ── Direction: Studio (default · soft gray) ── */
:root, [data-direction="studio"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --inset: #f8f9fb;
  --border: #e7e9ed;
  --border-2: #dfe2e8;
  --text: #161a1f;
  --muted: #697079;
  --faint: #9aa1ab;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-raise: 0 4px 12px rgba(16,24,40,.08), 0 1px 3px rgba(16,24,40,.06);
  --shadow-pop: 0 18px 48px rgba(16,24,40,.18), 0 4px 12px rgba(16,24,40,.08);
  --pad: 16px;
}

/* ── Direction: Crisp (flat, border-driven, dense) ── */
[data-direction="crisp"] {
  --bg: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --inset: #fafafa;
  --border: #e7e7ea;
  --border-2: #dcdce0;
  --text: #18181b;
  --muted: #6e6e76;
  --faint: #a1a1aa;
  --radius: 9px;
  --radius-sm: 7px;
  --radius-pill: 7px;
  --shadow-card: none;
  --shadow-raise: 0 1px 2px rgba(0,0,0,.04);
  --shadow-pop: 0 16px 40px rgba(0,0,0,.14);
  --pad: 13px;
}

/* ── Direction: Warm (soft sand) ── */
[data-direction="warm"] {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #f7f3ec;
  --inset: #faf7f0;
  --border: #e9e2d4;
  --border-2: #ded5c3;
  --text: #20190f;
  --muted: #7c7160;
  --faint: #a89c87;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(76,60,30,.05), 0 2px 6px rgba(76,60,30,.05);
  --shadow-raise: 0 4px 14px rgba(76,60,30,.09);
  --shadow-pop: 0 18px 48px rgba(58,44,20,.20);
  --pad: 17px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  direction: rtl;
  font-family: 'Tajawal', system-ui, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s var(--ease), color .25s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--accent-soft-2); }

/* flat light background (replaces neon stage) */
.bg-stage { position: fixed; inset: 0; z-index: -2; background: var(--bg); }
.bg-stage .orb { display: none; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ============================ LAYOUT ============================ */
.app { display: flex; min-height: 100vh; }
.main-shell {
  flex: 1; min-width: 0;
  margin-right: var(--sidebar-w);
  padding: 26px clamp(16px, 3vw, 40px) 64px;
  max-width: 1320px;
  transition: margin .3s var(--ease);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--sidebar-w);
  z-index: 30; display: flex; flex-direction: column; gap: 2px;
  padding: 16px 12px;
  background: var(--surface);
  border-left: 1px solid var(--border);
}
.side-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; flex: none; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
  color: var(--on-accent); background: linear-gradient(150deg, var(--accent), var(--accent-strong));
  box-shadow: var(--shadow-raise);
}
.brand-title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { font-size: 10.5px; color: var(--faint); font-weight: 600; letter-spacing: 2px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; margin-top: 0;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; }
.nav-list::-webkit-scrollbar { width: 0; display: none; }
.nav-sec { font-size: 10px; font-weight: 700; color: var(--faint); letter-spacing: .06em;
  text-transform: uppercase; padding: 10px 11px 4px; }
.nav-sec:first-child { padding-top: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 11px; border-radius: var(--radius-sm); flex: none;
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item .ic { font-size: 17px; width: 20px; text-align: center; flex: none; filter: grayscale(.15); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-press); }
[data-direction="crisp"] .nav-item.active { background: var(--surface-2); color: var(--text); }
[data-direction="crisp"] .nav-item.active::before {
  content: ""; position: absolute; inset: 7px -1px 7px auto; width: 3px; border-radius: 99px; background: var(--accent); }
.nav-badge { margin-inline-start: auto; min-width: 20px; height: 19px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 99px;
  background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; }
.nav-item.active .nav-badge { background: var(--accent-soft-2); color: var(--accent-press); }

/* ---------- top-left tools (theme switcher + profile) ---------- */
.top-tools { position: fixed; top: 14px; left: 22px; z-index: 35; display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-pill); }
.seg-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 13px; border: 0;
  background: transparent; border-radius: var(--radius-pill); color: var(--muted);
  font-size: 12.5px; font-weight: 700; transition: background .15s, color .15s, box-shadow .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
[data-direction="crisp"] .seg-btn.active { box-shadow: 0 0 0 1px var(--border-2) inset; }
.user-av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: var(--accent-press); background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2); }

/* hide old dark/light toggle bits if present */
.theme-toggle, .toggle-track, .toggle-knob { display: none !important; }

/* ============================ PAGE HEADER / TYPE ============================ */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px; }
.page-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-strong); margin-bottom: 6px; }
.page-title { font-size: clamp(21px, 3vw, 27px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.page-subtitle { color: var(--muted); font-size: 13.5px; margin-top: 5px; font-weight: 500; }
.gradient-text { color: var(--text); }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-family: inherit; font-weight: 700; font-size: 13.5px; white-space: nowrap;
  color: var(--on-accent); background: var(--accent); box-shadow: var(--shadow-card);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--accent-strong); }
.btn:active { background: var(--accent-press); transform: translateY(.5px); }
.btn .ic { font-size: 15px; }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: transparent; box-shadow: none; }
.btn.secondary:hover { background: var(--border); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--surface); color: var(--st-cancel-t); border-color: var(--st-cancel-bd); box-shadow: none; }
.btn.danger:hover { background: var(--st-cancel-bg); }
.btn.sm { height: 31px; padding: 0 12px; font-size: 12.5px; gap: 5px; }
.btn.block { width: 100%; }

.icon-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 15px;
  transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--st-cancel-t); border-color: var(--st-cancel-bd); background: var(--st-cancel-bg); }

/* ============================ PANELS ============================ */
.glass, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); }
.panel { padding: 16px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title h3 { font-size: 15px; font-weight: 800; }
.panel-title .hint { font-size: 12px; color: var(--faint); font-weight: 500; }
.section-gap { margin-top: 26px; }

/* ============================ KPI / STAT CARDS ============================ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.compact-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi { position: relative; padding: var(--pad); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 10px; transition: box-shadow .16s, border-color .16s, transform .16s; }
.kpi:hover { box-shadow: var(--shadow-raise); border-color: var(--border-2); transform: translateY(-2px); }
.kpi::before { display: none; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-head { display: flex; align-items: center; gap: 10px; }
.kpi-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-size: 17px; flex: none; background: var(--accent-soft); color: var(--accent-strong);
  border: none; box-shadow: none; }
.kpi-trend { font-size: 12px; font-weight: 700; padding: 0; border-radius: 0; background: none;
  color: var(--accent-strong); display: inline-flex; align-items: center; gap: 3px; }
.kpi-trend.down { color: var(--st-cancel-t); background: none; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 700; margin: 0; }
.kpi.compact .kpi-label { font-size: 13px; }
.kpi-value { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.kpi.compact .kpi-value { font-size: 26px; margin-top: 2px; }
.kpi-spark { display: none; }

/* ============================ TABS ============================ */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); box-shadow: var(--shadow-card); width: fit-content; margin-bottom: 20px; }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border: 0;
  background: transparent; border-radius: var(--radius-pill); color: var(--muted); font-family: inherit;
  font-weight: 700; font-size: 13px; transition: background .15s, color .15s; }
.tab .count { font-size: 11.5px; opacity: .85; font-weight: 800; padding: 0; background: none; color: inherit; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.tab.active::after { display: none; }
[data-direction="crisp"] .tab.active { background: var(--text); color: var(--surface); }

.cat-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.cat-tab { height: 30px; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--muted); font-family: inherit; font-weight: 700; font-size: 12.5px;
  transition: all .15s; }
.cat-tab:hover { color: var(--text); border-color: var(--border-2); }
.cat-tab.active { background: var(--accent-soft); color: var(--accent-press); border-color: var(--accent-soft-2); }

/* ============================ PRODUCTION ORDER CARDS ============================ */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.order-card { position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); overflow: visible; cursor: pointer;
  transition: box-shadow .18s, border-color .18s, transform .18s; }
.order-card:hover { box-shadow: var(--shadow-raise); border-color: var(--border-2); transform: translateY(-2px); }
.order-card::before, .order-card::after { display: none; }
.order-card.delayed { border-color: var(--st-pending-bd); }

.oc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-bottom: 1px solid var(--border); }
.oc-idwrap { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.oc-id { font-weight: 800; font-size: 12px; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.oc-customer { font-size: 14.5px; font-weight: 800; margin-top: 8px; }
.oc-phone { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.oc-status { font-size: 11.5px; font-weight: 700; padding: 0 9px; height: 24px; border-radius: var(--radius-pill);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  color: var(--oc-t); background: var(--oc-bg); border: 1px solid var(--oc-bd); }
.oc-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: none; }

.oc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 13px 15px; }
.oc-field-label { font-size: 11px; font-weight: 700; color: var(--faint); margin-bottom: 7px;
  display: flex; align-items: center; gap: 5px; }
.oc-items { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.oc-items li { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 600; }
.oc-it-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-it-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.oc-it-price { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.oc-items li b { font-size: 12px; font-weight: 800; color: var(--muted); }
.oc-sub { font-size: 13px; font-weight: 700; margin-top: 4px; }
.oc-sub.muted { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.oc-col-right { display: flex; flex-direction: column; min-width: 0; }
.oc-notes { border-radius: var(--radius-sm); padding: 9px 10px; background: var(--inset);
  border: 1px solid var(--border); flex: 1; min-height: 60px; }
.oc-notes p { font-size: 12px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.oc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 15px; border-top: 1px solid var(--border); background: var(--inset); }
.oc-total { font-size: 15px; font-weight: 800; color: var(--text); }
.oc-total span { font-size: 11px; color: var(--faint); font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 1px; }
.oc-strike { font-size: 12px; color: var(--faint); font-weight: 600; text-decoration: line-through; }
.oc-disc { font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: var(--radius-pill);
  color: var(--st-done-t); background: var(--st-done-bg); border: 1px solid var(--st-done-bd); }
.oc-date { font-size: 11.5px; color: var(--faint); text-align: left; }
.oc-actions { display: flex; align-items: stretch; gap: 7px; padding: 0 15px 14px; flex-wrap: wrap; }
.oc-actions .btn { flex: 1; }
.oc-actions .icon-btn { width: auto; min-width: 38px; align-self: stretch; height: auto; }
.oc-flag { position: absolute; top: 13px; left: 15px; font-size: 14px; }

.select-pill { font-family: inherit; font-weight: 700; font-size: 12.5px; padding: 0 10px; height: 31px;
  line-height: 31px; padding-block: 0; vertical-align: middle;
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  border: 1px solid var(--border-2); cursor: pointer; }

/* ============================ TILES (products / customers) ============================ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: var(--pad);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); cursor: pointer; overflow: hidden;
  transition: box-shadow .16s, border-color .16s, transform .16s; }
.tile:hover { box-shadow: var(--shadow-raise); border-color: var(--border-2); transform: translateY(-2px); }
.tile-top { display: flex; align-items: center; gap: 12px; }
.tile-av { width: 42px; height: 42px; border-radius: var(--radius-sm); flex: none; display: grid; place-items: center;
  font-size: 17px; font-weight: 800; color: var(--accent-press); background: var(--accent-soft); box-shadow: none; }
.tile-cat { font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: .02em; }
.tile-name { font-size: 14.5px; font-weight: 800; margin-top: 1px; line-height: 1.25; }
.tile-meta { font-size: 12.5px; color: var(--muted); }
.tile-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-price { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.tile-actions { display: flex; gap: 7px; }
.chip { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.chip.wa { color: #25923c; border-color: #bbe6c4; background: #f0fbf2; text-decoration: none; }

/* tier stars */
.tier-row { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.tier { display: inline-flex; align-items: center; gap: 2px; }
.tier-name { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .2px; }
.star { display: block; }
.star.on { fill: #f59e0b; }
.star.off { fill: none; stroke: var(--border-2); stroke-width: 1.6; }
.star-extra { font-size: 10px; font-weight: 800; color: #f59e0b; margin-inline-start: 2px; }

/* ============================ TOOLBAR / SEARCH ============================ */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search input { width: 100%; height: 38px; padding: 0 40px 0 14px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .ic { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 15px; }

/* ============================ TABLE ============================ */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
.tbl th { text-align: right; font-size: 11.5px; font-weight: 800; color: var(--faint); letter-spacing: .02em;
  text-transform: uppercase; padding: 11px 16px; background: var(--inset); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 16px; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td .badge { white-space: nowrap; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: none; }

.badge { font-size: 12px; font-weight: 700; padding: 0 9px; height: 24px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 6px; color: var(--oc-t); background: var(--oc-bg); border: 1px solid var(--oc-bd); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* status token helpers — set --oc-t/bg/bd used by .oc-status & .badge */
.st-pending      { --oc-t: var(--st-draft-t);   --oc-bg: var(--st-draft-bg);   --oc-bd: var(--st-draft-bd); }
.st-in_progress  { --oc-t: var(--st-prog-t);    --oc-bg: var(--st-prog-bg);    --oc-bd: var(--st-prog-bd); }
.st-completed    { --oc-t: var(--st-done-t);    --oc-bg: var(--st-done-bg);    --oc-bd: var(--st-done-bd); }
.st-ready        { --oc-t: var(--st-label-t);   --oc-bg: var(--st-label-bg);   --oc-bd: var(--st-label-bd); }
.st-delivered    { --oc-t: var(--st-closed-t);  --oc-bg: var(--st-closed-bg);  --oc-bd: var(--st-closed-bd); }
.st-delivered_vodafone { --oc-t: var(--st-voda-t); --oc-bg: var(--st-voda-bg); --oc-bd: var(--st-voda-bd); }
.st-uncollected  { --oc-t: var(--st-pending-t); --oc-bg: var(--st-pending-bg); --oc-bd: var(--st-pending-bd); }
.st-cancelled    { --oc-t: var(--st-cancel-t);  --oc-bg: var(--st-cancel-bg);  --oc-bd: var(--st-cancel-bd); }

/* ============================ FORMS ============================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.field label .req { color: var(--st-cancel-t); }
.input, .textarea, select.input {
  width: 100%; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 78px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none;
  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='%23697079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-inline-start: 36px; }
select.input, .select-pill { color-scheme: light; }
select.input option, .select-pill option { background: var(--surface); color: var(--text); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.wide { grid-column: 1 / -1; }

.added-items { display: flex; flex-direction: column; gap: 8px; max-height: 180px; overflow-y: auto; overflow-x: hidden; padding: 2px; }
.added-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--border); }
.added-item .nm { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.added-item .px { font-size: 12px; color: var(--muted); }
.added-item .rm { cursor: pointer; color: var(--st-cancel-t); background: none; border: none; font-size: 18px; line-height: 1; }
.empty-items { text-align: center; padding: 16px; color: var(--faint); font-size: 13px; border: 1.5px dashed var(--border-2); border-radius: var(--radius-sm); }

.price-summary { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius-sm);
  background: var(--inset); border: 1px solid var(--border); }
.ps-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.ps-row b { color: var(--text); font-weight: 700; }
.ps-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.ps-row.total b { font-weight: 800; }

/* ============================ MODAL ============================ */
.modal-root { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(20,24,31,.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  visibility: hidden; pointer-events: none; }
.modal-root.open { visibility: visible; pointer-events: auto; animation: fade .15s ease; }
.modal-card { width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; overflow-x: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow-pop); padding: 0; animation: pop .18s var(--ease); }
.modal-card.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { font-size: 16.5px; font-weight: 800; color: var(--text); }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; font-weight: 500; }
.modal-body { padding: 20px; }
.close-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 19px; cursor: pointer; display: grid; place-items: center;
  flex: none; transition: all .15s; }
.close-btn:hover { color: var(--st-cancel-t); border-color: var(--st-cancel-bd); background: var(--st-cancel-bg); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--inset); position: sticky; bottom: 0; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.detail-cell { padding: 12px; border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--border); }
.detail-cell .lbl { font-size: 11px; color: var(--faint); font-weight: 700; margin-bottom: 4px; }
.detail-cell .val { font-size: 14px; font-weight: 800; }
.detail-cell.accent .val { color: var(--accent-strong); }

/* ============================ TOAST ============================ */
.toast-wrap { position: fixed; top: 18px; left: 24px; z-index: 90; display: flex; flex-direction: column; gap: 8px;
  align-items: flex-start; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; background: var(--text); color: var(--surface);
  box-shadow: var(--shadow-pop); animation: toastIn .22s var(--ease); }
.toast.hide { opacity: 0; transform: translateX(-12px); transition: opacity .3s, transform .3s; }
.toast .tic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; flex: none;
  background: rgba(255,255,255,.15); color: var(--accent); }
.toast.success .tic { color: #6ee7b7; }
.toast.error .tic { color: #fda4af; }
.toast.info .tic { color: #93c5fd; }

/* ============================ HERO / QUICK ============================ */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.hero::before { display: none; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700;
  color: var(--accent-press); padding: 4px 11px; border-radius: var(--radius-pill);
  background: var(--accent-soft); border: 1px solid var(--accent-soft-2); margin-bottom: 14px; }
.hero h1 { font-size: clamp(20px, 3vw, 28px); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 56ch; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.quick { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card);
  transition: box-shadow .16s, border-color .16s, transform .16s; position: relative; }
.quick:hover { box-shadow: var(--shadow-raise); border-color: var(--border-2); transform: translateY(-2px); }
.quick .qic { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-size: 18px; flex: none; background: var(--accent-soft); color: var(--accent-strong); border: none; }
.quick h4 { font-size: 14px; font-weight: 800; }
.quick p { font-size: 12px; color: var(--muted); }
.quick .arrow { margin-inline-start: auto; color: var(--faint); font-size: 17px; transition: transform .2s var(--ease); }
.quick:hover .arrow { transform: translateX(-4px); color: var(--text); }

/* ============================ CHART (reports) ============================ */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 8px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: var(--accent);
  position: relative; transition: opacity .15s; }
.chart-bar:hover { opacity: .82; }
.chart-bar:hover::after { content: attr(data-v); position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; color: var(--text); background: var(--surface); padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--border); box-shadow: var(--shadow-card); white-space: nowrap; }
.chart-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.chart-val { font-size: 11px; font-weight: 800; color: var(--text); white-space: nowrap; }

/* ============================ DONUT CHART ============================ */
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; padding: 8px 4px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 180px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.donut-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.donut-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-pct { color: var(--muted); font-weight: 800; font-size: 12px; }

/* ============================ REVENUE / COLLECTION ============================ */
.fin-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.fin-sub { font-size: 14px; font-weight: 800; color: var(--accent-strong); margin-top: 6px; }

.rev-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 18px; }
.rt-group { display: flex; flex-direction: column; gap: 6px; }
.rt-group label { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.rt-group .input { min-width: 150px; }
.rt-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 2px; }

.rev-panel { padding: 4px; }
.rev-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; flex-wrap: wrap; }
.rev-head-sub { font-size: 12px; font-weight: 700; color: var(--faint); margin-bottom: 3px; }
.rev-head-title { font-size: 18px; font-weight: 800; }
.rev-head-total { font-size: 24px; font-weight: 800; color: var(--accent-strong); letter-spacing: -.02em; }
.rev-cols { display: grid; grid-template-columns: 1.3fr 1.6fr 1.2fr auto; gap: 14px; padding: 9px 16px;
  font-size: 11px; font-weight: 800; color: var(--faint); text-transform: uppercase; border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); background: var(--inset); }
.rev-cols span:last-child { text-align: left; }
.rev-rows { display: flex; flex-direction: column; }
.rev-row { display: grid; grid-template-columns: 1.3fr 1.6fr 1.2fr auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.rev-row:last-child { border-bottom: none; }
.rev-row:hover { background: var(--surface-2); }
.rev-name { font-size: 13.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rev-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--oc-t); }
.rev-prod { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rev-date { font-size: 12px; color: var(--faint); font-weight: 600; }
.rev-price { font-size: 15px; font-weight: 800; color: var(--accent-strong); text-align: left; white-space: nowrap; }

.qr-cols { grid-template-columns: 1.3fr 1.5fr 1.1fr auto auto; }
.qr-row { grid-template-columns: 1.3fr 1.5fr 1.1fr auto auto; }
.qr-row-btn { white-space: nowrap; }
.col-phone { font-size: 11.5px; color: var(--faint); font-weight: 600; margin-inline-start: 4px; }
.col-due { color: var(--st-pending-t) !important; }
.col-tile .col-arrow { margin-inline-start: auto; color: var(--faint); font-size: 17px; transition: transform .2s var(--ease); }
.col-tile:hover .col-arrow { transform: translateX(-4px); color: var(--text); }
.col-tile { border-color: var(--st-pending-bd); }
.col-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.col-head-av { width: 52px; height: 52px; border-radius: var(--radius-sm); flex: none; display: grid; place-items: center;
  color: var(--st-pending-t); background: var(--st-pending-bg); border: 1px solid var(--st-pending-bd); }
.col-head-name { font-size: 19px; font-weight: 800; }
.col-head-meta { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.col-lines { display: flex; flex-direction: column; gap: 9px; }
.col-line { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--inset); border: 1px solid var(--border); }
.col-line-info { flex: 1; min-width: 0; }
.col-line-id { font-size: 12px; font-weight: 800; color: var(--st-pending-t); }
.col-part { font-size: 10.5px; font-weight: 700; color: var(--accent-press); background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2); padding: 1px 7px; border-radius: var(--radius-pill); margin-inline-start: 6px; }
.col-line-prod { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-line-date { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.col-line-amt { font-size: 16px; font-weight: 800; color: var(--st-pending-t); white-space: nowrap; }

/* ============================ VODAFONE CASH ============================ */
.voda-head { display: grid; grid-template-columns: 1.5fr 1.3fr .85fr 1.9fr; gap: 14px; align-items: center;
  padding: 11px 18px; background: var(--inset); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 800; color: var(--faint); text-transform: uppercase; letter-spacing: .02em; }
.voda-rows { display: flex; flex-direction: column; }
.voda-row { display: grid; grid-template-columns: 1.5fr 1.3fr .85fr 1.9fr; gap: 14px; align-items: center;
  padding: 11px 18px; border-bottom: 1px solid var(--border); }
.voda-row:last-child { border-bottom: none; }
.voda-row.matched { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
.voda-wallet { display: flex; align-items: center; gap: 9px; min-width: 0; }
.voda-ic { width: 30px; height: 30px; flex: none; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-size: 15px; background: var(--accent-soft); }
.voda-num { font-size: 14px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; }
.voda-auto { font-size: 10px; font-weight: 800; color: var(--accent-press); background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2); padding: 1px 7px; border-radius: var(--radius-pill); white-space: nowrap; }
.voda-date { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.voda-amount { font-size: 15.5px; font-weight: 800; color: var(--accent-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.voda-assign { display: flex; align-items: center; gap: 8px; min-width: 0; }
.voda-select { min-height: 34px; height: 34px; padding-block: 0; line-height: 34px; font-size: 13px; flex: 1; min-width: 0; }
.voda-assign .btn { flex: none; }
.voda-assigned { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 800; color: var(--accent-press); }
.voda-cname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voda-edit-btn { width: 28px; height: 28px; font-size: 13px; flex: none; margin-inline-start: auto; }
.voda-check { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; background: var(--accent); color: var(--on-accent); }
@media (max-width: 760px) {
  .voda-head { display: none; }
  .voda-row { grid-template-columns: 1fr auto; gap: 6px 14px; padding: 13px 16px;
    grid-template-areas: "wallet amount" "date amount" "assign assign"; }
  .voda-wallet { grid-area: wallet; }
  .voda-date { grid-area: date; }
  .voda-amount { grid-area: amount; align-self: start; text-align: left; font-size: 17px; }
  .voda-assign, .voda-assigned { grid-area: assign; margin-top: 6px; }
}

/* ============================ LIFECYCLE (details modal) ============================ */
.lifecycle { margin-bottom: 20px; }
.lc-track { display: flex; align-items: flex-start; gap: 0; padding: 4px 2px 2px; position: relative; }
.lc-rail { position: absolute; top: 18px; inset-inline: calc(100% / 10) calc(100% / 10); height: 3px;
  background: var(--border-2); border-radius: 4px; z-index: 0; }
.lc-rail-fill { position: absolute; top: 18px; inset-inline-start: calc(100% / 10); height: 3px;
  background: var(--accent); border-radius: 4px; z-index: 0; transition: width .4s var(--ease); max-width: 80%; }
.lc-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; position: relative; min-width: 0; text-align: center; z-index: 1; }
.lc-step::before { display: none; }
.lc-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-2); color: var(--faint);
  transition: all .3s var(--ease); }
.lc-dot svg { width: 17px; height: 17px; }
.lc-step.done .lc-dot { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.lc-step.current .lc-dot { border-color: var(--accent); color: var(--on-accent); background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft); }
.lc-lbl { font-size: 11.5px; font-weight: 700; color: var(--faint); white-space: nowrap; letter-spacing: -.2px; }
.lc-step.done .lc-lbl { color: var(--muted); }
.lc-step.current .lc-lbl { color: var(--text); font-weight: 800; }

.lc-bar { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--accent-soft-2); }
.lc-bar.is-done { background: var(--st-label-bg); border-color: var(--st-label-bd); }
.lc-btn { flex: none; }
.lc-done-badge { flex: none; font-weight: 800; font-size: 13.5px; color: var(--st-label-t);
  padding: 9px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--st-label-bd); }
.lc-bar-info { flex: 1; min-width: 0; text-align: right; }
.lc-bar-title { font-size: 15px; font-weight: 800; color: var(--accent-press); }
.lc-bar.is-done .lc-bar-title { color: var(--st-label-t); }
.lc-bar-next { font-size: 12.5px; color: var(--accent-strong); font-weight: 600; margin-top: 2px; }
.lc-bar-ic { width: 34px; height: 34px; flex: none; color: var(--accent-strong); opacity: .9; }
.lc-bar.is-done .lc-bar-ic { color: var(--st-label-t); }
.lc-bar-ic svg { width: 100%; height: 100%; }

/* ============================ QR LANDING (delivery preview) ============================ */
.qr-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.qr-side-h { display: flex; align-items: center; gap: 11px; }
.qr-side-ic { font-size: 22px; }
.modal-card.qr-modal-card { max-width: 500px; }
.qr-modal { display: flex; justify-content: center; align-items: center; }
.qr-phone { width: 100%; max-width: 360px; margin: 0 auto; border-radius: 28px; background: var(--text); padding: 12px; box-shadow: var(--shadow-pop); }
.qr-phone-notch { width: 110px; height: 22px; background: var(--text); border-radius: 0 0 14px 14px; margin: -12px auto 8px; }
.qr-screen { background: var(--surface); border-radius: 18px; min-height: 460px; padding: 22px 18px; overflow: hidden; }
.qr-brand { display: flex; align-items: center; gap: 9px; justify-content: center; margin-bottom: 16px; }
.qr-brand-t { font-weight: 800; font-size: 14px; }
.qr-brand-s { font-size: 10px; color: var(--faint); letter-spacing: 2px; }
.qr-greet { font-size: 16px; font-weight: 800; text-align: center; margin-bottom: 14px; }
.qr-order-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; background: var(--inset); }
.qr-order-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qr-order-id { font-size: 12px; font-weight: 800; color: var(--muted); }
.qr-order-total { font-size: 18px; font-weight: 800; color: var(--accent-strong); }
.qr-items { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.qr-items li { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); }
.qr-choices { display: flex; flex-direction: column; gap: 10px; }
.qr-choice { display: flex; align-items: center; gap: 11px; width: 100%; padding: 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-2); background: var(--surface); cursor: pointer; text-align: right; transition: all .15s; }
.qr-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.qr-choice .qc-ic { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.qr-choice.paid .qc-ic { background: var(--st-done-bg); color: var(--st-done-t); }
.qr-choice.free .qc-ic { background: var(--st-pending-bg); color: var(--st-pending-t); }
.qr-choice b { font-size: 14px; font-weight: 800; display: block; }
.qr-choice span { font-size: 11.5px; color: var(--muted); }
.qr-choice.armed { border-color: var(--accent); background: var(--accent); animation: armPulse 1.2s ease-in-out infinite; }
.qr-choice.armed .qr-choice-t { color: var(--on-accent); }
.qr-choice.armed .qr-choice-s { color: rgba(255,255,255,.85); }
.qr-choice.armed .qr-choice-ic { background: rgba(255,255,255,.2); }
.qr-choice.free.armed { border-color: var(--st-pending-t); background: var(--st-pending-t); }
@keyframes armPulse { 50% { box-shadow: 0 0 0 4px var(--accent-soft); } }
.qr-success { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 6px; }
.qr-check { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; }
.qr-check.paid { background: var(--st-done-bg); color: var(--st-done-t); }
.qr-check.free { background: var(--st-pending-bg); color: var(--st-pending-t); }
.qr-success h2 { font-size: 18px; font-weight: 800; }
.qr-success p { font-size: 13px; color: var(--muted); }
.qr-rcpt { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; padding: 14px; border-radius: var(--radius-sm); background: var(--inset); border: 1px solid var(--border); }
.qr-rcpt > div { display: flex; justify-content: space-between; font-size: 13px; }
.qr-rcpt span { color: var(--muted); font-weight: 600; }
.qr-rcpt b { font-weight: 800; }
.qr-rcpt b.ok { color: var(--st-done-t); }
.qr-rcpt b.warn { color: var(--st-pending-t); }
.qr-phone-col { display: flex; justify-content: center; }

/* ============================ EMPTY / MISC ============================ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .em { font-size: 40px; margin-bottom: 10px; opacity: .55; }
.empty-state h3 { font-size: 15px; color: var(--text); font-weight: 800; margin-bottom: 5px; }
.empty-state p { font-size: 12.5px; }
.fade-view { animation: viewIn .26s ease; }

/* confetti */
.confetti { position: fixed; top: -10px; width: 9px; height: 13px; z-index: 120; pointer-events: none; border-radius: 2px;
  animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(680deg); opacity: .3; } }

.loader { display: flex; gap: 6px; justify-content: center; padding: 40px; }
.loader i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease infinite; }
.loader i:nth-child(2) { animation-delay: .15s; }
.loader i:nth-child(3) { animation-delay: .3s; }

@keyframes fade { from { opacity: .35; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); } to { transform: none; } }
@keyframes toastIn { from { transform: translateX(-12px); } to { transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes viewIn { from { transform: translateY(6px); } to { transform: none; } }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .oc-body { grid-template-columns: 1fr; } .qr-layout { grid-template-columns: 1fr; } }
@media (max-width: 880px) {
  .main-shell { margin-right: 0; padding: 20px 16px 92px; }
  .sidebar { top: auto; bottom: 0; right: 0; left: 0; width: auto; height: auto; flex-direction: row;
    padding: 8px 10px; border-left: none; border-top: 1px solid var(--border); gap: 4px; }
  .side-head, .nav-sec, .nav-badge { display: none; }
  .nav-list { flex-direction: row; width: 100%; justify-content: space-between; gap: 2px; overflow: visible; }
  .nav-item { flex-direction: column; gap: 3px; height: auto; padding: 7px 6px; font-size: 10.5px; flex: 1; white-space: nowrap; }
  .top-tools { top: 10px; left: 12px; }
  .seg-btn { padding: 0 9px; font-size: 11.5px; }
  .form-grid, .detail-grid, .quick-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid-5, .kpi-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kpi-grid, .compact-grid { grid-template-columns: 1fr; }
  .kpi-grid-5, .kpi-grid-3 { grid-template-columns: 1fr; }
  .lc-lbl { font-size: 10px; }
  .lc-dot { width: 32px; height: 32px; }
  .lc-bar { flex-wrap: wrap; }
  .lc-btn { order: 3; width: 100%; }
}
