/* ===========================
   ТЭСТИ Dashboard — Design tokens
   =========================== */

:root {
  /* Brand */
  --lime: #97D700;
  --lime-dim: #7AAC00;
  --lime-soft: rgba(151, 215, 0, 0.12);
  --graphite: #1C1C1C;
  --white: #FFFFFF;

  /* Surfaces */
  --bg: #1C1C1C;
  --bg-elev-1: #232323;
  --bg-elev-2: #262626;
  --bg-elev-3: #2E2E2E;
  --border: #3A3A3A;
  --border-soft: #2F2F2F;

  /* Text */
  --fg: #FFFFFF;
  --fg-2: #C8C8C8;
  --fg-3: #9A9A9A;
  --fg-4: #6E6E6E;

  /* Status */
  --good: #97D700;
  --good-soft: rgba(151, 215, 0, 0.14);
  --warn: #F2A900;
  --warn-soft: rgba(242, 169, 0, 0.14);
  --bad: #F0444C;
  --bad-soft: rgba(240, 68, 76, 0.14);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.03) inset, 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
}

#root { min-height: 100vh; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

/* Numbers always tabular */
.num, .num * { font-variant-numeric: tabular-nums; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ===========================
   Layout
   =========================== */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(28, 28, 28, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.brand-wordmark-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-wordmark {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--white);
}

.brand-tag {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  text-transform: uppercase;
}

/* Update splash logo so it's not needed anymore — handled inline in HTML */

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crumbs .sep { opacity: 0.4; }
.crumbs .here { color: var(--fg); }

.topbar-spacer { flex: 1; }

.period-switch {
  display: flex;
  background: var(--bg-elev-2);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border-soft);
}

.period-switch button {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
  transition: all .15s ease;
}

.period-switch button.active {
  background: var(--lime);
  color: #0d0d0d;
}

.period-switch button:not(.active):hover { color: var(--fg); }

.scope {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
}

.date-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
  width: 100%;
}

/* ===========================
   Section headers
   =========================== */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--fg-3);
  text-transform: uppercase;
}

.section-sub {
  font-size: 12px;
  color: var(--fg-4);
  font-weight: 500;
}

.h1 {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}

.h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0;
}

.h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

/* ===========================
   Cards
   =========================== */

.card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.card.clickable { cursor: pointer; }
.card.clickable:hover {
  background: var(--bg-elev-3);
  border-color: var(--border);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  text-transform: uppercase;
}

/* ===========================
   Metric (KPI) card
   =========================== */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.metric {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  position: relative;
  overflow: hidden;
}
.metric:hover { background: var(--bg-elev-3); border-color: var(--border); }

.metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-value {
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.metric-unit {
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 700;
  color: var(--fg-3);
  margin-left: 4px;
  white-space: nowrap;
}

.metric .num { min-width: 0; }

.metric-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-deltas {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.delta-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 4px;
}

.spark { display: block; }

/* ===========================
   LFL color states
   =========================== */

.lfl-good { color: var(--good); }
.lfl-soft { color: #C5E36A; }
.lfl-warn { color: var(--warn); }
.lfl-bad  { color: var(--bad); }
.lfl-na   { color: var(--fg-4); }

.row-good { background: var(--good-soft); }
.row-warn { background: var(--warn-soft); }
.row-bad  { background: var(--bad-soft); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-good { background: var(--good); }
.dot-warn { background: var(--warn); }
.dot-bad  { background: var(--bad); }

/* ===========================
   Buttons
   =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all .15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--lime);
  color: #0d0d0d;
}
.btn-primary:hover { background: #aaeb12; }

.btn-ghost {
  background: var(--bg-elev-2);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elev-3); }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.btn-back:hover { background: var(--bg-elev-3); color: var(--fg); }

/* ===========================
   Tables
   =========================== */

.tbl-wrap {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  /* overflow-x:auto so wide tables scroll inside their card instead of
     pushing the whole page sideways (some screens render <table> directly
     under .tbl-wrap without an inner .tbl-scroll). */
  overflow-x: auto;
}

.tbl-scroll {
  overflow-x: auto;
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  text-transform: uppercase;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg-elev-2);
  position: sticky;
  top: 0;
}

.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg-2);
  white-space: nowrap;
}

.tbl tr:last-child td { border-bottom: none; }

