/* ADSEC Pipeline — hand-written design system. No framework, no CDN.
   Brand #F04D30, neutral slate greys, white cards, Lightning-style density. */

:root {
  --brand: #f04d30;
  --brand-dark: #c93a20;
  --brand-soft: #fdece8;
  --ink: #16325c;
  --ink-2: #3e3e3c;
  --ink-3: #706e6b;
  --ink-4: #9a9894;
  --line: #dddbda;
  --line-soft: #eeedec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --nav: #232833;
  --nav-2: #2d333f;
  --nav-ink: #c9cdd6;
  --good: #1b7f5a;
  --good-soft: #e3f4ec;
  --warn: #a86400;
  --warn-soft: #fdf3e0;
  --bad: #c0392b;
  --bad-soft: #fbeae8;
  --teal: #0f7f88;
  --teal-soft: #e2f3f4;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(22, 50, 92, 0.08), 0 1px 3px rgba(22, 50, 92, 0.06);
  --shadow-lg: 0 8px 24px rgba(22, 50, 92, 0.16);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* The hidden attribute must win over any display rule (.boot, .shell, chips…). */
[hidden] { display: none !important; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 600; }
h1 { font-size: 20px; letter-spacing: -0.01em; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12px; }

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

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: var(--bg); color: var(--ink-3); z-index: 90;
}
/* The wordmark is navy with orange accents and reads on the light background. */
.boot-logo {
  height: 32px; width: auto;
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 212px 1fr;
  grid-template-rows: 48px 1fr;
  grid-template-areas: "top top" "nav content";
  min-height: 100vh;
}

.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  position: sticky; top: 0; z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 8px; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 22px; width: auto; flex: 0 0 auto; display: block; }
.brand-text { font-weight: 600; font-size: 14px; color: var(--ink); letter-spacing: 0.02em; }
.brand-text::before { content: "/"; color: var(--ink-4); margin-right: 6px; font-weight: 400; }

.search-wrap { flex: 1; max-width: 520px; }
.search {
  width: 100%; height: 30px;
  border: 1px solid var(--line); border-radius: 15px;
  padding: 0 14px; font-size: 13px; background: #fff; color: var(--ink-2);
}
.search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240, 77, 48, 0.14); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mode-chip {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 10px; padding: 3px 9px; font-weight: 600;
}
.usermenu { position: relative; }
.usermenu-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: var(--radius);
  color: var(--ink-2); font: inherit;
}
.usermenu-btn:hover { background: var(--bg); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.usermenu-name { font-weight: 600; font-size: 12px; }
.usermenu-pop {
  position: absolute; right: 0; top: 40px; min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 50;
}
.usermenu-meta { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; font-size: 12px; }
.usermenu-pop a, .usermenu-pop button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; background: none; cursor: pointer;
  color: var(--ink-2); font: inherit; border-radius: 4px; text-decoration: none;
}
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--bg); text-decoration: none; }

