/* ==========================================================================
   SuperPOS — Design System v1
   Layers: tokens → base → shell (sidebar/topbar) → components → pages → print
   Bootstrap 5 is used ONLY for reboot + grid + utilities. Every visual
   component below is custom.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --primary: #7c5cff;
  --primary-2: #d946ef;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #f43f5e;
  --info: #3b82f6;

  --bg: #f3f4fa;
  --bg-glow-1: color-mix(in oklab, var(--primary) 16%, transparent);
  --bg-glow-2: color-mix(in oklab, var(--accent) 12%, transparent);
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --surface-3: #eff1f8;
  --surface-glass: rgba(255, 255, 255, .72);
  --border: #e6e8f1;
  --border-strong: #d6dae8;
  --text: #0e1124;
  --text-2: #464c6c;
  --text-3: #6f7596;
  --on-primary: #fff;

  --primary-soft: color-mix(in oklab, var(--primary) 11%, transparent);
  --primary-soft-2: color-mix(in oklab, var(--primary) 20%, transparent);
  --primary-text: color-mix(in oklab, var(--primary) 82%, #000);
  --grad: linear-gradient(135deg, var(--primary) 0%, var(--primary) 35%, var(--primary-2) 130%);
  --grad-soft: linear-gradient(135deg, color-mix(in oklab, var(--primary) 14%, transparent), color-mix(in oklab, var(--primary-2) 10%, transparent));

  --shadow-xs: 0 1px 2px rgba(16, 20, 50, .05);
  --shadow-sm: 0 1px 2px rgba(16, 20, 50, .04), 0 2px 8px -2px rgba(16, 20, 50, .06);
  --shadow-md: 0 2px 4px rgba(16, 20, 50, .04), 0 12px 28px -8px rgba(16, 20, 50, .12);
  --shadow-lg: 0 4px 8px rgba(16, 20, 50, .04), 0 28px 60px -12px rgba(16, 20, 50, .22);
  --shadow-primary: 0 8px 22px -6px color-mix(in oklab, var(--primary) 55%, transparent);

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  /* default = "esports" preset; overridden per html[data-font] below */
  --font: "Chakra Petch", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Oxanium", var(--font);
  --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --display-track: .01em;
  --display-weight: 700;
  --stat-size: 1.85rem;

  --sb-w: 272px;
  --sb-w-collapsed: 84px;
  --tb-h: 68px;
  --gutter: 28px;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur: .22s;

  --z-sidebar: 40;
  --z-topbar: 30;
  --z-dropdown: 60;
  --z-drawer: 80;
  --z-modal: 90;
  --z-toast: 100;
  --z-progress: 110;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #080914;
  --bg-glow-1: color-mix(in oklab, var(--primary) 22%, transparent);
  --bg-glow-2: color-mix(in oklab, var(--accent) 12%, transparent);
  --surface: #10121f;
  --surface-2: #151829;
  --surface-3: #1b1f34;
  --surface-glass: rgba(16, 18, 31, .72);
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #eef0fb;
  --text-2: #aab0cf;
  --text-3: #7c83a9;

  --primary-soft: color-mix(in oklab, var(--primary) 16%, transparent);
  --primary-soft-2: color-mix(in oklab, var(--primary) 28%, transparent);
  --primary-text: color-mix(in oklab, var(--primary) 55%, #fff);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px -2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 30px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, .3), 0 30px 70px -12px rgba(0, 0, 0, .7);

  color-scheme: dark;
}

/* ---------- 1b. Font presets (Settings → Appearance) ---------- */
html[data-font="esports"]  { --font: "Chakra Petch", system-ui, sans-serif; --font-display: "Oxanium", sans-serif; --display-track: .01em; --display-weight: 700; --stat-size: 1.85rem; }
html[data-font="arena"]    { --font: "Exo 2", system-ui, sans-serif; --font-display: "Orbitron", sans-serif; --display-track: .03em; --display-weight: 700; --stat-size: 1.5rem; }
html[data-font="tactical"] { --font: "Saira", system-ui, sans-serif; --font-display: "Russo One", sans-serif; --display-track: .02em; --display-weight: 400; --stat-size: 1.75rem; }
html[data-font="neon"]     { --font: "Exo 2", system-ui, sans-serif; --font-display: "Audiowide", sans-serif; --display-track: .02em; --display-weight: 400; --stat-size: 1.6rem; }
html[data-font="clean"]    { --font: "Plus Jakarta Sans", system-ui, sans-serif; --font-display: "Space Grotesk", sans-serif; --font-mono: "JetBrains Mono", monospace; --display-track: -.02em; --display-weight: 600; --stat-size: 1.85rem; }

