/* ============================================================================
 * POS Tools — gedeelde skin. Eén bron voor kleur, typografie en componenten,
 * zodat de losse tools er als één familie uitzien. CSS kan geen logica breken,
 * dus dit is de veilige manier om de tools consistent te houden zonder runtime-
 * koppeling. Giant-blauw als huiskleur.
 * ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  /* Giant huisstijl — zelfde tokens als giant-hub/crm/planner/order-flow/showroom. */
  --navy-900: #0a142e;
  --giant-100: #dce6fd;
  --giant-300: #8aabf7;

  --primary: #1e46cf;   /* giant-600 — één blauw voor de hele app suite */
  --primary-d: #1a38a8; /* giant-700 */
  --primary-l: #eef3ff;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-2: #cdd5e0;

  --text: #1a2433;
  --muted: #64748b;
  --faint: #94a3b8;

  --red: #dc2626;     --red-bg: #fef2f2;
  --orange: #ea580c;  --orange-bg: #fff3e8;
  --amber: #ca8a04;
  --green: #16a34a;   --green-bg: #ecfdf3;
  --blue: #2563eb;    --blue-bg: #eff6ff;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: var(--navy-900);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Woordmerk GIANT. — identiek aan de hub en de overige apps. */
.app-logo {
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  font-size: 20px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  background: none;
  flex: none;
  user-select: none;
}
.app-logo .dot { color: var(--giant-300); }
.app-header .app-sep {
  width: 1px; align-self: stretch; min-height: 22px;
  background: rgba(220, 230, 253, .22);
}
.app-title { display: flex; flex-direction: column; line-height: 1.15; }
.app-title b { font-size: 14px; font-weight: 700; color: #fff; }
.app-title span { font-size: 12px; color: rgba(220, 230, 253, .6); }
.app-header .sep { color: rgba(220, 230, 253, .4); }
.app-header .crumb { font-weight: 600; color: #fff; }
.app-header .spacer { margin-left: auto; }
/* Knoppen in de navy header: lichte tekst i.p.v. donker. */
.app-header .btn-ghost { color: var(--giant-100); border-color: transparent; }
.app-header .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
/* Ingelogde gebruiker + uitloggen (door het login-poortje in de header gezet). */
.app-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.app-user-name { font-size: 12px; color: var(--giant-100); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user-out {
  font: inherit; font-size: 12px; color: #fff;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(220, 230, 253, .25);
  border-radius: 7px; padding: 5px 10px; cursor: pointer;
}
.app-user-out:hover { background: rgba(255, 255, 255, .2); }

/* ── "Geen toegang"-scherm (ingelogd zonder POS-rol) ───────────────────────── */
.pos-denied {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px;
  background: var(--navy-900); color: #fff; padding: 32px 16px; text-align: center;
}
.pos-denied-logo { font-weight: 800; font-style: italic; letter-spacing: -.02em; font-size: 40px; }
.pos-denied-logo .dot { color: var(--giant-300); }
.pos-denied-card {
  background: #fff; color: #101828; border-radius: 16px; padding: 32px;
  max-width: 440px; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .45);
}
.pos-denied-card h1 { font-size: 18px; margin: 0 0 10px; }
.pos-denied-card p { font-size: 14px; color: #475467; line-height: 1.55; margin: 0 0 20px; }
.pos-denied-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pos-denied-btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border-2); background: #fff; color: var(--text); cursor: pointer; text-decoration: none;
}
.pos-denied-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.pos-denied-btn.primary:hover { background: var(--primary-d); }

/* ── Knoppen ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.wrap { max-width: 1500px; margin: 0 auto; padding: 20px 24px 40px; }
/* Tabel-pagina's gebruiken de volle schermbreedte zodat alle kolommen passen. */
.wrap.wide { max-width: none; padding-left: 16px; padding-right: 16px; }
.module-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.module-head h1 { font-size: 18px; font-weight: 700; margin: 0; }
.module-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.toolbar .right { margin-left: auto; color: var(--muted); font-size: 12px; }
/* Toolbar opgedeeld in onderwerp-groepen met dunne scheidingslijntjes + labels. */
.tb-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tb-sep { width: 1px; align-self: stretch; min-height: 22px; background: var(--border); margin: 0 2px; }
.tb-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); font-weight: 700; }

