/* ==========================================================
   TIFFNY Inventory — Aurora theme
   Tokens (light = default, dark via html[data-theme="dark"]), app shell,
   glass panels and shared components. Module styles live in tiffny.css and
   only use the tokens defined here.
   ========================================================== */

/* ---------- Tokens: light (default) ---------- */
:root {
  color-scheme: light;
  --font: 'Space Grotesk', system-ui, sans-serif;

  --bg: #f3f5ff;
  --text: #151833;
  --text-2: #3a4070;
  --muted: #5f6690;
  --faint: #8e94b8;
  --line: rgba(60, 70, 140, .12);
  --line-strong: rgba(60, 70, 140, .22);
  --grid: rgba(60, 70, 140, .08);

  --accent: #0891b2;
  --accent-2: #8b5cf6;
  --link: #0e7490;
  --primary: #0891b2;
  --primary-strong: #0e7490;
  --grad: linear-gradient(90deg, #06b6d4, #8b5cf6);
  --ink: #151833;

  --ok: #059669;   --ok-fg: #047857;  --ok-bg: rgba(5, 150, 105, .12);   --ok-line: rgba(5, 150, 105, .28);
  --warn: #d97706; --warn-fg: #b45309; --warn-bg: rgba(217, 119, 6, .13); --warn-line: rgba(217, 119, 6, .3);
  --bad: #e11d48;  --bad-fg: #be123c;  --bad-bg: rgba(225, 29, 72, .10);  --bad-line: rgba(225, 29, 72, .28);
  --info-fg: #0e7490; --info-bg: rgba(8, 145, 178, .10); --info-line: rgba(8, 145, 178, .28);

  --c1: #06b6d4; --c2: #8b5cf6; --c3: #ec4899; --c4: #10b981; --c5: #f59e0b;
  --trend: #0891b2;
  --tip-bg: rgba(21, 24, 51, .92);
  --donut-border: #fff;

  --panel: rgba(255, 255, 255, .8);
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(60, 70, 140, .045);
  --surface-3: rgba(60, 70, 140, .09);
  --edge: linear-gradient(140deg, rgba(6, 182, 212, .55), rgba(139, 92, 246, .15) 40%, rgba(236, 72, 153, .45));
  --shadow: 0 12px 32px -18px rgba(60, 70, 140, .35);
  --focus: 0 0 0 3px rgba(8, 145, 178, .18);
}

/* ---------- Tokens: dark ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #04050d;
  --text: #e8ecff;
  --text-2: #c3c9ea;
  --muted: #8b93b8;
  --faint: #646c94;
  --line: rgba(148, 163, 255, .12);
  --line-strong: rgba(148, 163, 255, .22);
  --grid: rgba(148, 163, 255, .08);

  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --link: #67e8f9;
  --primary: #0891b2;
  --primary-strong: #0e7490;
  --grad: linear-gradient(90deg, #22d3ee, #a78bfa);
  --ink: rgba(148, 163, 255, .16);

  --ok: #34d399;   --ok-fg: #6ee7b7;  --ok-bg: rgba(52, 211, 153, .14);  --ok-line: rgba(52, 211, 153, .3);
  --warn: #fbbf24; --warn-fg: #fcd34d; --warn-bg: rgba(251, 191, 36, .14); --warn-line: rgba(251, 191, 36, .3);
  --bad: #fb7185;  --bad-fg: #fda4af;  --bad-bg: rgba(251, 113, 133, .14); --bad-line: rgba(251, 113, 133, .3);
  --info-fg: #67e8f9; --info-bg: rgba(34, 211, 238, .12); --info-line: rgba(34, 211, 238, .3);

  --c1: #22d3ee; --c2: #a78bfa; --c3: #f472b6; --c4: #34d399; --c5: #fbbf24;
  --trend: #22d3ee;
  --tip-bg: rgba(10, 12, 28, .95);
  --donut-border: #0b0d1f;

  --panel: rgba(11, 13, 31, .8);
  --surface: rgba(255, 255, 255, .04);
  --surface-2: rgba(148, 163, 255, .06);
  --surface-3: rgba(148, 163, 255, .11);
  --edge: linear-gradient(140deg, rgba(34, 211, 238, .5), rgba(167, 139, 250, .12) 40%, rgba(244, 114, 182, .4));
  --shadow: 0 12px 32px -18px rgba(0, 0, 0, .6);
  --focus: 0 0 0 3px rgba(34, 211, 238, .22);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
code { font-size: .92em; }
.ic { width: 18px; height: 18px; flex: none; display: block; }
::selection { background: rgba(34, 211, 238, .3); }

/* Native form controls pick up the theme everywhere */
input, select, textarea { color: var(--text); }
select option { background: var(--bg); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--faint); }