.sidenav {
  grid-area: nav;
  background: var(--nav);
  padding: 10px 0;
  display: flex; flex-direction: column;
  position: sticky; top: 48px; height: calc(100vh - 48px);
}
.sidenav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--nav-ink); text-decoration: none;
  padding: 9px 16px; font-size: 13px;
  border-left: 3px solid transparent;
}
.sidenav a:hover { background: var(--nav-2); color: #fff; text-decoration: none; }
.sidenav a.active {
  background: var(--nav-2); color: #fff;
  border-left-color: var(--brand); font-weight: 600;
}
.nav-ico { width: 16px; text-align: center; opacity: 0.85; font-size: 13px; }
.sidenav-foot { margin-top: auto; padding: 10px 16px; }
.scope-note { font-size: 11px; color: #7d8494; line-height: 1.4; display: block; }
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

.content {
  grid-area: content;
  padding: 16px 18px 40px;
  min-width: 0;
  outline: none;
}

/* ---------- page header ---------- */
.page-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.page-head h1 { font-size: 18px; }
.page-sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 12px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f7f8fa; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-dark); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { color: var(--bad); border-color: #e8c4bf; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { height: 24px; padding: 0 8px; font-size: 11px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg); }
.hamburger, .hamburger::before, .hamburger::after {
  display: block; width: 16px; height: 2px; background: var(--ink-2); position: relative;
}
.hamburger::before, .hamburger::after { content: ""; position: absolute; left: 0; }
.hamburger::before { top: -5px; }
.hamburger::after { top: 5px; }

/* ---------- cards / layout ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 14px; min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { font-size: 13px; }
.card-head .meta { color: var(--ink-3); font-size: 11px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 12px 14px; }
.card-body.flush { padding: 0; }

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

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow);
  border-top: 2px solid var(--brand);
  min-width: 0;
}
.kpi-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 18px; font-weight: 600; color: var(--ink); margin-top: 3px; letter-spacing: -0.01em; }
.kpi-foot { font-size: 11px; color: var(--ink-4); margin-top: 2px; }
.kpi.tone-warn { border-top-color: #e5a11a; }
.kpi.tone-bad { border-top-color: var(--bad); }
.kpi.tone-good { border-top-color: var(--good); }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; overflow-x: auto; max-width: 100%; max-height: 62vh; border-radius: 0 0 var(--radius) var(--radius); -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 12px; background: #fff;
}
table.data.wide { min-width: 720px; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f7f8fa; color: var(--ink-3);
  font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
  text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--ink); }
table.data thead th .sort-mark { color: var(--brand); margin-left: 3px; font-size: 10px; }
table.data tbody td {
  padding: 6px 9px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; white-space: nowrap;
}
table.data tbody tr:hover { background: #fbfbfc; }
table.data tbody tr.clickable { cursor: pointer; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.wrap { white-space: normal; max-width: 320px; }
table.data tfoot { background: #f7f8fa; }
table.data tfoot td {
  position: sticky; bottom: 0; z-index: 3;
  background: #f7f8fa; font-weight: 600; color: var(--ink);
  border-top: 1px solid var(--line); padding: 7px 9px; font-size: 12px;
  box-shadow: 0 -6px 10px -8px rgba(22, 50, 92, 0.35);
}
table.data.compact tbody td { padding: 3px 8px; }
table.data .row-actions { display: flex; gap: 4px; }
.empty {
  padding: 26px 14px; text-align: center; color: var(--ink-3); font-size: 12px;
}
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 13px; }

/* ---------- pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  background: var(--bg); color: var(--ink-3); border: 1px solid transparent;
  white-space: nowrap;
}
.pill.red { background: var(--bad-soft); color: var(--bad); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.green { background: var(--good-soft); color: var(--good); }
.pill.teal { background: var(--teal-soft); color: var(--teal); }
.pill.brand { background: var(--brand-soft); color: var(--brand-dark); }
.pill.stage { background: #eef2f8; color: #2f5480; font-weight: 600; }
.pill.stage.won { background: var(--good-soft); color: var(--good); }
.pill.stage.lost { background: var(--bad-soft); color: var(--bad); }
.pill.ghost { background: transparent; border-color: var(--line); }

/* ---------- filter bar ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  background: #fcfcfd;
}
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 600; }
.field input, .field select, .field textarea {
  height: 28px; border: 1px solid var(--line); border-radius: 4px;
  padding: 0 8px; font: inherit; font-size: 12px; background: #fff; color: var(--ink-2);
  min-width: 120px;
}
.field textarea { height: auto; min-height: 68px; padding: 6px 8px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(240, 77, 48, 0.12);
}
.field.wide input, .field.wide select { min-width: 200px; }
.field.grow { flex: 1; }
.field.grow input { width: 100%; }
.filter-actions { display: flex; gap: 6px; margin-left: auto; }

/* ---------- charts ---------- */
.chart { padding: 6px 0; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 96px; gap: 8px; align-items: center; font-size: 12px; }
.bar-row .bar-label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { display: block; width: 100%; background: #f0f2f5; border-radius: 3px; height: 16px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 3px; min-width: 2px; }
.bar-fill.alt { background: #6b7c93; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.bar-sub { font-size: 11px; color: var(--ink-4); }

.cols { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding: 6px 2px 0; }
.col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.col .col-bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #f4735b, var(--brand)); border-radius: 3px 3px 0 0; min-height: 2px; }
.col .col-bar.stage-mode { background: linear-gradient(180deg, #7d8ea3, #55637a); }
.col .col-label { font-size: 10px; color: var(--ink-3); text-align: center; white-space: nowrap; }
.col .col-num { font-size: 10px; color: var(--ink-4); white-space: nowrap; }

.donut-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut { flex: 0 0 150px; }
.legend { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.legend-row { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.legend-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.legend-val { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: #eff2f6; border-radius: var(--radius); display: flex; flex-direction: column; min-height: 220px; }
.lane-head { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 6px; }
.lane-head .lane-total { font-weight: 500; color: var(--ink-3); font-size: 11px; }
.lane-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; }
.lane.dragover { outline: 2px dashed var(--brand); outline-offset: -4px; }
.deal-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 9px; box-shadow: var(--shadow); cursor: grab; text-decoration: none; color: inherit;
  display: block;
}
.deal-card:hover { border-color: var(--brand); text-decoration: none; }
.deal-card.dragging { opacity: 0.45; }
.deal-card .dc-company { font-weight: 600; color: var(--ink); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-card .dc-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.deal-card .dc-value { font-variant-numeric: tabular-nums; }

/* ---------- deal page ---------- */
.deal-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.deal-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.deal-title h1 { font-size: 19px; }
.deal-title .sub { color: var(--ink-3); font-size: 12px; }
.deal-figures { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.figure { text-align: right; }
.figure .fig-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.figure .fig-value { font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.figure .fig-sub { font-size: 11px; color: var(--ink-4); }

.rubric-group { border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 10px; }
.rubric-group > header {
  display: flex; align-items: baseline; gap: 8px; padding: 8px 12px;
  background: #fbfbfc; border-bottom: 1px solid var(--line-soft);
}
.rubric-group > header h3 { font-size: 12px; }
.rubric-group > header .pts { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rubric-note { font-size: 11px; color: var(--ink-4); padding: 6px 12px 0; font-style: italic; }
.criterion { padding: 8px 12px; border-top: 1px solid var(--line-soft); }
.criterion-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.options { display: flex; flex-wrap: wrap; gap: 6px; }
.option {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px 3px 7px;
  font-size: 12px; cursor: pointer; background: #fff; color: var(--ink-2);
}
.option:hover { border-color: var(--brand); }
.option input { margin: 0; accent-color: var(--brand); }
.option.checked { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.option .opt-pts { font-size: 10px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.option.checked .opt-pts { color: var(--brand-dark); }
.rubric-summary {
  display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 12px;
  background: #fbfbfc; border-top: 1px solid var(--line-soft); align-items: center;
}
.rubric-summary .big { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.gauge { display: flex; align-items: center; gap: 10px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}
.timeline .t-meta { font-size: 11px; color: var(--ink-4); }
.timeline .t-body { font-size: 12px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; font-size: 12px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink-2); word-break: break-word; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  padding: 7px 12px; border: 1px solid transparent; border-bottom: 2px solid transparent;
  background: none; cursor: pointer; font: inherit; font-size: 12px; color: var(--ink-3);
  border-radius: 4px 4px 0 0;
}
.tab:hover { color: var(--ink); background: #f7f8fa; }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; background: #fff; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.form-error { color: var(--bad); font-size: 12px; }
.hint { font-size: 11px; color: var(--ink-4); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--line);
  border-top: 3px solid var(--brand); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 26px 24px;
}
.login-logo {
  height: 30px; width: auto; display: block; margin: 0 auto 18px;
}
.login-card h1 { font-size: 15px; text-align: center; margin-bottom: 2px; }
.login-card .login-sub { text-align: center; color: var(--ink-3); font-size: 12px; margin-bottom: 16px; }
.login-card .field { margin-bottom: 10px; }
.login-card .field input { width: 100%; height: 34px; }
.login-card .btn { width: 100%; justify-content: center; height: 34px; margin-top: 4px; }
.login-foot { text-align: center; font-size: 11px; color: var(--ink-4); margin-top: 14px; }

/* ---------- import report ---------- */
.recon { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.recon .rc { background: #fbfbfc; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 8px 10px; }
.recon .rc-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.recon .rc-value { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 18px;
  font-size: 12px; box-shadow: var(--shadow-lg); z-index: 80; max-width: 90vw;
}
.toast.error { background: var(--bad); }
.toast.ok { background: var(--good); }

/* ---------- misc ---------- */
.split { display: flex; gap: 14px; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sep { height: 1px; background: var(--line-soft); margin: 10px 0; }
.mono-num { font-variant-numeric: tabular-nums; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- view extras: toolbars, column picker, pager, segmented control ---------- */
textarea { font: inherit; }
.spacer { flex: 1; }
.colmenu { position: relative; }
.colmenu > summary { list-style: none; }
.colmenu > summary::-webkit-details-marker { display: none; }
.colmenu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 45; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; display: grid; gap: 3px; min-width: 180px;
}
.colmenu-list label { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
.colmenu-list label:hover { background: var(--bg); }
.pager { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-3); }
.pager .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; vertical-align: middle; }
.seg a, .seg button { border: 0; background: transparent; padding: 5px 10px; font: inherit; font-size: 11px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.seg a:hover, .seg button:hover { background: var(--bg); text-decoration: none; }
.seg .on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 20px 14px;
  text-align: center; color: var(--ink-3); font-size: 12px; background: #fbfbfc; cursor: pointer;
}
.dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); }
.points-input { width: 66px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2-1, .grid-2, .grid-1-1-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-areas: "top" "content"; }
  .nav-toggle { display: inline-flex; }
  .sidenav {
    position: fixed; top: 48px; bottom: 0; left: 0; width: 232px;
    height: auto; z-index: 60; transform: translateX(-100%);
    transition: transform 0.18s ease; box-shadow: var(--shadow-lg);
  }
  .sidenav.open { transform: translateX(0); }
  .nav-backdrop.open { display: block; position: fixed; inset: 48px 0 0 0; background: rgba(22, 50, 92, 0.32); z-index: 55; }
  .content { padding: 12px 12px 32px; }
  .usermenu-name { display: none; }
}
@media (max-width: 620px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-text { display: none; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 96px 1fr 74px; }
  .recon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-figures { margin-left: 0; }
}
@media (max-width: 560px) {
  .mode-chip, .search-wrap { display: none; }
  .brand { flex: 0 0 auto; min-width: 0; }
  .brand-text { display: inline; white-space: nowrap; }
  .topbar { gap: 8px; padding: 0 10px; }
}
