/* ==========================================================================
   FILTER911 — Design system
   "The Ops Room" — a precise, dark-first trading cockpit.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-ar: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-lat: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 26px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-14: 56px;

  --rail: 244px;
  --topbar: 68px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --fast: 140ms var(--ease);
  --base: 220ms var(--ease);
  --slow: 420ms var(--ease);
}

html[data-theme="dark"] {
  --bg: #05070c;
  --bg-soft: #070a11;
  --panel: #0a0e16;
  --panel-2: #0d1320;
  --panel-3: #111a2a;
  --panel-hover: #121c2d;
  --line: rgba(255, 255, 255, .065);
  --line-2: rgba(255, 255, 255, .11);
  --line-3: rgba(255, 255, 255, .18);
  --text: #e9eef7;
  --dim: #93a1b6;
  --mute: #5d6b80;
  --gold: #e7b84b;
  --gold-2: #f7d78e;
  --gold-soft: rgba(231, 184, 75, .12);
  --gold-line: rgba(231, 184, 75, .28);
  --up: #34d399;
  --up-soft: rgba(52, 211, 153, .12);
  --down: #fb7185;
  --down-soft: rgba(251, 113, 133, .12);
  --neutral: #9aa8bc;
  --neutral-soft: rgba(154, 168, 188, .1);
  --info: #7dd3fc;
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .28);
  --grid-line: rgba(255, 255, 255, .05);
  --glass: rgba(8, 11, 18, .78);
  --scroll: #263247;
}

html[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-soft: #eef1f6;
  --panel: #ffffff;
  --panel-2: #fbfcfe;
  --panel-3: #f0f3f8;
  --panel-hover: #f4f7fb;
  --line: #e4e8ef;
  --line-2: #d5dbe5;
  --line-3: #c2cad7;
  --text: #0b1220;
  --dim: #58657a;
  --mute: #8a95a6;
  --gold: #a9761a;
  --gold-2: #8a5f12;
  --gold-soft: rgba(169, 118, 26, .1);
  --gold-line: rgba(169, 118, 26, .3);
  --up: #0e9f5b;
  --up-soft: rgba(14, 159, 91, .1);
  --down: #d92d42;
  --down-soft: rgba(217, 45, 66, .09);
  --neutral: #64748b;
  --neutral-soft: rgba(100, 116, 139, .08);
  --info: #0369a1;
  --shadow: 0 24px 60px rgba(16, 24, 40, .1);
  --shadow-sm: 0 8px 24px rgba(16, 24, 40, .07);
  --grid-line: rgba(11, 18, 32, .07);
  --glass: rgba(255, 255, 255, .82);
  --scroll: #c6cede;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(231, 184, 75, .075), transparent 62%),
    radial-gradient(760px 460px at 6% 0%, rgba(125, 211, 252, .05), transparent 60%);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(169, 118, 26, .08), transparent 62%),
    radial-gradient(760px 460px at 6% 0%, rgba(3, 105, 161, .05), transparent 60%);
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

::selection { background: var(--gold-soft); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: content-box; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.num {
  font-family: var(--font-lat);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.mono {
  font-family: var(--font-lat);
  font-feature-settings: "tnum" 1;
  letter-spacing: .06em;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Shell ---------- */
.app-root { position: relative; z-index: 1; min-height: 100%; }

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-soft) 100%);
  border-inline-start: 1px solid var(--line);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
}

.brand-mark { width: 38px; height: 38px; flex: none; }

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word {
  font-family: var(--font-lat);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .16em;
  color: var(--text);
}
.brand-word b { color: var(--gold); font-weight: 700; letter-spacing: .06em; }
.brand-sub {
  font-size: 10px;
  color: var(--mute);
  letter-spacing: .04em;
  margin-top: 3px;
}

