:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e7ef;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8a94a6;
  --accent: #2a78d6;
  --accent-soft: #e6f0fc;
  --danger: #d63b3b;
  --danger-soft: #fdecec;
  --warn: #b77800;
  --warn-soft: #fff4dc;
  --ok: #138a52;
  --ok-soft: #e3f6ec;
  --demo: #6250d6;
  --demo-soft: #eeebfc;
  --triage: #0f8f8a;
  --triage-soft: #dff4f2;
  --series-raw: #2a78d6;
  --series-weighted: #6250d6;
  --series-paid: #1baf7a;
  --series-lost: #eb6834;
  --series-open: #b6bfcc;
  --stage-trial: #2a78d6;
  --stage-connected: #1baf7a;
  --stage-active: #eda100;
  --stage-paid: #008300;
  --stage-lost: #9aa3b2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 8px rgba(15, 23, 42, .04);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #1a1c21; --surface-2: #20232a; --border: #2d313a;
    --text: #eef0f4; --text-2: #b9c0cc; --muted: #828b99;
    --accent: #3987e5; --accent-soft: #1b2b40;
    --danger: #ef6b6b; --danger-soft: #3a1f22; --warn: #e3a72b; --warn-soft: #382c14;
    --ok: #3cc583; --ok-soft: #173325; --demo: #9085e9; --demo-soft: #29254a;
    --triage: #3cc4bd; --triage-soft: #133433;
    --series-raw: #3987e5; --series-weighted: #9085e9; --series-paid: #199e70; --series-lost: #d95926; --series-open: #4a505c;
    --stage-trial: #3987e5; --stage-connected: #199e70; --stage-active: #c98500; --stage-paid: #2f9e2f; --stage-lost: #6b7280;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; }