/* ---------- 2. Base ---------- */
html { font-size: 14.5px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
body::before {
  /* ambient mesh glow — sits behind everything */
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 88% -8%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 480px at -5% 105%, var(--bg-glow-2), transparent 60%);
}
html[data-theme="dark"] body::after {
  /* faint tech grid in dark mode only */
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 60% 0%, #000 0%, transparent 70%);
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); color: var(--text); margin: 0; }
p { margin: 0; }
::selection { background: var(--primary-soft-2); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
i.ph-duotone { display: inline-grid; place-items: center; }
i.ph-duotone::before, i.ph-duotone::after { grid-area: 1 / 1; margin-left: 0 !important; }
.num, .money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.text-2 { color: var(--text-2) !important; }
.text-3 { color: var(--text-3) !important; }
.text-primary-c { color: var(--primary-text) !important; }
.text-success-c { color: var(--success) !important; }
.text-danger-c { color: var(--danger) !important; }
.text-warning-c { color: var(--warning) !important; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.fs-xs { font-size: .78rem; } .fs-sm { font-size: .87rem; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- 3. Top progress bar ---------- */
.sp-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: var(--z-progress);
  background: linear-gradient(90deg, var(--accent), var(--primary), var(--primary-2));
  box-shadow: 0 0 12px var(--primary), 0 0 4px var(--primary);
  border-radius: 0 3px 3px 0; opacity: 0; transition: width .25s ease, opacity .3s ease;
}
.sp-progress.is-active { opacity: 1; }
.sp-progress::after {
  content: ""; position: absolute; right: 0; top: -3px; width: 90px; height: 9px;
  background: radial-gradient(closest-side, var(--primary-2), transparent); filter: blur(2px);
}

/* ---------- 4. App shell ---------- */
.sp-app { min-height: 100dvh; }
.sp-main {
  margin-left: calc(var(--sb-w) + 16px);
  transition: margin-left .35s var(--ease-out);
  min-height: 100dvh; display: flex; flex-direction: column;
}
.sb-collapsed .sp-main { margin-left: calc(var(--sb-w-collapsed) + 16px); }
.sp-content { padding: 8px var(--gutter) 40px; flex: 1; width: 100%; max-width: 1760px; }

/* Sidebar — floating panel */
.sb {
  position: fixed; top: 12px; bottom: 12px; left: 12px; width: var(--sb-w);
  z-index: var(--z-sidebar);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: width .35s var(--ease-out), transform .35s var(--ease-out);
}
html[data-theme="dark"] .sb { background: linear-gradient(180deg, #121428, #0d0f1d); }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; min-height: 72px; }
.sb-logo {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 22px; box-shadow: var(--shadow-primary);
  position: relative; overflow: hidden;
}
.sb-logo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-100%); animation: shine 5s ease-in-out infinite; }
@keyframes shine { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.sb-logo img { width: 100%; height: 100%; object-fit: cover; }
.sb-title { min-width: 0; line-height: 1.2; }
.sb-title strong { display: block; font-family: var(--font-display); font-size: 1.08rem; letter-spacing: var(--display-track); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-title span { font-size: .74rem; color: var(--text-3); white-space: nowrap; }
.sb-toggle {
  margin-left: auto; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer;
  transition: transform .35s var(--ease-out), background .2s;
}
.sb-toggle:hover { background: var(--primary-soft); color: var(--primary-text); }
.sb-collapsed .sb-toggle { transform: rotate(180deg); }

.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 12px 12px; }
.sb-section { font-family: var(--font-display); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 16px 12px 8px; white-space: nowrap; }
.sb-item { position: relative; }
.sb-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; margin: 2px 0; border-radius: 12px; border: 0; background: none;
  color: var(--text-2); font-weight: 500; font-size: .94rem; text-align: left; cursor: pointer;
  position: relative; white-space: nowrap; transition: background .2s, color .2s;
}
.sb-link i.sb-ic { font-size: 21px; flex: 0 0 22px; transition: transform .3s var(--ease-spring); }
.sb-link:hover { background: var(--surface-3); color: var(--text); }
.sb-link:hover i.sb-ic { transform: scale(1.12) rotate(-4deg); }
.sb-link .sb-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-link .sb-caret { font-size: 14px; transition: transform .3s var(--ease-out); opacity: .7; }
.sb-item.is-open > .sb-link .sb-caret { transform: rotate(90deg); }
.sb-badge { font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; background: var(--primary-soft); color: var(--primary-text); }
.sb-badge.hot { background: color-mix(in oklab, var(--danger) 15%, transparent); color: var(--danger); }
.sb-link.is-active {
  color: #fff; background: var(--grad); box-shadow: var(--shadow-primary);
}
.sb-link.is-active .sb-badge { background: rgba(255,255,255,.22); color: #fff; }
.sb-item.has-active > .sb-link { color: var(--text); background: var(--surface-3); }
.sb-item.has-active > .sb-link::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad);
}
.sb-sub { overflow: hidden; height: 0; }
.sb-item.is-open > .sb-sub { height: auto; }
.sb-sub-inner { padding: 2px 0 6px 22px; position: relative; }
.sb-sub-inner::before { content: ""; position: absolute; left: 23px; top: 4px; bottom: 10px; width: 1.5px; background: var(--border-strong); border-radius: 2px; }
.sb-sublink {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 22px; border-radius: 10px;
  color: var(--text-2); font-size: .9rem; position: relative; white-space: nowrap;
}
.sb-sublink::before { content: ""; position: absolute; left: -2px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--border-strong); transition: .2s; }
.sb-sublink:hover { color: var(--text); background: var(--surface-3); }
.sb-sublink.is-active { color: var(--primary-text); font-weight: 600; background: var(--primary-soft); }
.sb-sublink.is-active::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* Sidebar footer: live cash widget */
.sb-foot { padding: 12px; border-top: 1px solid var(--border); }
.sb-cash {
  position: relative; overflow: hidden; border-radius: 16px; padding: 14px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, var(--primary-2), var(--primary) 55%, color-mix(in oklab, var(--primary) 60%, #000));
}
.sb-cash::before { content: ""; position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; border: 18px solid rgba(255,255,255,.08); }
.sb-cash small { opacity: .8; font-size: .74rem; display: flex; align-items: center; gap: 6px; }
.sb-cash .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.sb-cash strong { display: block; font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -.02em; margin: 2px 0 8px; }
.sb-cash .sb-cash-row { display: flex; gap: 6px; }
.sb-cash .sb-cash-row a { flex: 1; font-size: .74rem; font-weight: 600; text-align: center; padding: 6px; border-radius: 9px; color: #fff; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.sb-cash .sb-cash-row a:hover { background: rgba(255,255,255,.28); }

/* collapsed rail */
.sb-collapsed .sb { width: var(--sb-w-collapsed); }
.sb-collapsed .sb-title, .sb-collapsed .sb-label, .sb-collapsed .sb-caret, .sb-collapsed .sb-badge,
.sb-collapsed .sb-cash, .sb-collapsed .sb-section-text { display: none; }
.sb-collapsed .sb-brand { justify-content: center; padding-inline: 10px; flex-direction: column; }
.sb-collapsed .sb-toggle { margin: 0; }
.sb-collapsed .sb-section { text-align: center; padding: 12px 0 6px; }
.sb-collapsed .sb-section::before { content: ""; display: block; height: 1px; background: var(--border); margin: 0 14px; }
.sb-collapsed .sb-link { justify-content: center; padding: 12px; }
.sb-collapsed .sb-item > .sb-sub { display: none; }
.sb-collapsed .sb-item.has-active > .sb-link::before { left: -12px; }
.sb-collapsed .sb-foot .sb-mini-cash { display: grid; }
.sb-mini-cash { display: none; place-items: center; height: 48px; border-radius: 14px; background: var(--grad); color: #fff; font-size: 22px; }
/* flyout for collapsed rail */
.sb-flyout {
  position: fixed; z-index: calc(var(--z-sidebar) + 1); min-width: 210px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(-6px); pointer-events: none; transition: opacity .18s, transform .22s var(--ease-out);
}
.sb-flyout.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.sb-flyout h6 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); padding: 6px 10px 8px; font-family: var(--font); }
.sb-flyout a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-size: .9rem; }
.sb-flyout a:hover, .sb-flyout a.is-active { background: var(--primary-soft); color: var(--primary-text); }

/* Topbar */
.tb {
  position: sticky; top: 0; z-index: var(--z-topbar); height: var(--tb-h);
  display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter);
  margin-top: 12px;
}
.tb.is-scrolled { }
.tb-inner {
  position: absolute; inset: 0 calc(var(--gutter) - 12px); z-index: -1; border-radius: 18px;
  transition: background .25s, box-shadow .25s, border-color .25s; border: 1px solid transparent;
}
.tb.is-scrolled .tb-inner { background: var(--surface-glass); backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6); border-color: var(--border); box-shadow: var(--shadow-sm); }
.icon-btn.tb-burger { display: none; }
.tb-search {
  display: flex; align-items: center; gap: 10px; height: 44px; width: min(420px, 38vw); padding: 0 8px 0 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px; color: var(--text-3);
  cursor: pointer; transition: border-color .2s, box-shadow .2s; font-size: .92rem;
}
.tb-search:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tb-search i { font-size: 19px; }
.tb-search span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-search .kbd { flex: 0 0 auto; }
.kbd { font-family: var(--font-mono); font-size: .72rem; padding: 3px 7px; border-radius: 7px; background: var(--surface-3); border: 1px solid var(--border); border-bottom-width: 2px; color: var(--text-2); }
.tb-spacer { flex: 1; }
.tb-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 20px; cursor: pointer;
  transition: background .2s, color .2s, transform .2s var(--ease-spring), border-color .2s;
}
.icon-btn:hover { color: var(--primary-text); border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); background: var(--primary-soft); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.icon-btn .dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--danger); animation: ring 2s infinite; }
@keyframes ring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }
/* theme toggle sun/moon morph */
.theme-toggle .ph-sun, .theme-toggle .ph-moon-stars { position: absolute; transition: transform .5s var(--ease-spring), opacity .3s; }
.theme-toggle .ph-moon-stars { transform: rotate(-90deg) scale(0); opacity: 0; }
html[data-theme="dark"] .theme-toggle .ph-sun { transform: rotate(90deg) scale(0); opacity: 0; }
html[data-theme="dark"] .theme-toggle .ph-moon-stars { transform: none; opacity: 1; }
.tb-user { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; height: 44px; }
.tb-user:hover { border-color: var(--border-strong); }
.tb-user .meta { line-height: 1.15; }
.tb-user .meta strong { display: block; font-size: .86rem; }
.tb-user .meta small { font-size: .72rem; color: var(--text-3); }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: var(--grad); flex: 0 0 auto; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .75rem; }
.avatar.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 1.1rem; }
.avatar.c1 { background: linear-gradient(135deg, #f97316, #ef4444); }
.avatar.c2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.avatar.c3 { background: linear-gradient(135deg, #10b981, #0d9488); }
.avatar.c4 { background: linear-gradient(135deg, #eab308, #f97316); }
.avatar.c5 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

/* announcement strip */
.sp-announce {
  display: flex; align-items: center; gap: 12px; margin: 10px var(--gutter) 0; padding: 10px 14px; border-radius: 14px;
  background: var(--grad-soft); border: 1px solid color-mix(in oklab, var(--primary) 22%, transparent); font-size: .88rem;
}
.sp-announce i { font-size: 20px; color: var(--primary-text); }
.sp-announce p { flex: 1; color: var(--text-2); }
.sp-announce p strong { color: var(--text); }

/* ---------- 5. Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0 22px; }
.page-head h1 { font-size: 1.75rem; line-height: 1.15; }
.page-head .crumbs { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-3); margin-bottom: 6px; }
.page-head .crumbs a { color: var(--text-3); }
.page-head .crumbs a:hover { color: var(--primary-text); }
.page-head .crumbs i { font-size: 11px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 6. Cards ---------- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); transition: box-shadow .3s, transform .3s var(--ease-out), border-color .3s;
  isolation: isolate;
}
/* spotlight: follows the cursor via --mx/--my set in JS */
.card.spot::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, -500px) var(--my, -500px), color-mix(in oklab, var(--primary) 70%, transparent), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.card.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(500px circle at var(--mx, -500px) var(--my, -500px), var(--primary-soft), transparent 40%);
  opacity: 0; transition: opacity .3s;
}
.card.spot:hover::before, .card.spot:hover::after { opacity: 1; }
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h3 { font-size: 1.05rem; }
.card-head p { font-size: .8rem; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 18px 20px 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); }
.g-card { row-gap: 20px; }

/* stat tile */
.stat { padding: 18px 20px; height: 100%; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-ic {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: var(--tone-soft, var(--primary-soft)); color: var(--tone, var(--primary-text));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--tone, var(--primary)) 18%, transparent);
  transition: transform .5s var(--ease-spring);
}
.card:hover .stat-ic { transform: rotate(-8deg) scale(1.06); }
.stat-label { color: var(--text-3); font-size: .84rem; font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: var(--stat-size); font-weight: var(--display-weight); letter-spacing: var(--display-track); line-height: 1.05; }
.stat-value small { font-size: .95rem; color: var(--text-3); font-weight: 500; margin-right: 3px; }
.stat-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--text-3); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: .78rem; padding: 3px 8px; border-radius: 20px; }
.trend.up { color: var(--success); background: color-mix(in oklab, var(--success) 13%, transparent); }
.trend.down { color: var(--danger); background: color-mix(in oklab, var(--danger) 13%, transparent); }
.stat-spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 64px; opacity: .55; pointer-events: none; }
.tone-primary { --tone: var(--primary); --tone-soft: var(--primary-soft); }
.tone-success { --tone: var(--success); --tone-soft: color-mix(in oklab, var(--success) 13%, transparent); }
.tone-warning { --tone: var(--warning); --tone-soft: color-mix(in oklab, var(--warning) 14%, transparent); }
.tone-danger { --tone: var(--danger); --tone-soft: color-mix(in oklab, var(--danger) 13%, transparent); }
.tone-accent { --tone: var(--accent); --tone-soft: color-mix(in oklab, var(--accent) 14%, transparent); }
.tone-info { --tone: var(--info); --tone-soft: color-mix(in oklab, var(--info) 13%, transparent); }