.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--mute);
  padding: 14px 12px 6px;
  text-transform: uppercase;
  font-family: var(--font-lat);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--fast), color var(--fast);
  border: 1px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--gold-2);
  font-weight: 600;
}
html[data-theme="light"] .nav-item.active { color: var(--gold); }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-inline-start: auto;
  font-size: 10.5px;
  font-family: var(--font-lat);
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--panel-3);
  color: var(--dim);
  border: 1px solid var(--line);
}

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold), #a9761a);
  color: #100c03;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-lat);
}
.user-meta { min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 10.5px; color: var(--mute); }

/* ---------- Main / topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 clamp(16px, 2.4vw, 34px);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.mobile-brand { display: none; }

.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mute); white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; }
.crumb .sep { opacity: .45; }

.topbar-spacer { flex: 1; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: min(340px, 30vw);
}
.search-box svg { position: absolute; inset-inline-start: 11px; width: 16px; height: 16px; color: var(--mute); pointer-events: none; }
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 52px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color var(--fast), background var(--fast);
}
.search-box input::placeholder { color: var(--mute); }
.search-box input:focus { outline: none; border-color: var(--gold-line); background: var(--panel-3); }
.search-box kbd {
  position: absolute;
  inset-inline-end: 9px;
  font-family: var(--font-lat);
  font-size: 10px;
  color: var(--mute);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--panel);
}

.market-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
}
.market-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.market-pill .val { color: var(--text); font-weight: 600; }
.market-pill .delta { color: var(--up); font-size: 11px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--dim);
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-3); }
.icon-btn svg { width: 17px; height: 17px; }

.design-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 20px;
  border: 1px dashed var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.design-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.design-badge.live { color: var(--up); border-color: rgba(52, 211, 153, .28); background: rgba(52, 211, 153, .07); }
.design-badge.live .dot { background: var(--up); }
.design-badge.syncing { opacity: .55; }

.pager { display: flex; align-items: center; gap: 8px; }
.pager .btn { width: 30px; height: 30px; padding: 0; border-radius: 8px; }
.pager .btn svg { width: 14px; height: 14px; }
.pager .btn:first-child svg { transform: rotate(180deg); }
.pager-info { font-size: 11px; color: var(--mute); white-space: nowrap; }
.pager-info b { color: var(--text); font-weight: 600; }

/* ---------- Content ---------- */
.content { padding: clamp(18px, 2.2vw, 30px) clamp(16px, 2.4vw, 34px) 56px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-lat);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--gold-line); }
.page-title { font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.page-sub { color: var(--dim); font-size: 12.5px; margin-top: 5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.symbol-field { min-width: 170px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), color var(--fast);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--panel-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: transparent;
  color: #150f02;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(231, 184, 75, .18);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffe4a8, var(--gold-2)); border-color: transparent; }
html[data-theme="light"] .btn-primary { color: #fff; background: linear-gradient(180deg, #b8851f, #96690f); }
html[data-theme="light"] .btn-primary:hover { background: linear-gradient(180deg, #c8942a, #a3740f); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--sp-4);
}
.kpi {
  position: relative;
  overflow: hidden;
  padding: 15px 16px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow-sm);
}
.kpi::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold);
  opacity: .55;
}
.kpi.k-up::after { background: var(--up); }
.kpi.k-down::after { background: var(--down); }
.kpi.k-neutral::after { background: var(--neutral); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 11.5px; color: var(--dim); }
.kpi-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-3); color: var(--dim); }
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-value { font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--mute); margin-inline-start: 3px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.kpi-note { font-size: 10.5px; color: var(--mute); }
.kpi .spark { width: 74px; height: 24px; opacity: .95; }