body {
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* sidebar */
.sidebar {
  width: 220px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px; position: fixed; top: 0; left: 0; height: 100vh; z-index: 10;
}
.logo { font-size: 20px; font-weight: 750; display: flex; align-items: center; gap: 8px; padding: 0 8px 18px; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #2a78d6, #6250d6); color: #fff; display: grid; place-items: center; font-size: 17px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: var(--text-2); padding: 9px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; font-weight: 500; }
.sidebar nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.sidebar nav a:hover { background: var(--surface-2); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { margin-top: auto; background: var(--accent-soft); border-radius: 10px; padding: 12px; font-size: 12px; color: var(--text-2); }
.sidebar-foot strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }

main { margin-left: 220px; min-width: 0; padding: 22px 26px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.page-head p { margin: 2px 0 0; color: var(--text-2); }
.page-head.center { align-items: center; }
.page-head.center h1 { line-height: 40px; }
.page-head.center .btn { height: 40px; }
.search-big { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.search-big span { position: absolute; left: 12px; top: 50%; transform: translateY(-52%); font-size: 18px; color: var(--text-2); pointer-events: none; }
.search-big input { width: 100%; height: 40px; padding: 0 12px 0 36px; font-size: 15px; border-radius: 10px; }
mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
.match-hint { color: var(--text-2); margin-top: 2px; }

/* controls */
.btn { border: 1px solid var(--border); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ai { background: linear-gradient(135deg, #2a78d6, #6250d6); color: #fff; border: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:disabled { opacity: .6; cursor: progress; }
input, select, textarea { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 7px 9px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { width: 100%; resize: vertical; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filters label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.filters .grow { flex: 1; min-width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 11px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--accent); color: #fff; }

/* KPI tiles */
/* KPI tiles always share one row; text shrinks rather than wrapping the tiles */
.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label, .kpi .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .label { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.kpi .value { font-size: clamp(16px, 1.7vw, 22px); font-weight: 700; letter-spacing: -.01em; margin-top: 1px; white-space: nowrap; }
.kpi .sub { font-size: 11.5px; color: var(--muted); }
.kpi.alert .value { color: var(--danger); }

.banner { display: flex; gap: 10px; align-items: center; background: var(--accent-soft); border-radius: 10px; padding: 9px 14px; color: var(--text-2); margin-bottom: 14px; font-size: 13px; }

/* board */
/* five columns share the width so the board fits the window; only phone-width screens scroll sideways */
:root { --board-cols: repeat(5, minmax(0, 1fr)); }
.board { display: grid; grid-template-columns: var(--board-cols); gap: 12px; align-items: stretch; overflow-x: auto; padding-bottom: 8px; }
/* header row is pinned to the top of the window; columns below share its grid so they line up */
.board-heads { display: grid; grid-template-columns: var(--board-cols); gap: 12px; overflow: hidden;
  position: sticky; top: var(--pin-top, 0px); z-index: 5; background: var(--bg); padding-top: 6px; margin-top: -6px; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.col-head { padding: 10px 12px 8px; border: 1px solid var(--border); border-top: 4px solid var(--edge, var(--border)); border-radius: var(--radius) var(--radius) 0 0; background: var(--head, var(--surface)); }
/* headers go from light to deeper green as leads near closing; lost is light red */
[data-stage="trial"]     { --head: #f1faf4; --edge: #b7e4c7; }
[data-stage="connected"] { --head: #e0f4e7; --edge: #86d0a1; }
[data-stage="active"]    { --head: #c9ebd5; --edge: #4fb87a; }
[data-stage="paid"]      { --head: #a8dfbb; --edge: #1e9a56; }
[data-stage="lost"]      { --head: #fde8e6; --edge: #f0a39b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-stage="trial"]     { --head: #16261c; --edge: #2c5a3d; }
  :root:not([data-theme="light"]) [data-stage="connected"] { --head: #1a3123; --edge: #34734b; }
  :root:not([data-theme="light"]) [data-stage="active"]    { --head: #1e3d2a; --edge: #3d8c5a; }
  :root:not([data-theme="light"]) [data-stage="paid"]      { --head: #234b32; --edge: #3cc583; }
  :root:not([data-theme="light"]) [data-stage="lost"]      { --head: #3a1f1d; --edge: #a8524a; }
}
.col-head .t { display: flex; justify-content: space-between; font-weight: 700; }
.col-head .s { font-size: 12px; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; }
.col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col.drop { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; cursor: pointer; box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card.dragging { opacity: .4; }
.card .row1 { display: flex; align-items: center; gap: 6px; font-weight: 650; height: 20px; }
.card .row2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 3px; font-size: 12px; }
.card .product { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .mrr { font-weight: 650; font-size: 13px; color: var(--text); white-space: nowrap; }
.card .badges { display: flex; align-items: center; gap: 4px; flex: none; margin-right: auto; }
.card .rep { display: inline-flex; }
.card .meta { margin-top: 6px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); gap: 6px; height: 20px; }
.card .meta .who { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card .demo-dot { flex: none; }
.card .touched { white-space: nowrap; }
.card .next { margin-top: 6px; font-size: 11px; padding-top: 6px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); white-space: nowrap; }
.card .next > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card .next .late { color: var(--danger); font-weight: 600; }
.card .next.missing { color: var(--warn); font-weight: 600; }
.card .mk { display: inline-flex; align-items: center; }
.demo-dot { width: 17px; height: 17px; border-radius: 50%; background: var(--demo); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; display: inline-block; text-align: center; }
.triage-dot { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--triage); color: var(--triage); font-size: 10.5px; font-weight: 700; line-height: 14px; display: inline-block; text-align: center; box-sizing: border-box; }
.mk-amz { width: 16px; height: 14px; color: var(--text); }
.mk-ebay { font-size: 11px; letter-spacing: -.04em; line-height: 1; font-family: Arial, sans-serif; }
.col-more { text-align: center; font-size: 12px; color: var(--muted); padding: 4px; }

.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip.demo { background: var(--demo-soft); color: var(--demo); border-color: transparent; }
.chip.triaged { background: var(--triage-soft); color: var(--triage); border-color: transparent; }
.chip.overdue { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.mcp { background: #fff0e6; color: #b4531b; border-color: transparent; }
.chip.off { opacity: .55; border-style: dashed; background: none; }
.chip.click { cursor: pointer; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.stage-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.avatar { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.who { display: inline-flex; align-items: center; gap: 5px; }

/* panels */
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1.3fr 1fr; }
.grid.half { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .grid.two, .grid.half { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { font-size: 15px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel h2 .muted { font-weight: 500; font-size: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover { background: var(--surface-2); }
table.t th.sort { cursor: pointer; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.table-wrap { overflow-x: auto; }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 90px 90px 52px; gap: 10px; align-items: center; font-size: 13px; }
.funnel-bar { height: 26px; border-radius: 4px; background: var(--c); color: #fff; font-weight: 600; font-size: 12px; display: flex; align-items: center; padding-left: 8px; min-width: 30px; }
.funnel-row .r { text-align: right; }

/* charts */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .direct-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; }
.legend i.dash { height: 0; border-top: 2px dashed var(--muted); border-radius: 0; width: 14px; }
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(0,0,0,.15); border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 140px; }
.tooltip .tt-title { font-weight: 700; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .tt-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* drawer */
#drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .3); z-index: 40; }
#drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1320px, 100vw); background: var(--bg); z-index: 50; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.18); }
.dr-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 22px 12px; position: sticky; top: 0; z-index: 2; }
.dr-head .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dr-head h2 { margin: 0; font-size: 22px; }
.dr-head .sub { color: var(--text-2); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.dr-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* stage squares: same colours as the board column headers; the current stage is solid with a ring */
.stage-sq { display: inline-flex; gap: 4px; margin-left: 2px; }
.stage-sq button { width: 14px; height: 14px; padding: 0; border-radius: 3px; border: 1px solid var(--edge); background: var(--head); cursor: pointer; }
.stage-sq button:hover { background: var(--edge); }
.stage-sq button.cur { background: var(--edge); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--edge); }
.flag-pick { position: relative; display: inline-grid; place-items: center; width: 34px; height: 26px; border-radius: 5px; flex: none; cursor: pointer; }
.flag-pick .flag { font-size: 26px; line-height: 1; }
.flag-pick.blank { border: 1.5px dashed var(--border); background: var(--surface-2); }
.flag-pick:hover { outline: 2px solid var(--accent-soft); }
.flag-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 14px; }
/* customer record full width; then timeline 60% / deal 40% */
.dr-body { padding: 12px 18px 32px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.dr-body .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .dr-body { grid-template-columns: 1fr; } }
#drawer .panel { padding: 10px 14px; }
#drawer .panel h2 { margin-bottom: 8px; }
#drawer input:not(.switch):not([type=checkbox]), #drawer select, #drawer textarea { padding: 4px 7px; font-size: 13px; }
#drawer .field > span { font-size: 10.5px; }
.rec-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px 10px; }
.rec-grid .w2 { grid-column: span 2; }
.rec-grid .w4 { grid-column: span 4; }
@media (max-width: 1100px) { .rec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sw-inline { display: inline-flex; align-items: center; gap: 5px; }
input.switch.sm { width: 26px; height: 15px; }
input.switch.sm::after { width: 11px; height: 11px; }
input.switch.sm:checked::after { left: 13px; }
.row-form { display: flex; gap: 6px; align-items: center; }
.row-form .grow { flex: 1; min-width: 0; }
.row-form + .row-form { margin-top: 6px; }
.next-box .row-form { margin-top: 6px; }
.next-box .row-form input, .next-box .row-form select { background: var(--surface); }
.composer { padding: 8px 0 6px; border-bottom: 1px solid var(--border); }
.composer .follow { font-size: 12px; }
.composer .keep { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.tl-panel .timeline { max-height: 340px; overflow-y: auto; }
.deal-opts { display: inline-flex; gap: 6px; font-weight: 400; }
table.deal-lines { width: 100%; margin-bottom: 8px; font-size: 13px; }
table.deal-lines td { vertical-align: middle; padding: 5px 4px; }
table.deal-lines input.qty { width: 76px; }
table.deal-lines tr.disc td { color: var(--ok); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.deal-panel form + form { margin-top: 6px; }
.deal-totals { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; display: grid; gap: 3px; font-size: 13px; }
.deal-totals > div { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); }
.deal-totals > div b { color: var(--text); }
.deal-totals .big { font-size: 15px; color: var(--text); }
.deal-totals .big b { font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field > span { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.value-box { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.value-box div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.value-box b { display: block; font-size: 18px; }
.value-box span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.next-box { border-radius: 10px; padding: 10px 12px; background: var(--accent-soft); margin-bottom: 10px; }
.next-box.overdue { background: var(--danger-soft); }
.next-box.missing { background: var(--warn-soft); }
.next-box .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-2); }
.next-box .what { font-weight: 650; font-size: 15px; }
.triage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.triage-card { border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; background: var(--surface-2); }
.triage-card .k { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; }
.triage-card .v { font-size: 16px; font-weight: 700; margin: 2px 0; }
.triage-card .d { font-size: 11px; color: var(--muted); word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border: 0; }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .what b { font-weight: 650; }
.timeline .what p { margin: 2px 0 0; color: var(--text-2); }
.timeline li.stagechg .what { color: var(--text-2); font-size: 13px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 120; font-size: 13px; }
.toast.err { background: var(--danger); }

/* settings */
.settings-nav { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
table.edit td input, table.edit td select { width: 100%; padding: 5px 7px; }
table.edit td input[type=checkbox] { width: auto; }
table.edit td input.w-num { width: 80px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

/* marketplace switches */
.chip.mkt { background: #fff3e0; color: #a65a00; border-color: transparent; }
.section-title { font-weight: 700; font-size: 13px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.switch-field { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; padding-top: 16px; cursor: pointer; }
input.switch { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; border: 0; padding: 0; flex: none; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
input.switch:checked { background: var(--ok); }
input.switch:checked::after { left: 18px; }
.found { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.found b { color: var(--text-2); font-weight: 600; margin-right: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.mkt { background: #3a2a12; color: #f0b25a; } }
.input-btn { display: flex; gap: 6px; }
.input-btn input { flex: 1; }
.field a.ext { text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 4px; }

/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px; width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.login-card .logo { padding: 0; }
.login-card p { margin: 0; }
.login-error { color: var(--danger); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) mark { background: #6b5310; } }

/* narrow windows: sidebar becomes a top bar so the page keeps the full width */
@media (max-width: 760px) {
  .sidebar { position: sticky; width: auto; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .logo { padding: 0 6px 0 0; font-size: 0; gap: 0; }
  .sidebar nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .sidebar nav a { padding: 7px 9px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  main { margin-left: 0; padding: 16px 16px 32px; }
  .board-heads { --pin-top: 51px; }
  :root { --board-cols: repeat(5, minmax(200px, 1fr)); }
  .page-head { flex-wrap: wrap; }
  .search-big { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* mid-size windows (small laptops): icon-only sidebar so the five board columns keep a usable width */
@media (min-width: 761px) and (max-width: 1199px) {
  .sidebar { width: 60px; padding: 14px 8px; align-items: center; }
  .logo { font-size: 0; gap: 0; padding: 0 0 16px; }
  .sidebar nav a { font-size: 0; gap: 0; justify-content: center; padding: 10px; }
  .sidebar nav a i { font-size: 16px; width: auto; }
  .sidebar-foot { display: none; }
  main { margin-left: 60px; padding: 20px 18px 40px; }
  .board, .board-heads { gap: 8px; }
  .col-body { padding: 6px; }
}

/* board cards stay quiet: rep, triage and marketplace marks in muted greys (the demo D and overdue times keep their colour) */
.card .avatar { background: var(--surface-2) !important; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border); }
.card .triage-dot { border-color: var(--muted); color: var(--muted); }
.card .mk-amz { color: var(--muted); }
.card .mk-amz path { stroke: currentColor; }
.card .mk-ebay b { color: var(--muted) !important; }
.card .mrr { color: var(--text-2); }
/* deals under the ICP minimum: a darker grey than the column so they read as low priority */
.card.below-icp { background: color-mix(in srgb, var(--border) 55%, var(--surface-2)); box-shadow: none; }
.card.below-icp .name { color: var(--text-2); }

/* hover: the card grows to about twice its height over the cards below; the slot holds its place so nothing shifts */
.card-slot { position: relative; height: 117px; flex: none; }
.card-slot > .card { position: absolute; inset: 0 0 auto 0; min-height: 117px; transition: box-shadow .15s; }
.card .more { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .18s ease, opacity .18s ease; transition-delay: 0s; }
.card-slot:hover { z-index: 4; }
.card-slot:hover > .card { box-shadow: 0 10px 28px rgba(15, 23, 42, .18); border-color: var(--accent); }
.card-slot:hover .more { max-height: 160px; opacity: 1; transition-delay: .25s; }
.card .more { font-size: 11.5px; color: var(--text-2); }
.card .more .mrow { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px; margin-top: 4px; }
.card .more .mrow:first-child { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.card .more .k { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: .03em; padding-top: 1px; }
.card .more .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .more .two .v { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.quota-bar { height: 4px; border-radius: 2px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: var(--ok); border-radius: 2px; }