/* ── KPI strip ───────────────────────────────────────────────────────────── */
.kpis {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 4px 0;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* Groep KPI's per type: kopje + rij, met een scheidingslijn t.o.v. de vorige groep. */
.kpi-group { display: flex; flex-direction: column; gap: 7px; padding: 0 20px; border-left: 1px solid var(--border); }
.kpi-group:first-child { border-left: none; padding-left: 0; }
.kpi-group-hd { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); font-weight: 700; }
.kpi-group-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.kpi { display: flex; flex-direction: column; }
.kpi .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.kpi .val { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.kpi-actions { margin-left: auto; align-self: center; display: flex; align-items: center; gap: 8px; padding-left: 16px; }
.pill {
  background: var(--primary-l);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty .ico {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: var(--primary-l);
  color: var(--primary);
  font-size: 26px;
  margin-bottom: 16px;
}
.empty h2 { font-size: 16px; margin: 0 0 4px; }
.empty p { color: var(--muted); margin: 0 0 18px; max-width: 460px; }
.empty .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.inp, select.inp {
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.inp:focus { outline: 2px solid var(--primary-l); border-color: var(--primary); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); }

/* ── Tabel (compact + auto-fit: alle kolommen passen op het scherm) ───────── */
.tbl-scroll { max-height: calc(100vh - 280px); overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--muted);
  padding: 5px 6px;
  text-align: right;
  /* Koppen mogen over meerdere regels breken → kolombreedte wordt door de
     data bepaald, niet door de lange kop. Scheelt veel horizontale ruimte. */
  white-space: normal;
  line-height: 1.15;
  vertical-align: bottom;
  border-bottom: 2px solid var(--border);
}
table.data thead th.l { text-align: left; }
table.data thead th.th-sort { cursor: pointer; user-select: none; }
table.data thead th.th-sort:hover { color: var(--primary); }
table.data tbody td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: right;
}
table.data tbody td.l { text-align: left; }
/* Risico heeft veel tekstkolommen: kap die af met … zodat de breedte beperkt
   blijft (numerieke kolommen blijven volledig leesbaar). */
#risico tbody td.l { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
/* Beschikbaarheid (forecast-stijl): één ingesprongen label-kolom. Naam afkappen
   met … (volledige naam in de tooltip); tags (season/MY) blijven heel. */