/* ---------- Panels ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.panel-title .idx {
  font-family: var(--font-lat);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--mute);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 1px 5px;
}
.panel-sub { font-size: 11.5px; color: var(--mute); }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.toolbar .grow { flex: 1; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  gap: 2px;
}
.segmented button {
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  transition: background var(--fast), color var(--fast);
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--panel-3); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--gold-line); }
html[data-theme="light"] .segmented button.active { color: var(--gold); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 500;
  transition: all var(--fast);
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-2); color: var(--text); }
.chip.active { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-2); font-weight: 600; }
html[data-theme="light"] .chip.active { color: var(--gold); }
.chip .x { font-size: 13px; opacity: .6; }

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color var(--fast);
}
.field:focus-within { border-color: var(--gold-line); }
.field svg { width: 15px; height: 15px; color: var(--mute); flex: none; }
.field input, .field select {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--text);
  min-width: 0;
  width: 100%;
}
.field input::placeholder { color: var(--mute); }
.field select { cursor: pointer; }
.field select option { background: var(--panel-2); color: var(--text); }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  inset-inline-end: 11px;
  top: 50%;
  width: 6px; height: 6px;
  border-inline-end: 1.5px solid var(--mute);
  border-bottom: 1.5px solid var(--mute);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select { appearance: none; padding-inline-end: 18px; }

/* ---------- Table ---------- */
.table-scroll { overflow: auto; max-height: 62vh; position: relative; }

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  min-width: 1080px;
}

table.data.t-filter { min-width: 800px; }
table.data.dyn { min-width: 1040px; }
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-2);
  padding: 0 12px;
  height: 40px;
  text-align: start;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--mute);
  letter-spacing: .02em;
  white-space: nowrap;
  user-select: none;
}
table.data thead th.sortable { cursor: pointer; transition: color var(--fast); }
table.data thead th.sortable:hover { color: var(--text); }
table.data thead th .th-inner { display: inline-flex; align-items: center; gap: 5px; }
table.data thead th .arrow { opacity: .3; font-size: 9px; }
table.data thead th.sorted { color: var(--gold); }
table.data thead th.sorted .arrow { opacity: 1; }

table.data tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  color: var(--text);
  vertical-align: middle;
  overflow: hidden;
}
table.data tbody tr { transition: background var(--fast); cursor: pointer; }
table.data tbody tr:hover { background: var(--panel-hover); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

th.sticky-col, td.sticky-col {
  position: sticky;
  inset-inline-start: 0;
  z-index: 4;
  background: var(--panel);
}
table.data thead th.sticky-col { z-index: 6; background: var(--panel-2); }
table.data tbody tr:hover td.sticky-col { background: var(--panel-hover); }
td.sticky-col { box-shadow: -1px 0 0 var(--line) inset; }

.sym-cell { display: flex; align-items: center; gap: 10px; }
.sym-badge {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--panel-3);
  border: 1px solid var(--line);
  font-family: var(--font-lat);
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  flex: none;
}
.sym-meta { min-width: 0; }
.sym-code { font-family: var(--font-lat); font-size: 11px; color: var(--mute); letter-spacing: .04em; }
.sym-meta { display: flex; flex-direction: column; }
.sym-name { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); max-width: 158px; overflow: hidden; text-overflow: ellipsis; }
.sym-sector { display: block; font-size: 10px; color: var(--mute); max-width: 158px; overflow: hidden; text-overflow: ellipsis; }

.chg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-lat);
  font-feature-settings: "tnum" 1;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}
.chg.up { color: var(--up); background: var(--up-soft); }
.chg.down { color: var(--down); background: var(--down-soft); }
.chg.flat { color: var(--neutral); background: var(--neutral-soft); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--dim);
  white-space: nowrap;
}
.tag.up { color: var(--up); border-color: rgba(52, 211, 153, .25); background: var(--up-soft); }
.tag.down { color: var(--down); border-color: rgba(251, 113, 133, .25); background: var(--down-soft); }
.tag.gold { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.tag.neutral { color: var(--neutral); }
.tag .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.spark { width: 76px; height: 24px; flex: none; }
.cell-spark { width: 76px; height: 24px; }

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--mute);
  background: var(--panel-2);
}
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