/* ---------- Aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .38; animation: drift 24s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { width: 60vw; height: 38vw; left: -12vw; top: -14vw; background: linear-gradient(120deg, #06b6d4, #3b82f6); }
.aurora span:nth-child(2) { width: 50vw; height: 36vw; right: -14vw; top: 4vw; background: linear-gradient(120deg, #8b5cf6, #ec4899); animation-duration: 30s; animation-delay: -8s; }
.aurora span:nth-child(3) { width: 62vw; height: 32vw; left: 18vw; bottom: -18vw; background: linear-gradient(120deg, #10b981, #22d3ee); animation-duration: 36s; animation-delay: -14s; }
.aurora::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 0, rgba(243, 245, 255, .6) 85%); }
[data-theme="dark"] .aurora span { opacity: .55; }
[data-theme="dark"] .aurora::after { background: radial-gradient(ellipse at center, transparent 0, rgba(4, 5, 13, .65) 85%); }
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  50% { transform: translate(8vw, 6vh) rotate(20deg) scale(1.15); }
  100% { transform: translate(-6vw, 10vh) rotate(-12deg) scale(.95); }
}
@media (prefers-reduced-motion: reduce) { .aurora span { animation: none; } }

/* ---------- Glass panels ---------- */
.sidebar, .search, .user, .icon-btn, .segmented, .date-chip,
.kpi, .dash-card,
.form-card, .table-card, .list-stat, .stat-card, .panel, .summary-card, .bulk-card, .upload-card, .po-card,
#page .card {
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--edge) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.kpi, .dash-card, .form-card, .table-card, .panel, .summary-card, .bulk-card, .upload-card, .po-card, #page .card {
  border-radius: 18px; box-shadow: var(--shadow);
}
.list-stat, .stat-card { border-radius: 16px; box-shadow: var(--shadow); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px; flex: none; position: sticky; top: 16px; height: calc(100vh - 32px);
  margin: 16px 0 16px 16px; border-radius: 20px; padding: 20px 14px;
  display: flex; flex-direction: column; overflow: hidden; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; text-decoration: none; color: var(--text); }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; flex: none; box-shadow: 0 0 22px rgba(34, 211, 238, .35); }
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