.tbl tr.total-row td {
  background: #1f1f1f;
  color: var(--fg);
  font-weight: 800;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.tbl td.num-cell, .tbl th.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Rows in .tbl tables are NOT clickable (operational / commercial / tbd / etc.) —
   no hover highlight, so it doesn't falsely signal interactivity.
   Clickable elements (.metric, .alert-card, .entry, .rank-row, .abc-cell)
   keep their own hover styles. */

.cell-store {
  font-weight: 700;
  color: var(--fg);
}

.cell-lfl {
  font-weight: 700;
}

/* ===========================
   Leaders / Outsiders
   =========================== */

.rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.rank-row:last-child { border-bottom: none; }

.rank-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: var(--bg-elev-3);
  color: var(--fg-2);
  flex-shrink: 0;
}

.rank-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-2);
}

.rank-lfl {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: right;
}

/* ===========================
   Alerts strip
   =========================== */

.alert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.alert-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
}
.alert-card:hover { background: var(--bg-elev-3); border-color: var(--border); }

.alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-count {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.alert-count.bad { color: var(--bad); }
.alert-count.warn { color: var(--warn); }
.alert-count.good { color: var(--good); }

.alert-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
}

.alert-desc {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3);
  line-height: 1.4;
}

/* ===========================
   Reports & Operations entries
   =========================== */

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.entry-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.entry {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 22px;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 160px;
  position: relative;
  overflow: hidden;
}
.entry:hover { background: var(--bg-elev-3); border-color: var(--border); transform: translateY(-1px); }

.entry-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--lime-soft);
  display: grid;
  place-items: center;
  color: var(--lime);
}

.entry-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.entry-desc {
  font-size: 12.5px;
  color: var(--fg-3);
  line-height: 1.45;
  flex: 1;
}

.entry-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime);
}

/* ===========================
   Two-col grid (leaders + ranked)
   =========================== */

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Grid items default to min-width:auto, which refuses to shrink below their
   content's min-content (wide tables / ABC matrix) and pushes the page
   sideways. min-width:0 lets the column actually honour the 1fr track. */
.split-2 > * { min-width: 0; }

/* ===========================
   Badges
   =========================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad  { background: var(--bad-soft); color: var(--bad); }
.badge-neutral { background: var(--bg-elev-3); color: var(--fg-2); }

/* ===========================
   Drill page common
   =========================== */

.drill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.drill-title-block { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 100%; min-width: 0; }
.drill-title-block .h1 { max-width: min(100%, 720px); }

.drill-subtitle {
  font-size: 12px;
  color: var(--fg-3);
  font-weight: 500;
}