/* hero card */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 26px 28px; color: #fff; min-height: 100%;
  background: radial-gradient(120% 130% at 100% 0%, var(--primary-2) 0%, var(--primary) 45%, color-mix(in oklab, var(--primary) 55%, #0b0620) 100%);
  box-shadow: var(--shadow-primary);
}
.hero::before { /* grid texture */
  content: ""; position: absolute; inset: 0; opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(115deg, transparent 35%, #000 100%);
}
.hero-orb { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.hero-orb.o1 { width: 220px; height: 220px; right: -60px; top: -80px; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%); }
.hero-orb.o2 { width: 140px; height: 140px; right: 120px; bottom: -70px; border: 22px solid rgba(255,255,255,.09); }
.hero h2 { color: #fff; font-size: 1.6rem; position: relative; }
.hero p { color: rgba(255,255,255,.82); position: relative; }
.hero .hero-kpis { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 20px; position: relative; }
.hero .hero-kpis div small { display: block; font-size: .75rem; opacity: .75; }
.hero .hero-kpis div strong { font-family: var(--font-display); font-size: 1.3rem; }
.hero .hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; position: relative; }
.btn-glass { background: rgba(255,255,255,.16) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.25) !important; backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255,255,255,.28) !important; }
.btn-white { background: #fff !important; color: #1b1340 !important; }

/* ---------- 7. Buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font-weight: 600; font-size: .9rem; white-space: nowrap; cursor: pointer; user-select: none; overflow: hidden;
  transition: transform .2s var(--ease-spring), box-shadow .25s, background .2s, border-color .2s, color .2s;
  touch-action: manipulation;
}
.btn i { font-size: 18px; }
.btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); color: var(--b-fg); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { font-family: var(--font-display); letter-spacing: .03em; --b-bg: var(--grad); --b-fg: #fff; --b-bd: transparent; background: var(--grad); box-shadow: var(--shadow-primary); }
.btn-primary:hover { box-shadow: 0 12px 28px -8px color-mix(in oklab, var(--primary) 70%, transparent); border-color: transparent; }
.btn-primary::after { /* sheen */
  content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-soft { --b-bg: var(--primary-soft); --b-fg: var(--primary-text); --b-bd: transparent; }
.btn-soft:hover { --b-bg: var(--primary-soft-2); border-color: transparent; }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); }
.btn-ghost:hover { --b-bg: var(--surface-3); box-shadow: none; border-color: transparent; }
.btn-danger { --b-bg: color-mix(in oklab, var(--danger) 12%, transparent); --b-fg: var(--danger); --b-bd: transparent; }
.btn-danger:hover { --b-bg: var(--danger); --b-fg: #fff; }
.btn-success { --b-bg: var(--success); --b-fg: #fff; --b-bd: transparent; }
.btn-sm { height: 34px; padding: 0 12px; font-size: .82rem; border-radius: 10px; }
.btn-sm i { font-size: 16px; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 1rem; border-radius: 15px; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; }
.btn .spinner { display: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > *:not(.spinner) { visibility: hidden; }
.btn.is-loading .spinner { display: block; position: absolute; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .25; animation: ripple .6s var(--ease-out); pointer-events: none; }
@keyframes ripple { to { transform: scale(2.8); opacity: 0; } }

/* ---------- 8. Badges / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 30px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.success { background: color-mix(in oklab, var(--success) 13%, transparent); color: color-mix(in oklab, var(--success) 85%, var(--text)); }
.pill.warning { background: color-mix(in oklab, var(--warning) 15%, transparent); color: color-mix(in oklab, var(--warning) 75%, var(--text)); }
.pill.danger { background: color-mix(in oklab, var(--danger) 13%, transparent); color: color-mix(in oklab, var(--danger) 85%, var(--text)); }
.pill.info { background: color-mix(in oklab, var(--info) 13%, transparent); color: color-mix(in oklab, var(--info) 85%, var(--text)); }
.pill.primary { background: var(--primary-soft); color: var(--primary-text); }
.pill.accent { background: color-mix(in oklab, var(--accent) 14%, transparent); color: color-mix(in oklab, var(--accent) 70%, var(--text)); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); }

/* ---------- 9. Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: flex; align-items: center; gap: 3px; font-size: .84rem; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.label .req { color: var(--danger); margin-left: 3px; }
.label small, .label > a { font-weight: 500; color: var(--text-3); margin-left: auto; }
.label > a { color: var(--primary-text); }
.help { font-size: .76rem; color: var(--text-3); margin-top: 6px; }
.error-msg { font-size: .78rem; color: var(--danger); margin-top: 6px; display: flex; gap: 5px; align-items: center; }
.input, .textarea, select.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: .93rem;
  transition: border-color .2s, box-shadow .2s, background .2s; outline: none;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.input:hover, .textarea:hover { border-color: color-mix(in oklab, var(--primary) 35%, var(--border-strong)); }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in oklab, var(--danger) 12%, transparent); }
.input-sm { height: 36px; border-radius: 10px; font-size: .86rem; padding: 0 11px; }
.ig { position: relative; display: flex; align-items: stretch; }
.ig > .ig-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 18px; pointer-events: none; transition: color .2s; }
.ig > .ig-ic + .input, .ig > .ig-ic ~ input.input { padding-left: 40px; }
.ig:focus-within > .ig-ic { color: var(--primary); }
.ig-addon { display: grid; place-items: center; padding: 0 12px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-2); font-size: .82rem; font-weight: 600; }
.ig-addon:first-child { border-radius: 12px 0 0 12px; border-right: 0; }
.ig-addon:last-child { border-radius: 0 12px 12px 0; border-left: 0; }
.ig .ig-addon:first-child + .input { border-radius: 0 12px 12px 0; }
.ig .input:has(+ .ig-addon:last-child) { border-radius: 12px 0 0 12px; }
.ig .ig-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237c83a9' viewBox='0 0 256 256'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 01-11.32 0l-80-80a8 8 0 0111.32-11.32L128 164.69l74.34-74.35a8 8 0 0111.32 11.32z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 24px; border-radius: 30px; background: var(--border-strong); position: relative; transition: background .25s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .35s var(--ease-spring); }
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch.sm .track { width: 34px; height: 20px; } .switch.sm .track::after { width: 14px; height: 14px; }
.switch.sm input:checked + .track::after { transform: translateX(14px); }

/* checkbox */
.cbx { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; cursor: pointer; flex: 0 0 auto; }
.cbx input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.cbx span { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; transition: background .2s, border-color .2s, transform .25s var(--ease-spring); }
.cbx span::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .25s var(--ease-spring); }
.cbx input:checked + span, .cbx input:indeterminate + span { background: var(--primary); border-color: var(--primary); }
.cbx input:checked + span::after { transform: rotate(-45deg) scale(1); }
.cbx input:indeterminate + span::after { border-left: 0; width: 10px; height: 0; transform: none; margin: 0; }
.cbx input:active + span { transform: scale(.88); }
.cbx input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* segmented control */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface-3); border-radius: 12px; position: relative; border: 1px solid var(--border); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 6px 13px; border-radius: 9px; font-size: .82rem; font-weight: 600; color: var(--text-3); cursor: pointer; transition: color .2s; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button.is-active { color: var(--text); }
.seg .seg-thumb { position: absolute; top: 4px; bottom: 4px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-sm); transition: left .35s var(--ease-out), width .35s var(--ease-out); }
html[data-theme="dark"] .seg .seg-thumb { background: var(--surface-2); box-shadow: 0 0 0 1px var(--border-strong); }