#menu {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  padding: 4px 6px 4px 4px; margin: 0 -6px 0 -4px;
  scrollbar-width: thin; scrollbar-color: rgba(127, 127, 127, .3) transparent;
}
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 14px 12px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; text-align: left; text-decoration: none; font-weight: 500; font-size: 13.5px;
  color: #4b5280; transition: background .2s, color .2s, box-shadow .2s;
}
.nav-item > span { flex: 1; }
.nav-item:hover { color: var(--text); background: rgba(60, 70, 140, .06); }
.nav-item.active {
  color: var(--text); background: linear-gradient(90deg, rgba(6, 182, 212, .16), rgba(139, 92, 246, .04));
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item.active .ic, .nav-item.active-parent > .ic:first-child { color: var(--accent); }
.nav-item.active-parent { color: var(--text); }
.nav-item .chev { width: 14px; height: 14px; opacity: .45; transition: transform .2s; }
.nav-parent.open > .nav-item .chev { transform: rotate(90deg); }
.nav-item.is-soon { cursor: default; opacity: .55; }
.nav-item.is-soon:hover { background: none; color: inherit; }
.nav-item em { font-style: normal; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }

.submenu { display: none; padding: 2px 0 6px 42px; }
.nav-parent.open > .submenu { display: block; }
.submenu-item {
  display: block; padding: 7px 10px; margin-bottom: 1px; border-radius: 8px; font-size: 13px;
  color: var(--muted); text-decoration: none; transition: background .2s, color .2s;
}
.submenu-item:hover { color: var(--text); background: rgba(60, 70, 140, .06); }
.submenu-item.active { color: var(--accent); font-weight: 600; background: rgba(6, 182, 212, .08); }

[data-theme="dark"] .nav-item { color: #a8afd3; }
[data-theme="dark"] .nav-item:hover, [data-theme="dark"] .submenu-item:hover { color: #fff; background: rgba(148, 163, 255, .07); }
[data-theme="dark"] .nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(34, 211, 238, .22), rgba(167, 139, 250, .06)); }
[data-theme="dark"] .nav-item.active .ic { filter: drop-shadow(0 0 6px #22d3ee); }
[data-theme="dark"] .nav-item.active-parent { color: #fff; }
[data-theme="dark"] .submenu-item.active { background: rgba(34, 211, 238, .1); }

.side-foot { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; margin-top: 12px; border-radius: 14px; background: rgba(60, 70, 140, .05); }
[data-theme="dark"] .side-foot { background: rgba(148, 163, 255, .06); }
.side-foot-text { flex: 1; min-width: 0; }
.side-foot strong, .user strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot small, .user small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 700; font-size: 13px; background: linear-gradient(135deg, #22d3ee, #a78bfa); color: #04050d;
}

.main { flex: 1; min-width: 0; padding: 20px 28px 40px; }

.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 46px; border-radius: 12px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 46px; height: 46px; display: grid; place-items: center; position: relative; flex: none; border-radius: 12px; color: var(--text); }
.icon-btn:hover { color: var(--accent); }
.icon-btn-sm { width: 34px; height: 34px; border-radius: 10px; }
.menu-btn { display: none; }
.theme-btn .when-dark, [data-theme="dark"] .theme-btn .when-light { display: none; }
[data-theme="dark"] .theme-btn .when-dark { display: block; }
.user { display: flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border-radius: 999px; min-width: 0; }

.scrim { display: none; }

#page { min-height: calc(100vh - 140px); }

/* ---------- Page headings ---------- */
.page-head, .page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head h1, .page-header h1 {
  font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  background: linear-gradient(90deg, #151833, #0891b2 50%, #8b5cf6 80%, #db2777);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .page-head h1, [data-theme="dark"] .page-header h1 {
  background: linear-gradient(90deg, #fff, #a5f3fc 40%, #c4b5fd 70%, #f9a8d4);
  -webkit-background-clip: text; background-clip: text;
}
.page-head p, .page-header p { color: var(--muted); margin-top: 4px; }
.head-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; max-width: 100%; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb b { color: var(--accent); font-weight: 600; }
.form-head h2, .table-head h3, .panel-title { color: var(--text); }

/* ---------- Segmented control + date chip ---------- */
.segmented { display: flex; padding: 4px; gap: 2px; border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { padding: 8px 14px; border: 0; border-radius: 9px; background: none; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--muted); transition: .2s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--grad); color: #04050d; font-weight: 700; box-shadow: 0 6px 16px rgba(8, 145, 178, .3); }
[data-theme="dark"] .segmented button.active { box-shadow: 0 0 18px rgba(34, 211, 238, .45); }
.date-chip { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 42px; border-radius: 12px; font-size: 13px; font-weight: 500; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn { font-family: inherit; border-radius: 10px; }
.btn-primary { background: var(--grad); color: #04050d; box-shadow: 0 6px 16px -6px rgba(8, 145, 178, .55); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); color: #04050d; }
.btn-outline { background: var(--surface); color: var(--text-2); border: 1px solid var(--line-strong); }
.btn-outline:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.btn-success { background: var(--ok); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
[data-theme="dark"] .btn-success, [data-theme="dark"] .btn-danger { color: #04050d; }

/* ---------- Forms ---------- */
.field input, .field select, .field textarea,
.form-control, .form-select, .qty-input, .table-input {
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px;
}
.field input:focus, .field select:focus, .field textarea:focus,
.form-control:focus, .form-select:focus, .qty-input:focus, .table-input:focus {
  border-color: var(--accent); box-shadow: var(--focus); outline: none;
}
.field label { color: var(--text-2); }

/* ---------- Tables ---------- */
.data-table th { background: var(--surface-2); color: var(--muted); border-bottom-color: var(--line); letter-spacing: .06em; }
.data-table td { color: var(--text-2); border-bottom-color: var(--line); }
.data-table tr:hover td { background: var(--surface-2); }

/* ---------- Stats ---------- */
.list-stat .val, .stat-body .value { color: var(--text); }
.ls-icon.blue { background: var(--info-bg); color: var(--info-fg); }
.ls-icon.green { background: var(--ok-bg); color: var(--ok-fg); }
.ls-icon.orange { background: var(--warn-bg); color: var(--warn-fg); }
.ls-icon.red { background: var(--bad-bg); color: var(--bad-fg); }

/* ---------- Alerts / toast ---------- */
.alert-success, .alert-error, .alert-info { border-radius: 12px; backdrop-filter: blur(12px); }
#toast { background: var(--ink); color: #fff; }
#toast.success { background: var(--ok); color: #04050d; }
#toast.error { background: var(--bad); color: #fff; }

/* ---------- Pagination (admin.common.pagination) ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pager-links a, .pager-links span {
  min-width: 34px; height: 34px; padding: 0 10px; display: grid; place-items: center; border-radius: 10px;
  font-size: 13px; text-decoration: none; color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
}
.pager-links a:hover { border-color: var(--accent); color: var(--accent); }
.pager-links .is-active { background: var(--grad); color: #04050d; font-weight: 700; border-color: transparent; }
.pager-links .is-disabled { opacity: .45; }

/* ---------- Bootstrap pages (PDF import, production) follow the theme ---------- */
#page .card { color: var(--text); --bs-card-bg: transparent; --bs-card-cap-bg: var(--surface-2); --bs-card-border-color: var(--line); }
#page .table { --bs-table-bg: transparent; --bs-table-color: var(--text-2); --bs-table-border-color: var(--line); --bs-table-striped-bg: var(--surface-2); --bs-table-hover-bg: var(--surface-2); }
#page .table thead th { color: var(--muted); }
#page .text-muted { color: var(--muted) !important; }
#page .modal-content { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
#page .bg-white, #page .bg-light { background-color: var(--surface) !important; }
#page .btn-light { --bs-btn-bg: var(--surface); --bs-btn-color: var(--text-2); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-color: var(--text); }
#page .text-dark { color: var(--text) !important; }

/* ==========================================================
   Dashboard
   ========================================================== */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.kpi { display: flex; gap: 16px; align-items: flex-start; padding: 20px; }
.kpi-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: none; border-radius: 12px; color: #fff; }
.kpi-icon .ic { width: 22px; height: 22px; }
.kpi-1 .kpi-icon { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.kpi-2 .kpi-icon { background: linear-gradient(135deg, #a78bfa, #ec4899); }
.kpi-3 .kpi-icon { background: linear-gradient(135deg, #34d399, #22d3ee); }
.kpi-4 .kpi-icon { background: linear-gradient(135deg, #fb7185, #fbbf24); }
.kpi .kpi-icon { box-shadow: 0 8px 18px -6px rgba(60, 70, 140, .35); }
[data-theme="dark"] .kpi .kpi-icon { color: #04050d; }
[data-theme="dark"] .kpi-1 .kpi-icon { box-shadow: 0 0 22px rgba(34, 211, 238, .5); }
[data-theme="dark"] .kpi-2 .kpi-icon { box-shadow: 0 0 22px rgba(167, 139, 250, .5); }
[data-theme="dark"] .kpi-3 .kpi-icon { box-shadow: 0 0 22px rgba(52, 211, 153, .5); }
[data-theme="dark"] .kpi-4 .kpi-icon { box-shadow: 0 0 22px rgba(251, 113, 133, .5); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .kpi-value { text-shadow: 0 0 24px rgba(34, 211, 238, .35); }
.kpi-note { font-size: 12px; color: var(--muted); }
.kpi-note b { font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dash-card { padding: 22px; min-width: 0; }
.dash-card.wide { grid-column: 1 / -1; position: relative; overflow: hidden; }
.dash-card.wide::before {
  content: ""; position: absolute; width: 420px; height: 420px; left: -140px; top: -220px; pointer-events: none;
  background: radial-gradient(circle, rgba(6, 182, 212, .18), transparent 65%);
}
[data-theme="dark"] .dash-card.wide::before { background: radial-gradient(circle, rgba(34, 211, 238, .25), transparent 65%); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-h h3 { font-size: 15px; font-weight: 600; }
.card-h p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.link { font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.chart-box { position: relative; height: 260px; }
.empty-chart { height: 100%; display: grid; place-items: center; color: var(--faint); font-size: 13px; text-align: center; }

.hero { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 28px; align-items: center; position: relative; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.hero-num {
  display: block; font-size: 44px; font-weight: 700; letter-spacing: -.03em; margin: 8px 0; line-height: 1.1;
  background: linear-gradient(90deg, #0891b2, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .hero-num { background: linear-gradient(90deg, #a5f3fc, #c4b5fd); -webkit-background-clip: text; background-clip: text; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.hero-stats span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.hero-stats b { font-size: 15px; }
.hero .chart-box { height: 240px; }

.donut-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.donut-box { position: relative; height: 220px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.donut-center span { font-size: 11.5px; color: var(--muted); }
.legend { list-style: none; display: flex; flex-direction: column; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto 52px; gap: 12px; align-items: center; padding: 10px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.legend li:last-child { border: 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend em { font-style: normal; color: var(--muted); text-align: right; font-size: 12px; }

.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; text-align: left; padding: 0 10px 12px; white-space: nowrap; }
.dash-table td { padding: 11px 10px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-table .rank { color: var(--muted); width: 28px; }
.sku-cell .sku { font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.sku-cell .prod { color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 4px; border-radius: 2px; background: var(--line); margin: 6px 0 0 auto; width: 72px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
[data-theme="dark"] .meter i { box-shadow: 0 0 8px #22d3ee; }

.key { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.key span { display: flex; align-items: center; gap: 6px; }
.key span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.key .ok::before { background: var(--ok); } .key .warn::before { background: var(--warn); } .key .bad::before { background: var(--bad); }
.alloc-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 190px; gap: 16px; align-items: center; padding: 10px 0; }
.alloc-head { padding: 0 0 4px; }
.alloc-head span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.alloc-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.alloc-name i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.alloc-track { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.alloc-track span { height: 100%; }
.alloc-track .ok { background: var(--ok); } .alloc-track .warn { background: var(--warn); } .alloc-track .bad { background: var(--bad); }
[data-theme="dark"] .alloc-track .ok { box-shadow: 0 0 12px var(--ok); }
[data-theme="dark"] .alloc-track .warn { box-shadow: 0 0 12px var(--warn); }
[data-theme="dark"] .alloc-track .bad { box-shadow: 0 0 12px var(--bad); }
.alloc-figs { display: grid; grid-template-columns: repeat(4, 1fr); text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ok-t { color: var(--ok); } .warn-t { color: var(--warn); } .bad-t { color: var(--bad); }
.alloc-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.alloc-summary div + div { border-left: 1px solid var(--line); }
.alloc-summary span { display: block; font-size: 12px; color: var(--muted); }
.alloc-summary strong { font-size: 22px; font-weight: 700; display: inline-block; margin-top: 4px; }
[data-theme="dark"] .alloc-summary strong { text-shadow: 0 0 18px currentColor; }
.alloc-summary em { font-style: normal; font-size: 11.5px; margin-left: 4px; opacity: .8; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1140px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; margin: 0; height: 100vh; border-radius: 0 20px 20px 0; transform: translateX(-110%); transition: transform .3s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }
  .menu-btn { display: grid; }
  .main { padding: 16px; }
  .user-text { display: none; }
  .user { padding: 5px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .search { display: none; }
  .page-head h1, .page-header h1 { font-size: 24px; }
  .donut-wrap { grid-template-columns: minmax(0, 1fr); }
  .donut-box { width: 220px; max-width: 100%; margin: auto; }
  .alloc-row { grid-template-columns: 90px minmax(0, 1fr); }
  .alloc-head { display: none; }
  .alloc-figs { grid-column: 1 / -1; }
  .alloc-summary { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .alloc-summary div:nth-child(3) { border-left: 0; }
  .dash-card { padding: 18px; }
  .hero-num { font-size: 34px; }
}