#avail td.sticky-l { max-width: 320px; }
#avail td.sticky-l span.lname { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
/* Lettergrootte gelijk aan de forecast-tabel (table.data = 12px) — geen eigen overrides. */
/* Opengeklapte niveaus tonen in de weekweergave één compacte kopregel; dunne lijn eronder scheidt 'm van het detail. */
#avail tr.wk-head td { border-bottom: 1px solid var(--border); }
/* Over tijd: maand-kolommen subtiel getint (weken = wit) + uitklap-caret in de kop. */
#avail td.col-month { background: rgba(30, 70, 207, .035); }
#avail th.col-month .caret { vertical-align: baseline; }
.drawer #avail td.col-month, .drawer td.col-month { background: rgba(30, 70, 207, .035); }
table.data tbody tr:hover { background: var(--surface-2); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* sticky eerste kolom (pivot label) */
.sticky-l { position: sticky; left: 0; z-index: 5; background: var(--surface); }
table.data tbody tr:hover .sticky-l { background: var(--surface-2); }

/* ── Kleur-utilities (kleurenblind-proof: rood/oranje/blauw/groen) ───────── */
.c-red    { color: var(--red);    font-weight: 600; }
.c-orange { color: var(--orange); font-weight: 600; }
.c-amber  { color: var(--amber); }
.c-blue   { color: var(--blue);   font-weight: 600; }
.c-green  { color: var(--green); }
.c-muted  { color: var(--muted); }
.c-faint  { color: var(--faint); }

/* Maandcel buiten de intro/outro-periode (daarom 0): gearceerd grijs. */
td.out-window {
  background-image: repeating-linear-gradient(45deg, #eef1f5 0, #eef1f5 4px, #f6f8fb 4px, #f6f8fb 8px);
  text-align: center;
}
tbody tr:hover td.out-window { background-image: repeating-linear-gradient(45deg, #e7ebf1 0, #e7ebf1 4px, #eff2f7 4px, #eff2f7 8px); }

/* Afgelopen maanden met werkelijke verkoop (maandweergave): subtiel blauw getint. */
td.month-actual { background: #eef4fb; }
tbody tr:hover td.month-actual { background: #e4eefa; }
table.data thead th.th-actual { color: var(--primary); background: var(--primary-l); }

.tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

.row-total { background: var(--surface-2); font-weight: 700; }
.row-total .sticky-l { background: var(--surface-2); }
.row-node { font-weight: 600; }

/* ── Kolomgroepen: groep-kop-rij + verticale scheidingslijnen ──────────────── */
table.data thead tr.grp-row th {
  top: 0;
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-l);
  text-align: center;
  padding: 4px 6px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.data thead tr.grp-row th.sticky-l { background: var(--surface-2); }
.grp-first { border-left: 2px solid var(--border-2) !important; }

/* ── Niveau-arcering uitgevouwen rijen (segment → SKU steeds lichter) ──────── */
.row-node.row-lvl0 { background: #e9f0fa; }
.row-node.row-lvl0 .sticky-l { background: #e9f0fa; }
.row-node.row-lvl1 { background: #eff4fb; }
.row-node.row-lvl1 .sticky-l { background: #eff4fb; }
.row-node.row-lvl2 { background: #f4f8fc; }
.row-node.row-lvl2 .sticky-l { background: #f4f8fc; }
.row-node.row-lvl3 { background: #f9fbfe; }
.row-node.row-lvl3 .sticky-l { background: #f9fbfe; }
.row-node.row-lvl0 td { border-top: 2px solid var(--border-2); }   /* segment-blokken duidelijk scheiden */
.row-node.row-lvl0 .sticky-l { box-shadow: inset 3px 0 0 var(--primary); }
.row-node.row-lvl1 .sticky-l { box-shadow: inset 3px 0 0 #8aa9d6; }
.row-sku .sticky-l { box-shadow: inset 3px 0 0 var(--border-2); }
.row-sku:hover { background: var(--surface-2); }

/* Afgevinkte ("gehad") rijen: subtiel doffer; hover maakt weer leesbaar. */
tr.row-done { opacity: .45; }
tr.row-done:hover { opacity: 1; }

.caret {
  border: none; background: none; cursor: pointer;
  color: var(--faint); font-size: 11px; width: 16px; padding: 0;
}
.caret:hover { color: var(--text); }

/* ── Popover paneel ──────────────────────────────────────────────────────── */
.panel {
  position: absolute;
  z-index: 60;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(16, 24, 40, .14);
  padding: 16px;
  min-width: 260px;
  /* Nooit buiten het scherm vallen: breedte begrenzen en scrollen als de inhoud
     te hoog wordt. Uitlijning (links/rechts) bepaalt elk paneel zelf. */
  max-width: calc(100vw - 24px);
  max-height: 78vh;
  overflow: auto;
  overscroll-behavior: contain;
}
/* Menu's in de rechter actie-balk rechts uitlijnen zodat ze niet rechts buiten
   beeld vallen; het linkse dropdown (season codes) blijft links uitgelijnd. */
.actions .panel { right: 0; }
.panel h4 { margin: 0 0 8px; font-size: 13px; }
.panel .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pop { position: relative; display: inline-block; }

/* ── Detail-venster: één model openen (gecentreerd modaal) ───────────────── */
.open-btn {
  border: none; background: none; cursor: pointer;
  color: var(--primary); font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 5px; margin-left: 4px; flex: none;
}
.open-btn:hover { background: rgba(30, 70, 207, .08); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 90; }
/* Venster met STABIEL kader: vaste breedte + vanaf bovenkant verankerd, zodat
   in/uitklappen van groepen de venstergrootte niet verandert (geen "springen").
   De maten-tabel vult de breedte en scrollt binnenin. */
.drawer {
  position: fixed; top: 4vh; left: 50%; transform: translateX(-50%);
  width: min(1560px, 96vw); max-height: 92vh;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .30); z-index: 95;
  display: flex; flex-direction: column; overflow: hidden;
}
body.drawer-open { overflow: hidden; }
.drawer-head {
  background: var(--surface); border-bottom: 1px solid var(--border);
  border-radius: 14px 14px 0 0; padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px; flex: none;
}
.drawer-titlerow { display: flex; align-items: center; gap: 10px; }
.drawer-titlerow .crumbs { color: var(--muted); font-size: 12px; }
.drawer-titlerow h2 { margin: 0; font-size: 17px; }
.drawer-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.drawer-kpis { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.drawer-body { padding: 14px 18px; overflow: auto; flex: 1 1 auto; }
.drawer-target {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px; background: var(--surface);
  border-bottom: 1px solid var(--border); font-size: 13px; flex: none;
}
.drawer-target label { color: var(--muted); }
/* Item-group-kopregel in de drawer-tabel: licht getint, bovenrand als scheiding. */
.drawer .dg-grouprow td { background: var(--primary-l); border-top: 2px solid var(--border); }
/* Maatverdeling-weergave: per item group een kleur×maat-matrix. */
.mx-toolbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.mx-section { margin-bottom: 22px; }
.mx-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; flex-wrap: wrap; }
.mx-head > strong { font-size: 14px; }
.mx-curve { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; }
.mx-table { width: auto; min-width: 480px; }
.mx-table th, .mx-table td { font-size: 12px; }
.mx-table tbody td.l { font-weight: 500; }
.mx-table tr:hover { background: var(--surface-2); }
.mx-tot td { background: var(--primary-l); font-weight: 600; border-top: 2px solid var(--border); }
.mx-ref td { color: var(--muted); }
.mx-mix td { color: var(--faint); font-style: italic; }
.mx-mix td.l { font-style: normal; }
/* Handmatige maatmix-regel: bewerkbaar, licht geaccentueerd onder de mix-rijen. */
.mx-manual td { background: var(--primary-l); border-top: 2px solid var(--border); }
.mx-manual td.l { font-weight: 600; }
/* Herkomst-detail per kleur: ingesprongen mini-tabel met de artikelnummers. */
.mx-detail > td { background: var(--surface-2); padding: 6px 10px 12px 30px; }
.mx-detailtbl { width: auto; border-collapse: collapse; font-size: 11px; }
.mx-detailtbl th { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; padding: 2px 12px; border-bottom: 1px solid var(--border-2); white-space: nowrap; text-align: left; }
.mx-detailtbl td { padding: 2px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; }
.mx-detailtbl th.num, .mx-detailtbl td.num { text-align: right; }
/* Binnen het venster compacter zodat alle kolommen passen (geen horizontaal scrollen). */
.drawer .data { font-size: 11px; }
.drawer .data thead th { padding: 4px 5px; font-size: 9.5px; }
.drawer .data tbody td { padding: 2px 5px; }

/* Snelkeuze-knopje (⋯) in de FC Voorstel-cel: vaste smalle breedte i.p.v.
   meegroeien met de langste optie. De opties verschijnen bij openklappen. */
.preset-pick {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: none; background: none; color: var(--faint); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0; flex: none;
  width: 17px; text-align: center; text-align-last: center;
}
.preset-pick:hover { color: var(--primary); }

/* Invoercel bij het bewerken van een voorstel: krap (zo groot als het getal),
   geen spinner-pijltjes — zo "springt" de kolom niet open tijdens het typen. */
.cell-input {
  width: 52px; padding: 1px 4px; font-size: 12px;
  -moz-appearance: textfield;
}
.cell-input::-webkit-outer-spin-button,
.cell-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Initiële Forecast: maand-grafiek ────────────────────────────────────── */
.init-chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 168px; padding: 10px 12px 0; overflow-x: auto; border-bottom: 1px solid var(--border);
}
.init-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 38px; flex: 1; }
.init-bar .v { font-size: 10px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; }
.init-bar .bar { width: 62%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--primary); }
.init-bar.y27 .bar { background: #7c3aed; }
.init-bar .m { font-size: 10px; color: var(--faint); margin-top: 4px; white-space: nowrap; }

/* ── Delivery Analyse ────────────────────────────────────────────────────── */
.dl-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 980px) { .dl-grid2 { grid-template-columns: 1fr; } }
.dl-pad { padding: 12px 14px; }
.dl-bar { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 12px; }
.dl-bar-lbl { width: 130px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-bar-track { flex: 1; height: 14px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.dl-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.dl-bar-fill.c-red-bg { background: var(--red); }
.dl-bar-fill.c-amber-bg { background: var(--amber); }
.dl-bar-fill.c-green-bg { background: var(--green); }
.dl-bar-val { width: 66px; flex: none; text-align: right; font-family: var(--mono); color: var(--muted); }
.dl-trend-x { position: relative; height: 14px; margin-top: 2px; }
.dl-trend-x span { position: absolute; transform: translateX(-50%); font-size: 9px; color: var(--faint); }
.fb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.fb .inp { font-size: 12px; padding: 3px 6px; }
.mx-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 10px; font-size: 11px; color: var(--muted); }
.mx-legend-lbl { font-weight: 600; color: var(--faint); }
.mx-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.mx-legend-sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; border-left-width: 0; }
.seg .btn:first-child { border-radius: 7px 0 0 7px; border-left-width: 1px; }
.seg .btn:last-child { border-radius: 0 7px 7px 0; }
.data thead th.sorted { color: var(--primary); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: #fff;
  padding: 11px 15px; border-radius: 9px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: 12px;
  max-width: 380px;
}
.toast.ok { background: #0f7b3f; }
.toast.err { background: #b42318; }
.toast .acts { display: flex; gap: 6px; margin-left: auto; }
.toast button { font-size: 12px; padding: 4px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }

/* ── Launcher ────────────────────────────────────────────────────────────── */
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.launch-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.launch-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,.10); }
.launch-card.soon { opacity: .55; pointer-events: none; }
.launch-card .ico { width: 44px; height: 44px; border-radius: 11px; background: var(--primary-l); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.launch-card b { font-size: 16px; }
.launch-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