/* qty stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 11px; overflow: hidden; background: var(--surface); height: 36px; }
.qty button { width: 32px; height: 100%; border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 15px; display: grid; place-items: center; }
.qty button:hover { background: var(--primary-soft); color: var(--primary-text); }
.qty input { width: 42px; border: 0; text-align: center; background: none; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; outline: none; height: 100%; }

/* ---------- 10. Tables (DataTables restyle) ---------- */
.tbl-card { overflow: hidden; }
.tbl-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.tbl-toolbar .ig { width: min(320px, 100%); }
.tbl-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .82rem; font-weight: 600; cursor: pointer; transition: .2s; white-space: nowrap; }
.chip i { font-size: 16px; }
.chip .cnt { font-size: .7rem; padding: 1px 7px; border-radius: 20px; background: var(--surface-3); color: var(--text-3); }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip.is-active .cnt { background: rgba(127,127,127,.25); color: inherit; }
.tbl-wrap { overflow-x: auto; }
table.sp-table { width: 100% !important; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.sp-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--text-3); font-family: var(--font-display);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.sp-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.sp-table tbody tr { transition: background .15s; }
.sp-table tbody tr:hover td { background: color-mix(in oklab, var(--primary) 4%, transparent); }
.sp-table.rows-link tbody tr { cursor: pointer; }
.sp-table tbody tr.is-selected td { background: var(--primary-soft); }
.sp-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.sp-table .t-strong { color: var(--text); font-weight: 600; }
.sp-table td.num, .sp-table td.t-right { white-space: nowrap; }
.sp-table .t-right, .sp-table th.t-right { text-align: right; }
.sp-table .t-center { text-align: center; }
.sp-table td.chk, .sp-table th.chk { width: 44px; padding-right: 0; }
/* DataTables sort indicators */
table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc { cursor: pointer; }
table.dataTable thead > tr > th.dt-orderable-asc:hover, table.dataTable thead > tr > th.dt-orderable-desc:hover { color: var(--text); }
table.dataTable thead th .dt-column-order { display: inline-block; width: 12px; margin-left: 6px; position: relative; height: 12px; vertical-align: -1px; }
table.dataTable thead th .dt-column-order::before, table.dataTable thead th .dt-column-order::after { position: absolute; left: 0; font-size: 8px; line-height: 1; opacity: .35; }
table.dataTable thead th.dt-orderable-asc .dt-column-order::before { content: "▲"; top: 0; }
table.dataTable thead th.dt-orderable-desc .dt-column-order::after { content: "▼"; bottom: 0; }
table.dataTable thead th.dt-ordering-asc .dt-column-order::before, table.dataTable thead th.dt-ordering-desc .dt-column-order::after { opacity: 1; color: var(--primary); }
table.dataTable th.dt-type-numeric, table.dataTable td.dt-type-numeric { text-align: right; }
table.dataTable th.dt-type-numeric .dt-column-header { justify-content: flex-end; }
.dt-column-header { display: flex; align-items: center; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.tbl-foot .dt-info { font-size: .84rem; color: var(--text-3); }
.tbl-foot .dt-length select { height: 34px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 0 8px; margin: 0 6px; font: inherit; font-size: .84rem; }
.tbl-foot .dt-length label { font-size: .84rem; color: var(--text-3); }
.dt-paging nav { display: flex; gap: 4px; }
.dt-paging .dt-paging-button {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-weight: 600; font-size: .85rem; cursor: pointer; transition: .2s;
}
.dt-paging .dt-paging-button:hover:not(.disabled):not(.current) { border-color: var(--primary); color: var(--primary-text); }
.dt-paging .dt-paging-button.current { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-primary); }
.dt-paging .dt-paging-button.disabled { opacity: .4; cursor: default; }
.dt-paging .ellipsis { padding: 0 6px; color: var(--text-3); align-self: center; }
div.dt-processing { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in oklab, var(--surface) 60%, transparent); backdrop-filter: blur(2px); z-index: 5; }
div.dt-processing > div:last-child { display: none; }
.dt-empty { text-align: center; padding: 50px 20px !important; }

.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.thumb {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: #fff;
  background: var(--thumb-bg, var(--grad)); box-shadow: inset 0 -10px 20px rgba(0,0,0,.12), 0 4px 10px -4px rgba(0,0,0,.3); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-cell .meta strong { display: block; color: var(--text); font-weight: 600; line-height: 1.3; }
.prod-cell .meta small { color: var(--text-3); font-size: .78rem; }
.stock-meter { min-width: 110px; }
.stock-meter .bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 5px; }
.stock-meter .bar i { display: block; height: 100%; border-radius: 6px; background: var(--success); }
.stock-meter.low .bar i { background: var(--warning); }
.stock-meter.out .bar i { background: var(--danger); }
.stock-meter span { font-weight: 700; color: var(--text); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* floating bulk action bar */
.bulk-bar {
  position: fixed; left: 50%; bottom: 24px; z-index: var(--z-drawer); transform: translate(-50%, 140%);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px;
  background: #151833; color: #fff; box-shadow: 0 20px 50px -10px rgba(10,10,40,.55); transition: transform .45s var(--ease-spring), visibility 0s .45s; visibility: hidden;
  max-width: calc(100vw - 24px); overflow-x: auto;
}
html[data-theme="dark"] .bulk-bar { background: #242848; box-shadow: 0 20px 50px -10px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.08); }
.bulk-bar.is-visible { transform: translate(-50%, 0); visibility: visible; transition: transform .45s var(--ease-spring), visibility 0s; }
.bulk-bar .count { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; padding-right: 10px; border-right: 1px solid rgba(255,255,255,.15); white-space: nowrap; }
.bulk-bar .count b { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--grad); font-size: .8rem; }
.bulk-bar .btn { --b-bg: rgba(255,255,255,.08); --b-fg: #fff; --b-bd: transparent; height: 38px; }
.bulk-bar .btn:hover { --b-bg: rgba(255,255,255,.16); }
.bulk-bar .btn.btn-danger { --b-bg: rgba(244,63,94,.18); --b-fg: #fda4af; }
.bulk-bar .btn.btn-danger:hover { --b-bg: var(--danger); --b-fg: #fff; }

/* ---------- 11. Dropdowns ---------- */
.dd { position: relative; }
.dd-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: var(--z-dropdown); min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .16s, transform .22s var(--ease-out);
}
.dd-menu.left { left: 0; right: auto; transform-origin: top left; }
.dd.is-open > .dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 9px; border: 0; background: none; color: var(--text-2); font-size: .88rem; font-weight: 500; text-align: left; cursor: pointer; }
.dd-item i { font-size: 18px; color: var(--text-3); }
.dd-item:hover { background: var(--surface-3); color: var(--text); }
.dd-item:hover i { color: var(--primary); }
.dd-item.danger { color: var(--danger); } .dd-item.danger i { color: var(--danger); }
.dd-item.danger:hover { background: color-mix(in oklab, var(--danger) 10%, transparent); }
.dd-item .kbd { margin-left: auto; }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-head { padding: 8px 11px 6px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--text-3); }

/* notifications panel */
.notif-menu { width: 380px; padding: 0; max-width: calc(100vw - 24px); }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.notif { display: flex; gap: 12px; padding: 11px; border-radius: 12px; position: relative; }
.notif:hover { background: var(--surface-2); }
.notif .n-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; flex: 0 0 38px; background: var(--tone-soft); color: var(--tone); }
.notif .n-body { flex: 1; min-width: 0; font-size: .85rem; color: var(--text-2); }
.notif .n-body strong { color: var(--text); }
.notif .n-body small { display: block; color: var(--text-3); font-size: .74rem; margin-top: 3px; }
.notif .n-x { opacity: 0; border: 0; background: var(--surface-3); color: var(--text-3); width: 26px; height: 26px; border-radius: 8px; cursor: pointer; flex: 0 0 26px; transition: opacity .2s; }
.notif:hover .n-x { opacity: 1; }
.notif .n-x:hover { color: var(--danger); }
.notif.unread::before { content: ""; position: absolute; left: 3px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }

/* ---------- 12. Modals & drawers ---------- */
.sp-backdrop { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(8, 9, 22, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.sp-backdrop.is-visible { opacity: 1; }
.modal { position: fixed; inset: 0; z-index: calc(var(--z-modal) + 1); display: none; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.modal.is-open { display: flex; }
.modal-dialog {
  width: 100%; max-width: 560px; margin: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100dvh - 40px);
}
.modal-lg .modal-dialog { max-width: 920px; }
.modal-xl .modal-dialog { max-width: 1160px; }
.modal-sm .modal-dialog { max-width: 420px; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-head .m-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--primary-soft); color: var(--primary-text); flex: 0 0 44px; }
.modal-head h3 { font-size: 1.2rem; }
.modal-head p { font-size: .84rem; color: var(--text-3); margin-top: 2px; }
.modal-close { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface-3); color: var(--text-2); font-size: 18px; cursor: pointer; display: grid; place-items: center; transition: transform .3s var(--ease-spring), background .2s; flex: 0 0 36px; }
.modal-close:hover { background: color-mix(in oklab, var(--danger) 12%, transparent); color: var(--danger); transform: rotate(90deg); }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.modal-foot .left { margin-right: auto; }
/* confirm dialog */
.confirm-ic { width: 64px; height: 64px; border-radius: 20px; margin: 4px auto 16px; display: grid; place-items: center; font-size: 32px; background: var(--tone-soft); color: var(--tone); }
.confirm-ic.shake { animation: shake .5s; }
@keyframes shake { 20%, 60% { transform: rotate(-8deg); } 40%, 80% { transform: rotate(8deg); } }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); position: relative; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 11px 14px; font-weight: 600; font-size: .88rem; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tabs button i { font-size: 18px; }
.tabs button.is-active { color: var(--primary-text); }
.tabs .tabs-ink { position: absolute; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--grad); transition: left .35s var(--ease-out), width .35s var(--ease-out); }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; animation: fadeUp .35s var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 13. Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  position: relative; overflow: hidden; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.toast .t-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--tone-soft); color: var(--tone); flex: 0 0 36px; }
.toast .t-body { flex: 1; font-size: .86rem; color: var(--text-2); }
.toast .t-body strong { display: block; color: var(--text); font-size: .92rem; margin-bottom: 1px; }
.toast .t-x { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 16px; padding: 2px; }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--tone); transform-origin: left; }
.toast .t-action { margin-top: 8px; }

/* ---------- 14. Command palette ---------- */
.cmdk .modal-dialog { max-width: 620px; align-self: flex-start; margin-top: 10vh; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.cmdk-input i { font-size: 22px; color: var(--primary); }
.cmdk-input input { flex: 1; border: 0; background: none; outline: none; font-size: 1.05rem; color: var(--text); }
.cmdk-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); padding: 10px 12px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; cursor: pointer; color: var(--text-2); }
.cmdk-item i { font-size: 20px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); }
.cmdk-item.is-active { background: var(--primary-soft); color: var(--text); }
.cmdk-item.is-active i { background: var(--grad); color: #fff; }
.cmdk-item small { margin-left: auto; color: var(--text-3); font-size: .75rem; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .76rem; color: var(--text-3); }

/* ---------- 15. Misc components ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow strong { display: block; color: var(--text); font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .grow small { color: var(--text-3); font-size: .78rem; }
.progress-thin { height: 7px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.progress-thin i { display: block; height: 100%; border-radius: 8px; background: var(--grad); }
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--surface) 70%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { text-align: center; padding: 48px 20px; }
.empty .e-ic { width: 84px; height: 84px; border-radius: 26px; margin: 0 auto 18px; display: grid; place-items: center; font-size: 40px; background: var(--grad-soft); color: var(--primary-text); position: relative; }
.empty .e-ic::after { content: ""; position: absolute; inset: -8px; border-radius: 32px; border: 1.5px dashed color-mix(in oklab, var(--primary) 35%, transparent); animation: spin 18s linear infinite; }
.empty h3 { font-size: 1.15rem; margin-bottom: 6px; }
.empty p { color: var(--text-3); max-width: 420px; margin: 0 auto 18px; font-size: .9rem; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: .78rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.reveal { opacity: 0; }
.no-js .reveal, .reduced .reveal { opacity: 1; }
.mini-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); }
.mini-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mini-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 16px; font-size: .87rem; color: var(--text-2); }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--tone, var(--primary)); }
.tl-item strong { color: var(--text); }
.tl-item small { display: block; color: var(--text-3); font-size: .75rem; }

/* ---------- 16. FilePond / TomSelect / Flatpickr / Apex restyles ---------- */
.filepond--root { font-family: var(--font); margin-bottom: 0; }
.filepond--panel-root { background: var(--surface-2); border: 1.5px dashed var(--border-strong); border-radius: 16px; }
.filepond--root:hover .filepond--panel-root { border-color: var(--primary); }
.filepond--drop-label { color: var(--text-2); }
.filepond--drop-label label { padding: 10px 12px; }
.filepond--root.compact-label .filepond--drop-label label { padding: 8px; }
.filepond--drop-label label { cursor: pointer; }
.fp-label { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; text-align: left; font-size: .88rem; }
.fp-label .fp-ic { grid-row: span 2; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 24px; box-shadow: var(--shadow-primary); animation: floaty 3s ease-in-out infinite; }
.compact-label .fp-label { display: flex; flex-direction: column; align-items: center; text-align: center; }
@keyframes floaty { 50% { transform: translateY(-5px); } }
.fp-label u { color: var(--primary-text); text-decoration: none; font-weight: 700; }
.fp-label small { color: var(--text-3); font-size: .76rem; }
.filepond--drip-blob { background: var(--primary); }
.filepond--item-panel { background: #262b4a; border-radius: 12px; }
[data-filepond-item-state*="error"] .filepond--item-panel, [data-filepond-item-state*="invalid"] .filepond--item-panel { background: var(--danger); }
[data-filepond-item-state="processing-complete"] .filepond--item-panel { background: var(--success); }
.filepond--file-action-button { background: rgba(0,0,0,.5); cursor: pointer; }
.filepond--item { width: calc(33.33% - .5em); }
.filepond--root.single .filepond--item { width: calc(100% - .5em); }
.filepond--image-preview-overlay-success { color: var(--success); }
.filepond--credits { display: none; }

.ts-wrapper.single .ts-control, .ts-wrapper.multi .ts-control { min-height: 44px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface) !important; color: var(--text); padding: 10px 36px 10px 14px; box-shadow: none; font-size: .93rem; background-image: none; }
.ts-wrapper.focus .ts-control { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft) !important; }
.ts-wrapper .ts-control input { color: var(--text); font-size: .93rem; }
.ts-wrapper .ts-control input::placeholder { color: var(--text-3); }
.ts-dropdown { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); margin-top: 6px; color: var(--text-2); overflow: hidden; z-index: 120; }
.ts-dropdown .option, .ts-dropdown .create { padding: 9px 12px; border-radius: 9px; margin: 2px 6px; }
.ts-dropdown .active { background: var(--primary-soft); color: var(--text); }
.ts-dropdown .ts-dropdown-content { padding: 4px 0; }
.ts-dropdown .dropdown-input-wrap { padding: 8px; }
.ts-dropdown .dropdown-input { border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); padding: 8px 10px; }
.ts-wrapper.single .ts-control::after { border-color: var(--text-3) transparent transparent; right: 15px; }
.ts-wrapper.multi .ts-control > div { background: var(--primary-soft); color: var(--primary-text); border-radius: 7px; border: 0; }
.ts-opt { display: flex; align-items: center; gap: 10px; }
.ts-opt .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: .7rem; }
.ts-opt small { color: var(--text-3); display: block; font-size: .74rem; }