/* ---------- Dynamic groups ---------- */
.group-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.group-bar .g {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  background: var(--panel);
}
.group-bar .g-label { font-size: 10px; color: var(--mute); letter-spacing: .06em; }
.group-bar .g-value { font-size: 13px; font-weight: 600; margin-top: 2px; display: flex; align-items: center; gap: 6px; }

table.dyn { min-width: 1040px; }
table.dyn thead tr.band th {
  height: 30px;
  background: var(--panel-3);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--line);
  text-align: center;
  padding: 0 8px;
}
table.dyn thead tr.band th.basic { color: var(--gold); }
table.dyn thead tr.cols th { top: 30px; text-align: center; }
table.dyn tbody td { text-align: center; font-family: var(--font-lat); font-size: 12px; }
table.dyn tbody td.sym-td { text-align: start; }
table.dyn thead th { font-size: 9.5px; padding: 0 4px; }
table.dyn tbody td { padding: 8px 4px; }
.val-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-lat);
}
.val-chip.pos { color: var(--up); background: var(--up-soft); }
.val-chip.neg { color: var(--down); background: var(--down-soft); }
.val-chip.neu { color: var(--neutral); background: var(--neutral-soft); }
.val-chip.dash { color: var(--mute); background: transparent; }

/* ---------- Filter builder ---------- */
.builder { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.builder-side { display: flex; flex-direction: column; gap: 12px; }
.side-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  overflow: hidden;
}
.side-card-head { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.side-card-body { padding: 14px 15px; display: flex; flex-direction: column; gap: 10px; }

.rule {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .8fr) minmax(0, .95fr) 30px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  animation: ruleIn 260ms var(--ease) both;
}
.rule .field { height: 32px; }
.rule-del {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 7px;
  color: var(--mute);
  transition: color var(--fast), background var(--fast);
}
.rule-del:hover { color: var(--down); background: var(--down-soft); }
.rule-del svg { width: 14px; height: 14px; }
.rules-list { display: flex; flex-direction: column; gap: 8px; }

.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset {
  text-align: start;
  padding: 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  transition: border-color var(--fast), background var(--fast);
}
.preset:hover { border-color: var(--gold-line); background: var(--gold-soft); }
.preset b { display: block; font-size: 11.5px; font-weight: 600; }
.preset span { display: block; font-size: 10px; color: var(--mute); margin-top: 2px; }

/* ---------- Detail ---------- */
.detail-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(700px 240px at 85% -40%, var(--gold-soft), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 18px 20px;
  margin-bottom: 14px;
}
.detail-hero .hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.hero-id { display: flex; align-items: center; gap: 13px; }
.hero-logo {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  font-family: var(--font-lat); font-size: 12px; font-weight: 600; color: var(--gold);
}
.hero-name { font-size: 19px; font-weight: 600; line-height: 1.3; }
.hero-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--mute); margin-top: 2px; }
.hero-price { text-align: end; }
.hero-price .p { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.hero-price .p small { font-size: 12px; color: var(--mute); font-weight: 500; margin-inline-start: 4px; }
.hero-price .chg { margin-top: 6px; font-size: 12.5px; padding: 3px 9px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.hero-stat { padding: 0 10px; border-inline-end: 1px solid var(--line); }
.hero-stat:last-child { border: 0; }
.hero-stat .k { font-size: 10px; color: var(--mute); }
.hero-stat .v { font-size: 13px; font-weight: 600; margin-top: 2px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  width: fit-content;
  margin-bottom: 14px;
  overflow-x: auto;
  max-width: 100%;
}
.tabs button {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
  white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--panel-3); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 14px; align-items: start; }

.chart-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chart-title { font-size: 12.5px; font-weight: 600; }
.chart-legend { display: flex; gap: 12px; font-size: 10.5px; color: var(--mute); flex-wrap: wrap; }
.chart-body { position: relative; padding: 6px 6px 0; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  z-index: 6;
  min-width: 128px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel-3);
  box-shadow: var(--shadow);
  font-size: 10.5px;
  color: var(--dim);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--fast), transform var(--fast);
}
.chart-tip.on { opacity: 1; transform: translateY(0); }
.chart-tip b { color: var(--text); font-family: var(--font-lat); }