.drill-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.summary-cell {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.summary-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.summary-val {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
}
.summary-sub {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

/* ===========================
   ABC matrix
   =========================== */

.abc-matrix {
  display: grid;
  grid-template-columns: 60px repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 12px;
}

.abc-cell {
  background: var(--bg-elev-3);
  border-radius: 10px;
  padding: 14px;
  min-height: 130px;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid transparent;
}
.abc-cell:hover { background: #353535; border-color: var(--border); }
.abc-cell.selected { border-color: var(--lime); background: #353535; }

.abc-code {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.abc-verdict {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
}
.abc-stats {
  font-size: 11px;
  color: var(--fg-3);
  font-weight: 500;
  line-height: 1.4;
}

.abc-cell.aa { background: linear-gradient(135deg, rgba(151,215,0,0.18), rgba(151,215,0,0.04)); }
.abc-cell.aa .abc-code { color: var(--lime); }
.abc-cell.aa .abc-verdict { color: var(--lime); }
.abc-cell.cc { background: linear-gradient(135deg, rgba(240,68,76,0.16), rgba(240,68,76,0.02)); }
.abc-cell.cc .abc-code { color: var(--bad); }
.abc-cell.cc .abc-verdict { color: var(--bad); }
.abc-cell.bc, .abc-cell.cb { background: rgba(242,169,0,0.06); }

.abc-row-label, .abc-col-label {
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  text-transform: uppercase;
}

/* ===========================
   Sparkline & charts
   =========================== */

.chart-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 22px;
}

/* ===========================
   Reconciler
   =========================== */

.recon-progress {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ===========================
   Orders filter grid
   =========================== */

/* Filter row of the Orders screen: 3 selects + "Все рекомендованные" button.
   Was an inline gridTemplateColumns:'repeat(3,1fr) auto' which can't be
   overridden by a media query — moved to a class so mobile collapses to 1col. */
.orders-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

/* ===========================
   Steps grid (algorithm explainers)
   =========================== */

/* Numbered step cards under "как работает алгоритм" / "память соответствий".
   Were inline repeat(3,1fr) / repeat(4,1fr) — moved to classes so mobile
   collapses to a single column instead of overflowing the viewport. */
.steps-grid {
  display: grid;
  gap: 20px;
}
.steps-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ===========================
   Mobile
   =========================== */

@media (max-width: 900px) {
  .page { padding: 16px; }
  .topbar-inner { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .alert-grid { grid-template-columns: 1fr 1fr; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-grid-2 { grid-template-columns: 1fr; }
  /* !important: several screens set gridTemplateColumns inline (orders 2fr 1fr,
     reconciler 1.4fr 1fr) which would otherwise beat this rule and keep the
     two-column layout on mobile, causing horizontal page overflow. */
  .split-2 { grid-template-columns: 1fr !important; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  /* minmax(0,1fr) lets the three data columns shrink below their
     content's intrinsic min-width — otherwise the Cyrillic verdict/stats
     text forces each cell to ~144px and the matrix overflows 390px. */
  .abc-matrix { grid-template-columns: 32px repeat(3, minmax(0, 1fr)); padding: 8px; gap: 3px; }
  .abc-cell { padding: 10px; min-height: 100px; overflow: hidden; }
  .abc-verdict, .abc-stats { overflow-wrap: anywhere; word-break: break-word; }
  .abc-code { font-size: 18px; }
  .h1 { font-size: 24px; }
  .metric-value { font-size: 28px; }
  .crumbs { display: none; }
  .scope { display: none; }
  .recon-progress { grid-template-columns: 1fr 1fr; }
  /* Orders filter row: stack the 3 selects + button into one column so the
     4-up inline grid stops pushing the page past 390px. Button full width. */
  .orders-filter-grid { grid-template-columns: 1fr; }
  .orders-filter-btn { width: 100%; justify-content: center; }
  /* Step-card explainers collapse to a single column on mobile. */
  .steps-grid-3, .steps-grid-4 { grid-template-columns: 1fr; }
  /* anchor stat cluster: stop forced single-row column flow that overflows
     the 390px viewport — let cells wrap into a 2-up grid. */
  .anchor-stats {
    grid-auto-flow: row;
    grid-template-columns: 1fr 1fr;
    grid-auto-columns: auto;
  }
  .anchor-block { gap: 16px; }
}

@media (max-width: 540px) {
  .metric-grid { grid-template-columns: 1fr; }
  .alert-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
}

/* ===========================
   Utilities
   =========================== */

.muted { color: var(--fg-3); }
.dim   { color: var(--fg-4); }
.mono  { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
.space-y-12 > * + * { margin-top: 12px; }
.space-y-16 > * + * { margin-top: 16px; }
.space-y-24 > * + * { margin-top: 24px; }
.space-y-32 > * + * { margin-top: 32px; }

/* Print niceties just in case */
@media print {
  .topbar { position: static; }
}

.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Toast (demo-stub notifications)
   =========================== */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(38, 38, 38, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  max-width: calc(100vw - 32px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toastIn .22s ease, toastOut .3s ease 2.3s;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* Tooltip-ish inline note */
.note {
  font-size: 11px;
  color: var(--fg-4);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Drag-and-drop import zone */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  text-align: center;
  background: rgba(255,255,255,0.015);
  transition: all .15s ease;
}
.dropzone.hot { border-color: var(--lime); background: var(--lime-soft); }
.dropzone-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.dropzone-sub {
  font-size: 12px;
  color: var(--fg-3);
}

/* Tag list */
.taglist { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-elev-3);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-2);
  border: 1px solid var(--border-soft);
}

/* Anchor block (headline + stat cluster) */
.anchor-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.anchor-headline {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}
.anchor-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--lime);
  display: grid;
  place-items: center;
  color: #0d0d0d;
  flex-shrink: 0;
}
.anchor-title {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.25;
}
.anchor-title-sub {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.anchor-sub {
  font-size: 12px;
  margin-top: 4px;
}
.anchor-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(110px, max-content);
  gap: 24px;
}
@media (max-width: 700px) {
  .anchor-title-sub { display: block; margin-top: 4px; }
  .anchor-stats { gap: 16px; }
}

/* Bullet for AI-analysis */
.ai-block {
  background: linear-gradient(135deg, rgba(151,215,0,0.06), rgba(151,215,0,0));
  border: 1px solid rgba(151,215,0,0.25);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--lime);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Waterfall bars */
.bar-h { height: 12px; border-radius: 4px; }

/* Tab nav (used in P&L month selector etc.) */
.tabnav {
  display: inline-flex;
  background: var(--bg-elev-2);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border-soft);
  gap: 2px;
}
.tabnav button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  color: var(--fg-3);
}
.tabnav button.active { background: var(--bg-elev-3); color: var(--fg); }