.flatpickr-calendar { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 16px; }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { display: none; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months, span.flatpickr-weekday, .flatpickr-weekdays { color: var(--text); fill: var(--text); background: transparent; }
.flatpickr-day { color: var(--text-2); border-radius: 10px; }
.flatpickr-day:hover { background: var(--surface-3); border-color: transparent; }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff; }
.flatpickr-day.inRange { background: var(--primary-soft); box-shadow: -5px 0 0 var(--primary-soft), 5px 0 0 var(--primary-soft); border-color: transparent; }
.flatpickr-day.today { border-color: var(--primary); }
.flatpickr-months .flatpickr-prev-month svg, .flatpickr-months .flatpickr-next-month svg { fill: var(--text-2); }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--text-3); opacity: .5; }

.apexcharts-tooltip.apexcharts-theme-light, .apexcharts-tooltip.apexcharts-theme-dark { background: var(--surface) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-lg) !important; border-radius: 12px !important; color: var(--text) !important; }
.apexcharts-tooltip-title { background: var(--surface-2) !important; border-bottom: 1px solid var(--border) !important; font-family: var(--font) !important; font-weight: 700; }
.apexcharts-xaxistooltip { background: var(--surface) !important; border-color: var(--border) !important; color: var(--text) !important; border-radius: 8px; }
.apexcharts-xaxistooltip::before, .apexcharts-xaxistooltip::after { display: none; }
.apexcharts-legend-text { color: var(--text-2) !important; }