.side-stack { display: flex; flex-direction: column; gap: 14px; }

.score-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.score-top { display: flex; align-items: center; justify-content: space-between; }
.score-ring { width: 84px; height: 84px; position: relative; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-lat); font-size: 20px; font-weight: 600; }
.score-legend { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--dim); }
.score-legend span { display: flex; align-items: center; gap: 6px; }
.score-legend i { width: 6px; height: 6px; border-radius: 50%; }

.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.level {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.level .k { font-size: 10px; color: var(--mute); }
.level .v { font-size: 13px; font-weight: 600; margin-top: 1px; }
.level.up .v { color: var(--up); }
.level.down .v { color: var(--down); }

.wave-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wave-card {
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.wave-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wave-name { font-size: 12px; font-weight: 600; }
.wave-val { font-family: var(--font-lat); font-size: 16px; font-weight: 600; }
.wave-bar { height: 4px; border-radius: 4px; background: var(--panel-3); margin-top: 10px; overflow: hidden; }
.wave-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 700ms var(--ease); }
.wave-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; font-size: 10px; color: var(--mute); }

.ind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ind-card { padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); }
.ind-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ind-name { font-size: 10.5px; color: var(--mute); letter-spacing: .02em; }
.ind-val { font-family: var(--font-lat); font-size: 17px; font-weight: 600; margin-top: 4px; }
.ind-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.ind-hint { font-size: 9.5px; color: var(--mute); }

.reading {
  padding: 15px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, var(--gold-soft), transparent);
  font-size: 12px;
  color: var(--dim);
  line-height: 1.9;
}
.reading b { color: var(--text); font-weight: 600; }
.reading .rtitle { display: flex; align-items: center; gap: 7px; color: var(--gold); font-size: 11px; font-weight: 600; margin-bottom: 6px; }
.reading .rtitle svg { width: 14px; height: 14px; flex: none; }