/* ---------- 17. Page: login ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-visual { position: relative; overflow: hidden; margin: 14px; border-radius: 30px; padding: 44px; color: #fff; display: flex; flex-direction: column;
  background: radial-gradient(90% 90% at 90% 10%, var(--primary-2), transparent 60%), radial-gradient(80% 80% at 0% 100%, var(--accent), transparent 55%), linear-gradient(160deg, color-mix(in oklab, var(--primary) 85%, #000), #0b0720); }
.auth-visual::before { content: ""; position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px); background-size: 36px 36px; mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%); }
.auth-visual .brand { display: flex; align-items: center; gap: 12px; position: relative; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.auth-visual .brand .sb-logo { background: rgba(255,255,255,.18); backdrop-filter: blur(6px); box-shadow: none; }
.auth-copy { margin-top: auto; position: relative; }
.auth-copy h1 { color: #fff; font-size: clamp(2rem, 3.4vw, 3.1rem); line-height: 1.05; max-width: 560px; }
.auth-copy h1 em { font-style: normal; background: linear-gradient(90deg, #fff, #c4f1ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { color: rgba(255,255,255,.78); max-width: 460px; margin-top: 14px; }
.auth-float { position: absolute; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 18px; padding: 14px 16px; color: #fff; box-shadow: 0 20px 40px -12px rgba(0,0,0,.35); }
.auth-float small { opacity: .75; font-size: .74rem; display: block; }
.auth-float strong { font-family: var(--font-display); font-size: 1.3rem; }
.auth-float.f1 { top: 18%; right: 10%; }
.auth-float.f2 { top: 40%; left: 12%; display: flex; gap: 12px; align-items: center; }
.auth-float.f2 i { font-size: 26px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.auth-float.f3 { top: 30%; right: 30%; padding: 10px 14px; font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .inner { width: 100%; max-width: 420px; }
.auth-form h2 { font-size: 2rem; }
.auth-top { position: absolute; top: 24px; right: 28px; display: flex; gap: 8px; }

/* ---------- 18. Page: POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 420px; gap: 20px; height: calc(100dvh - var(--tb-h) - 40px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pos-search { display: flex; gap: 10px; margin-bottom: 14px; }
.pos-search .ig { flex: 1; }
.pos-search .input { height: 52px; border-radius: 15px; font-size: 1rem; }
.pos-search .scan-hint { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; align-items: center; font-size: .76rem; color: var(--text-3); }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 4px; }
.pos-cat { display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: .86rem; color: var(--text-2); transition: .2s; }
.pos-cat i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--surface-3); transition: .2s; }
.pos-cat:hover { border-color: var(--border-strong); color: var(--text); }
.pos-cat.is-active { border-color: var(--primary); color: var(--text); box-shadow: 0 0 0 3px var(--primary-soft); }
.pos-cat.is-active i { background: var(--grad); color: #fff; }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; align-content: start; padding: 4px 4px 20px; margin: -4px; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 10px; cursor: pointer; transition: transform .3s var(--ease-out), box-shadow .3s, border-color .3s; user-select: none; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in oklab, var(--primary) 40%, var(--border)); }
.pcard:active { transform: scale(.97); }
.pcard .p-img { aspect-ratio: 4/3; border-radius: 13px; display: grid; place-items: center; font-size: 46px; color: #fff; background: var(--thumb-bg); position: relative; overflow: hidden; }
.pcard .p-img::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 50%); }
.pcard .p-img i { transition: transform .5s var(--ease-spring); filter: drop-shadow(0 8px 12px rgba(0,0,0,.25)); }
.pcard:hover .p-img i { transform: scale(1.15) rotate(-6deg); }
.pcard .p-stock { position: absolute; top: 16px; left: 16px; z-index: 1; font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; background: rgba(0,0,0,.35); color: #fff; backdrop-filter: blur(4px); }
.pcard .p-stock.low { background: var(--warning); }
.pcard .p-stock.out { background: var(--danger); }
.pcard.is-out { opacity: .55; pointer-events: none; }
.pcard .p-name { font-weight: 600; font-size: .88rem; color: var(--text); margin: 10px 2px 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard .p-foot { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 2px; }
.pcard .p-price { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--text); }
.pcard .p-add { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-size: 17px; transition: .25s var(--ease-spring); }
.pcard:hover .p-add { background: var(--grad); color: #fff; transform: rotate(90deg); }
.pcard .p-qty-badge { position: absolute; top: 4px; right: 4px; z-index: 2; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: .78rem; box-shadow: var(--shadow-primary); transform: scale(0); transition: transform .35s var(--ease-spring); }
.pcard.in-cart .p-qty-badge { transform: scale(1); }
.pcard.in-cart { border-color: var(--primary); }

.cart { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); min-height: 0; overflow: hidden; }
.cart-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.cart-head .row1 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cart-mode { display: flex; gap: 8px; }
.cart-mode label { flex: 1; cursor: pointer; }
.cart-mode input { position: absolute; opacity: 0; }
.cart-mode .opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px; border: 1.5px solid var(--border); transition: .2s; }
.cart-mode .opt i { font-size: 22px; color: var(--text-3); }
.cart-mode .opt strong { display: block; font-size: .85rem; line-height: 1.2; }
.cart-mode .opt small { font-size: .72rem; color: var(--text-3); }
.cart-mode input:checked + .opt { border-color: var(--primary); background: var(--primary-soft); }
.cart-mode input:checked + .opt i { color: var(--primary); }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 12px; }
.citem { display: flex; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px dashed var(--border); }
.citem .thumb { width: 42px; height: 42px; flex-basis: 42px; font-size: 20px; }
.citem .c-mid { flex: 1; min-width: 0; }
.citem .c-mid strong { display: block; font-size: .86rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem .c-mid small { font-size: .76rem; color: var(--text-3); }
.citem .c-total { font-weight: 700; font-size: .9rem; min-width: 76px; text-align: right; color: var(--text); }
.citem .c-x { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 16px; padding: 4px; border-radius: 6px; }
.citem .c-x:hover { color: var(--danger); background: color-mix(in oklab, var(--danger) 10%, transparent); }
.citem .qty { height: 32px; }
.citem .qty button { width: 28px; }
.citem .qty input { width: 32px; }
.cart-empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.cart-empty i { font-size: 56px; opacity: .35; display: block; margin-bottom: 10px; }
.cart-sum { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.sum-row { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; color: var(--text-2); padding: 4px 0; }
.sum-row .input-sm { width: 110px; text-align: right; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; margin-top: 6px; border-top: 1px dashed var(--border-strong); }
.sum-total span { font-weight: 600; color: var(--text-2); }
.sum-total strong { font-family: var(--font-display); font-size: 1.7rem; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cart-actions { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; padding: 12px 18px 18px; background: var(--surface-2); }
.pos-fab { display: none; }
.kbd-hints { display: flex; gap: 14px; flex-wrap: wrap; font-size: .74rem; color: var(--text-3); margin-top: 8px; }
.kbd-hints span { display: inline-flex; gap: 6px; align-items: center; }
.pay-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-keys button { height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 700; color: var(--text); cursor: pointer; }
.pay-keys button:hover { border-color: var(--primary); color: var(--primary-text); }
.big-amount { font-family: var(--font-display); font-size: 2.4rem; letter-spacing: -.03em; font-weight: 700; }
.success-burst { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, var(--success) 15%, transparent); color: var(--success); font-size: 50px; position: relative; }
.success-burst::before, .success-burst::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--success); animation: ring 1.6s infinite; }
.success-burst::after { animation-delay: .5s; }

.cb-day-wrap .input { height: 34px; padding-left: 40px; }
.page-pos .sp-announce { display: none; }
.page-pos .sp-content { padding-bottom: 20px; }

/* ---------- 19. Page: PC Builder ---------- */
.build-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.build-summary { position: sticky; top: calc(var(--tb-h) + 20px); }
.slot-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 13px; border: 1.5px dashed var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .84rem; cursor: pointer; transition: .25s var(--ease-out); }
.slot-chip i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; background: var(--surface-3); transition: .25s; }
.slot-chip:hover { border-color: var(--primary); color: var(--text); transform: translateY(-2px); }
.slot-chip:hover i { background: var(--primary-soft); color: var(--primary-text); }
.slot-chip.is-filled { border-style: solid; border-color: color-mix(in oklab, var(--success) 45%, transparent); background: color-mix(in oklab, var(--success) 7%, var(--surface)); color: var(--text); }
.slot-chip.is-filled i { background: var(--success); color: #fff; }
.slot-chip.is-filled::after { content: ""; position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='white'%3E%3Cpath d='M232.49 80.49l-128 128a12 12 0 01-17 0l-56-56a12 12 0 1117-17L96 183 215.51 63.51a12 12 0 0117 17z'/%3E%3C/svg%3E") center/9px no-repeat; border: 2px solid var(--surface); }
.build-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: -8px; }
.build-table th { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); text-align: left; padding: 4px 8px; white-space: nowrap; }
.build-table td { background: var(--surface-2); padding: 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); vertical-align: middle; }
.build-table td:first-child { border-left: 1px solid var(--border); border-radius: 14px 0 0 14px; }
.build-table td:last-child { border-right: 1px solid var(--border); border-radius: 0 14px 14px 0; }
.build-table tr.b-row:hover td { border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); background: color-mix(in oklab, var(--primary) 4%, var(--surface-2)); }
.build-table .input-sm { background: var(--surface); }
.b-type { display: flex; align-items: center; gap: 10px; min-width: 138px; }
.b-type .b-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; color: #fff; background: var(--thumb-bg, var(--grad)); flex: 0 0 38px; }
.b-type select { border: 0; background: transparent; font-weight: 700; font-size: .84rem; color: var(--text); padding: 0; cursor: pointer; outline: none; max-width: 96px; }
.b-type select option { background: var(--surface); }
.b-src { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.b-desc { min-width: 170px; }
.b-num { width: 100px; }
.b-qty { width: 60px; }
.b-total { font-weight: 700; color: var(--text); text-align: right; white-space: nowrap; min-width: 86px; }
.cost-col { transition: opacity .3s; }
.hide-cost .cost-col { display: none; }
.b-add-row { width: 100%; border: 1.5px dashed var(--border-strong); background: transparent; border-radius: 14px; padding: 14px; color: var(--text-3); font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: .2s; }
.b-add-row:hover { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.build-ring { position: relative; width: 120px; height: 120px; flex: 0 0 120px; }
.build-ring svg { transform: rotate(-90deg); }
.build-ring .rt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.build-ring .rt strong { font-family: var(--font-display); font-size: 1.6rem; display: block; }
.build-ring .rt small { font-size: .7rem; color: var(--text-3); }
.sum-card .sum-total strong { font-size: 2rem; }
.profit-box { border-radius: 14px; padding: 12px 14px; background: color-mix(in oklab, var(--success) 9%, transparent); border: 1px solid color-mix(in oklab, var(--success) 25%, transparent); display: flex; justify-content: space-between; align-items: center; }
.profit-box strong { color: var(--success); font-family: var(--font-display); font-size: 1.15rem; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .86rem; margin-bottom: 8px; }
.pay-row i { font-size: 20px; color: var(--success); }
.pay-row .grow { flex: 1; }
.pay-row small { display: block; color: var(--text-3); font-size: .74rem; }
.inv-pick { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 13px; border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer; transition: .2s; }
.inv-pick:hover { border-color: var(--primary); background: var(--primary-soft); }
.inv-pick .grow { flex: 1; min-width: 0; }
.inv-pick .grow strong { display: block; font-size: .9rem; color: var(--text); }
.inv-pick .grow small { color: var(--text-3); font-size: .78rem; }

/* ---------- 20. Page: Settings ---------- */
.set-nav { position: sticky; top: calc(var(--tb-h) + 20px); padding: 8px; }
.set-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: .9rem; text-align: left; cursor: pointer; transition: .2s; }
.set-nav button i { font-size: 20px; }
.set-nav button small { display: block; font-weight: 500; font-size: .74rem; color: var(--text-3); }
.set-nav button:hover { background: var(--surface-3); color: var(--text); }
.set-nav button.is-active { background: var(--primary-soft); color: var(--primary-text); }
.set-nav button.is-active i { color: var(--primary); }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.font-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.font-card { text-align: left; border: 2px solid var(--border); border-radius: 16px; padding: 14px 16px; background: var(--surface); cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .3s var(--ease-spring); color: var(--text); }
.font-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.font-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.font-card .fc-aa { font-size: 2rem; line-height: 1.1; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.font-card .fc-num { font-size: 1.15rem; margin-top: 8px; font-weight: 700; }
.font-card .fc-body { font-size: .82rem; color: var(--text-3); margin-top: 4px; }
.font-card .fc-name { display: flex; flex-direction: column; margin-top: 10px; font-size: .8rem; font-weight: 700; color: var(--text-2); }
.font-card .fc-name small { font-weight: 500; color: var(--text-3); }
.swatch { position: relative; width: 64px; cursor: pointer; text-align: center; font-size: .74rem; font-weight: 600; color: var(--text-2); border: 0; background: none; padding: 0; }
.swatch .sw { display: block; width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--c1), var(--c2)); margin-bottom: 6px; position: relative; transition: transform .3s var(--ease-spring), box-shadow .3s; }
.swatch:hover .sw { transform: translateY(-3px) scale(1.04); }
.swatch.is-active .sw { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c1); }
.swatch.is-active .sw::after { content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='white'%3E%3Cpath d='M232.49 80.49l-128 128a12 12 0 01-17 0l-56-56a12 12 0 1117-17L96 183 215.51 63.51a12 12 0 0117 17z'/%3E%3C/svg%3E") center/contain no-repeat; }
.swatch input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 64px; height: 64px; }
.swatch.custom .sw { background: conic-gradient(from 0deg, #f43f5e, #f59e0b, #10b981, #06b6d4, #6366f1, #d946ef, #f43f5e); }
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-card { border: 2px solid var(--border); border-radius: 16px; padding: 8px; cursor: pointer; background: var(--surface); transition: .2s; text-align: left; }
.theme-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.theme-card .tc-prev { height: 76px; border-radius: 10px; display: flex; gap: 5px; padding: 7px; overflow: hidden; }
.theme-card .tc-prev .s { width: 24%; border-radius: 6px; }
.theme-card .tc-prev .m { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.theme-card .tc-prev .m i { display: block; height: 12px; border-radius: 4px; }
.theme-card .tc-prev .m i:last-child { flex: 1; }
.theme-card span { display: block; font-weight: 600; font-size: .84rem; margin: 8px 4px 2px; color: var(--text); }
.tc-light .tc-prev { background: #eef0f7; } .tc-light .s, .tc-light .m i { background: #fff; }
.tc-dark .tc-prev { background: #080914; } .tc-dark .s, .tc-dark .m i { background: #1b1f34; }
.tc-auto .tc-prev { background: linear-gradient(90deg, #eef0f7 50%, #080914 50%); } .tc-auto .s { background: #fff; } .tc-auto .m i { background: #1b1f34; }
.logo-drop { display: flex; align-items: center; gap: 18px; }
.logo-drop .filepond--root { width: 120px; }
/* barcode label designer: fixed 50x25mm canvas (scaled 4x on screen) */
.label-stage { display: grid; place-items: center; padding: 30px; border-radius: 18px; background: repeating-conic-gradient(var(--surface-3) 0% 25%, var(--surface-2) 0% 50%) 50% / 20px 20px; }
.label-paper { width: 200mm; width: 400px; height: 200px; background: #fff; color: #000; border-radius: 10px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.35); padding: 12px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; font-family: Arial, sans-serif; position: relative; }
.label-paper::after { content: "50 × 25 mm"; position: absolute; bottom: -24px; right: 0; font: 600 .72rem var(--font); color: var(--text-3); }
.label-paper svg { max-width: 100%; height: auto; }
.label-paper .l-shop { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.label-paper .l-name { font-weight: 600; line-height: 1.1; }
.label-paper .l-price { font-weight: 800; }
.range { width: 100%; accent-color: var(--primary); }

/* ---------- 21. Page: invoice / print ---------- */
.inv-shell { display: flex; justify-content: center; }
.invoice-a4 { width: 210mm; max-width: 100%; min-height: 297mm; background: #fff; color: #111827; padding: 16mm 14mm; box-shadow: var(--shadow-lg); border-radius: 6px; font-size: 12.5px; position: relative; overflow: hidden; }
.invoice-a4::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: var(--grad); }
.invoice-a4 h1, .invoice-a4 h2, .invoice-a4 h3, .invoice-a4 h4 { color: #111827; }
.invoice-a4 .inv-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid #eef0f6; }
.invoice-a4 .inv-title { font-family: var(--font-display); font-size: 30px; letter-spacing: -.02em; color: var(--primary); }
.invoice-a4 table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.invoice-a4 th { background: #f4f5fb; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b7280; text-align: left; padding: 10px; }
.invoice-a4 td { padding: 10px; border-bottom: 1px solid #eef0f6; }
.invoice-a4 .tr { text-align: right; }
.invoice-a4 .inv-tot { margin-left: auto; width: 300px; margin-top: 16px; }
.invoice-a4 .inv-tot div { display: flex; justify-content: space-between; padding: 6px 0; }
.invoice-a4 .inv-tot .g { font-size: 18px; font-weight: 800; border-top: 2px solid #111827; margin-top: 6px; padding-top: 10px; }
.invoice-a4 .muted { color: #6b7280; }
.invoice-a4 .stamp { position: absolute; right: 30mm; bottom: 60mm; transform: rotate(-14deg); border: 3px solid #10b981; color: #10b981; font-weight: 800; font-size: 26px; padding: 6px 18px; border-radius: 10px; letter-spacing: .1em; opacity: .5; }
.invoice-thermal { width: 80mm; background: #fff; color: #000; padding: 6mm 4mm; font-family: var(--font-mono); font-size: 11px; box-shadow: var(--shadow-lg); position: relative; }
.invoice-thermal.w58 { width: 58mm; font-size: 9.5px; }
.invoice-thermal::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: linear-gradient(-45deg, transparent 6px, #fff 0) 0 0 / 12px 10px, linear-gradient(45deg, transparent 6px, #fff 0) 0 0 / 12px 10px; }
.invoice-thermal .c { text-align: center; }
.invoice-thermal .dash { border-top: 1px dashed #000; margin: 6px 0; }
.invoice-thermal .r { display: flex; justify-content: space-between; gap: 6px; }
.invoice-thermal .b { font-weight: 700; }

/* ---------- 22. Super admin bits ---------- */
.shop-cell { display: flex; align-items: center; gap: 12px; }
.shop-cell .avatar { border-radius: 12px; }
.area-admin .sb-link.is-active { background: linear-gradient(135deg, #0f172a, #334155); box-shadow: 0 8px 20px -8px rgba(15, 23, 42, .6); }
html[data-theme="dark"] .area-admin .sb-link.is-active { background: linear-gradient(135deg, #f8fafc, #cbd5e1); color: #0f172a; }
.admin-flag { font-size: .66rem; font-weight: 800; letter-spacing: .1em; padding: 3px 7px; border-radius: 6px; background: #0f172a; color: #fff; }
html[data-theme="dark"] .admin-flag { background: #fff; color: #0f172a; }
.impersonate-bar { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 8px 16px; background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 12px, #fbbf24 12px, #fbbf24 24px); color: #1f1300; font-weight: 700; font-size: .84rem; }

/* ---------- 23. Next-round placeholder ---------- */
.soon { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.soon .e-ic { width: 110px; height: 110px; font-size: 52px; border-radius: 32px; }

/* ---------- 24. Responsive ---------- */
@media (max-width: 1599.98px) {
  .build-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1399.98px) {
  .pos { grid-template-columns: 1fr 380px; }
}
@media (max-width: 1199.98px) {
  :root { --gutter: 20px; }
  .build-grid { grid-template-columns: 1fr; }
  .build-summary { position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 991.98px) {
  .sp-main, .sb-collapsed .sp-main { margin-left: 0; }
  .sb { transform: translateX(calc(-100% - 24px)); width: min(300px, 86vw) !important; }
  .sb-open .sb { transform: none; box-shadow: var(--shadow-lg); }
  .sb-toggle { display: none; }
  .sb-collapsed .sb-title, .sb-collapsed .sb-label, .sb-collapsed .sb-caret, .sb-collapsed .sb-badge, .sb-collapsed .sb-cash { display: revert; }
  .sb-scrim { position: fixed; inset: 0; z-index: calc(var(--z-sidebar) - 1); background: rgba(8,9,22,.45); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .icon-btn.tb-burger { display: grid; }
  .tb-search { width: 44px; padding: 0; justify-content: center; }
  .tb-search span, .tb-search .kbd { display: none; }
  .tb-user .meta, .tb-hide-md { display: none !important; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-grid { overflow: visible; }
  .cart { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-drawer); border-radius: 26px 26px 0 0; max-height: 88dvh; transform: translateY(105%); transition: transform .45s var(--ease-out); }
  .cart-open .cart { transform: none; }
  .cart-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .pos-fab { display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: calc(var(--z-drawer) - 1); height: 58px; border-radius: 18px; }
  .pos-left { padding-bottom: 80px; }
  .set-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .set-nav button { white-space: nowrap; width: auto; }
  .set-nav button small { display: none; }
}
@media (max-width: 767.98px) {
  html { font-size: 14px; }
  :root { --gutter: 14px; }
  .input, .textarea, .ts-wrapper .ts-control input, .qty input, .input-sm { font-size: 16px; }
  .page-head h1 { font-size: 1.45rem; }
  .stat-value { font-size: min(var(--stat-size), 1.28rem); white-space: nowrap; }
  .stat { padding: 14px 14px; }
  .stat-ic { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog { border-radius: 24px 24px 0 0; max-height: 94dvh; max-width: 100% !important; }
  .modal-foot { border-radius: 0; }
  .cmdk .modal-dialog { margin-top: 0; align-self: flex-end; }
  .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
  .hero { padding: 22px; }
  .theme-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tb-user { padding: 3px; }
  .label-paper { width: 300px; height: 150px; }
  .filepond--item { width: calc(50% - .5em); }
  .tbl-toolbar .ig { width: 100%; }
  .build-table thead { display: none; }
  .build-table, .build-table tbody, .build-table tr, .build-table td { display: block; width: 100%; }
  .build-table tr.b-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); position: relative; }
  .build-table tr.b-row td { border: 0 !important; border-radius: 0 !important; padding: 0; background: none !important; }
  .build-table td.b-typecell, .build-table td.b-desccell { grid-column: 1 / -1; }
  .build-table td[data-lbl]::before { content: attr(data-lbl); display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 4px; }
  .build-table .b-num, .build-table .b-qty { width: 100%; }
  .build-table td.b-actcell { position: absolute; top: 12px; right: 12px; width: auto; }
  .build-table .b-total { text-align: left; }
}
@media (hover: none) {
  .card.spot::before, .card.spot::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; }
}

/* print page (documents) */
.print-toolbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
body[data-page="print"] .inv-shell { padding: 28px 12px 60px; }
body[data-page="print"] .invoice-thermal { margin: 0 auto; }

/* ---------- 25. Print ---------- */
@media print {
  body { background: #fff !important; }
  body::before, body::after, .sb, .tb, .sp-announce, .no-print, .toasts, .sp-progress, .bulk-bar, .print-toolbar, .impersonate-bar { display: none !important; }
  body[data-page="print"] .inv-shell { padding: 0 !important; }
  .sp-main { margin: 0 !important; }
  .sp-content { padding: 0 !important; max-width: none; }
  .invoice-a4, .invoice-thermal { box-shadow: none !important; border-radius: 0; margin: 0; }
  .inv-shell { display: block; }
  .inv-hidden-print { display: none !important; }
}

/* View-transition circular theme reveal */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