.side-card-body > svg { width: 15px; height: 15px; flex: none; color: var(--mute); }
.side-card-body.note-row { flex-direction: row; align-items: flex-start; gap: 9px; }
.legend svg { width: 13px; height: 13px; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}
.login-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(760px 520px at 80% 10%, rgba(231, 184, 75, .16), transparent 60%),
    linear-gradient(160deg, #0b1018 0%, #060910 60%);
  border-inline-start: 1px solid rgba(255, 255, 255, .06);
  color: #e9eef7;
}
html[data-theme="light"] .login-brand { background: radial-gradient(760px 520px at 80% 10%, rgba(169, 118, 26, .18), transparent 60%), linear-gradient(160deg, #12161f 0%, #070a10 60%); }
.login-brand .grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(600px 420px at 70% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(600px 420px at 70% 30%, #000 20%, transparent 78%);
  pointer-events: none;
}
.login-brand .pulse-line { position: absolute; inset-inline: 0; top: 58%; width: 100%; height: 120px; opacity: .5; pointer-events: none; }
.login-brand > * { position: relative; z-index: 1; }

.lb-top { display: flex; align-items: center; gap: 12px; }
.lb-word { font-family: var(--font-lat); font-weight: 600; letter-spacing: .18em; font-size: 18px; }
.lb-word b { color: var(--gold); }
.lb-tape { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.lb-tape > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: rgba(255, 255, 255, .025);
  font-size: 10.5px;
  color: #8d9bb0;
}
.lb-tape b { color: #e9eef7; font-weight: 600; }
.lb-tape i { font-style: normal; font-weight: 600; }
.lb-tape i.up { color: #34d399; }
.lb-tape i.down { color: #fb7185; }
.lb-tag {
  margin-top: auto;
  padding-top: 5vh;
}
.lb-kicker { font-family: var(--font-lat); font-size: 11px; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }
.lb-title { font-size: clamp(30px, 4vw, 46px); line-height: 1.25; font-weight: 600; margin-top: 14px; letter-spacing: -.02em; }
.lb-desc { color: #9aa8bc; font-size: 13px; max-width: 46ch; margin-top: 14px; line-height: 1.9; }
.lb-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 30px; max-width: 640px; }
.lb-feature { border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px; padding: 12px; background: rgba(255, 255, 255, .02); }
.lb-feature .n { font-family: var(--font-lat); font-size: 10px; color: var(--gold); letter-spacing: .12em; }
.lb-feature b { display: block; font-size: 12px; margin-top: 6px; font-weight: 600; }
.lb-feature span { display: block; font-size: 10.5px; color: #8d9bb0; margin-top: 3px; line-height: 1.6; }
.lb-foot { font-size: 10.5px; color: #5d6b80; display: flex; gap: 14px; flex-wrap: wrap; }

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 48px);
  background: var(--bg);
}
.login-card { width: min(392px, 100%); }
.login-card .lc-eyebrow { font-size: 11px; color: var(--mute); letter-spacing: .08em; }
.login-card h1 { font-size: 26px; font-weight: 600; margin-top: 8px; letter-spacing: -.01em; }
.login-card .lc-sub { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 11.5px; color: var(--dim); font-weight: 500; }
.input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.input-wrap:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); }
.input-wrap svg { width: 16px; height: 16px; color: var(--mute); flex: none; }
.input-wrap input { border: 0; outline: none; background: transparent; width: 100%; font-size: 13px; }
.input-wrap input::placeholder { color: var(--mute); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--dim); }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.check input { width: 14px; height: 14px; accent-color: var(--gold); margin: 0; flex: none; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { accent-color: var(--gold); width: 14px; height: 14px; }
.link { color: var(--gold); font-weight: 500; }
.login-submit { height: 46px; width: 100%; border-radius: 10px; font-size: 13.5px; margin-top: 4px; }
.login-note {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px dashed var(--line-2);
  font-size: 10.5px;
  color: var(--mute);
  line-height: 1.7;
}
.login-note b { color: var(--dim); }
.login-foot { margin-top: 18px; font-size: 10.5px; color: var(--mute); text-align: center; }

/* ---------- Misc ---------- */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--mute);
  font-size: 12.5px;
}
.empty svg { width: 34px; height: 34px; margin: 0 auto 10px; opacity: .5; }

.toast {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-3);
  color: var(--text);
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--base), transform var(--base);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.view { animation: viewIn 380ms var(--ease) both; }

/* ---------- Motion ---------- */
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ruleIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes pulseDash { to { stroke-dashoffset: 0; } }
@keyframes glow { 0%, 100% { opacity: .35; } 50% { opacity: .8; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  :root { --rail: 216px; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
  .hero-stat:nth-child(3n) { border-inline-end: 0; }
}

@media (max-width: 1080px) {
  :root { --rail: 76px; }
  .brand-text, .nav-label, .nav-item span.label, .nav-badge, .user-meta, .rail-foot .side-note { display: none; }
  .sidebar { padding: 18px 10px; align-items: center; }
  .brand { padding: 2px 0 14px; justify-content: center; }
  .nav-item { justify-content: center; padding: 11px; }
  .nav-item svg { width: 20px; height: 20px; }
  .user-card { justify-content: center; padding: 7px; border: 0; background: transparent; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder { grid-template-columns: minmax(0, 1fr); }
  .ind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
    height: 66px;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-inline-start: 0;
    border-top: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(18px);
    z-index: 60;
  }
  .brand, .nav-label, .rail-foot, .nav-group:last-of-type { display: none; }
  .nav-group { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-item { flex-direction: column; gap: 3px; padding: 6px 8px; font-size: 9.5px; border: 0; background: transparent !important; }
  .nav-item span.label { display: block; font-size: 9.5px; }
  .nav-item.active { color: var(--gold); }
  .nav-item.active::after { content: ""; position: absolute; top: -6px; width: 16px; height: 2px; border-radius: 2px; background: var(--gold); }
  .nav-item svg { width: 19px; height: 19px; }
  .main { padding-bottom: 74px; }
  .toast { bottom: 82px; }
  .topbar { height: 60px; gap: 8px; padding-inline: 14px; }
  .crumb { display: none; }
  .search-box { width: 100%; }
  .search-box input { height: 36px; }
  .market-pill { display: none; }
  .design-badge { height: 24px; font-size: 9.5px; padding: 0 8px; }
  .content { padding: 16px 14px 40px; }
  .page-head { margin-bottom: 14px; }
  .page-title { font-size: 21px; }
  .kpi-grid { gap: 8px; }
  .kpi { padding: 12px 13px; }
  .kpi-value { font-size: 22px; }
  .kpi .spark { width: 58px; }
  .toolbar { padding: 11px 12px; gap: 8px; }
  .toolbar .grow { display: none; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 0 8px; }
  .table-scroll { max-height: none; }
  table.data { min-width: 720px; }
  .table-foot { font-size: 10.5px; }
  .wave-grid { grid-template-columns: minmax(0, 1fr); }
  .group-bar { grid-template-columns: 1fr 1fr; padding: 11px 12px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-brand { display: none; }
  .login-form-side { min-height: 100vh; padding: 24px 18px; }
  .rule { grid-template-columns: 1fr 1fr; }
  .rule .rule-del { grid-column: 2; justify-self: end; }
}

@media (max-width: 720px) {
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-lat); font-size: 12px; letter-spacing: .14em; color: var(--text); }
  .mobile-brand b { color: var(--gold); }
  .topbar .search-box { display: none; }
  .design-badge { display: none; }
  .topbar { padding-inline: 14px; gap: 8px; }
  .crumb { display: none; }
  .page-actions .btn.btn-keep span { display: inline; }
  .page-actions .btn.btn-keep { width: auto; padding: 0 12px; }
  .page-head .page-actions { width: 100%; flex-wrap: nowrap; }
  .page-head .page-actions .symbol-field { flex: 1 1 auto; min-width: 0; }
  .table-foot { justify-content: center; padding: 10px 12px; }
  .table-foot .legend { display: none; }
  .pager { width: 100%; justify-content: space-between; }
  .table-scroll { display: none; }
  .mobile-list { display: flex; flex-direction: column; }
  .m-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    transition: background var(--fast);
    cursor: pointer;
  }
  .m-card:active { background: var(--panel-hover); }
  .m-card .m-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
  .m-card .m-id > span:last-child { display: flex; flex-direction: column; min-width: 0; }
  .m-card .m-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-card .m-code { display: block; font-size: 10px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-card .m-price { text-align: end; font-family: var(--font-lat); font-size: 15px; font-weight: 600; }
  .m-card .m-price small { display: block; font-size: 10px; color: var(--mute); font-weight: 400; }
  .m-metrics { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--mute); }
  .m-metrics b { color: var(--text); font-family: var(--font-lat); font-weight: 600; margin-inline-start: 3px; }
  .m-spark { margin-inline-start: auto; width: 64px; height: 20px; }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi .spark { display: none; }
  .page-actions .btn span { display: none; }
  .page-actions .btn { width: 38px; padding: 0; }
  .hero-price .p { font-size: 26px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stat:nth-child(3n) { border-inline-end: 1px solid var(--line); }
  .hero-stat:nth-child(2n) { border-inline-end: 0; }
  .ind-grid { grid-template-columns: 1fr 1fr; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; font-size: 11px; }
  .detail-hero { padding: 14px; }
  .hero-row { gap: 10px; }
  .chart-legend { display: none; }
}

/* ---------- Mobile card table ---------- */
@media (min-width: 721px) { .mobile-list { display: none; } }
