/* Layout: fixed left rail + sticky top bar; content on a cool, faintly teal neutral; white surfaces only where an object needs separating. */
:root {
  --brand: #298398; --brand-strong: #1f6a7b; --brand-soft: #e8f3f5; --brand-line: #c6e0e6;
  --hl: #e14817; --hl-soft: #fdeee8;
  --bg: #f4f7f8; --surface: #ffffff; --surface-2: #f8fafb; --line: #e2e9eb; --line-strong: #cfd9dc;
  --ink: #142429; --ink-2: #4b5f66; --ink-3: #84969c;
  --good: #23855a; --good-soft: #e6f4ed; --warn: #a8690a; --warn-soft: #fcf2df; --bad: #c0362f; --bad-soft: #fbeaea;
  --halo: #22343a; --scrim: rgba(12, 28, 33, .42);
  --f1: #298398; --f2: #2a7487; --f3: #246676; --f4: #1e5766;
  --shadow-lg: 0 12px 40px rgba(12, 28, 33, .18);
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r: 10px; --r-sm: 7px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4fb0c6; --brand-strong: #7cc6d7; --brand-soft: #16343b; --brand-line: #22505a;
    --hl: #f0703f; --hl-soft: #3a2117;
    --bg: #0d171a; --surface: #132126; --surface-2: #17282d; --line: #213439; --line-strong: #2c454b;
    --ink: #e4eef0; --ink-2: #a5b8bd; --ink-3: #6f868c;
    --good: #4cc48a; --good-soft: #143326; --warn: #e2a644; --warn-soft: #362a12; --bad: #ef6b63; --bad-soft: #3a1b1a;
    --halo: #e4eef0; --scrim: rgba(0, 0, 0, .55);
    --f1: #2f8ea4; --f2: #2a7e92; --f3: #246f80; --f4: #1e5f6e;
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4fb0c6; --brand-strong: #7cc6d7; --brand-soft: #16343b; --brand-line: #22505a;
  --hl: #f0703f; --hl-soft: #3a2117;
  --bg: #0d171a; --surface: #132126; --surface-2: #17282d; --line: #213439; --line-strong: #2c454b;
  --ink: #e4eef0; --ink-2: #a5b8bd; --ink-3: #6f868c;
  --good: #4cc48a; --good-soft: #143326; --warn: #e2a644; --warn-soft: #362a12; --bad: #ef6b63; --bad-soft: #3a1b1a;
  --halo: #e4eef0; --scrim: rgba(0, 0, 0, .55);
  --f1: #2f8ea4; --f2: #2a7e92; --f3: #246f80; --f4: #1e5f6e;
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.01em; text-wrap: balance; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.side { width: 232px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: flex-end; gap: 8px; padding: 22px 20px 18px; text-decoration: none !important; }
.logo { height: 40px; width: auto; display: block; }
.brand-sub { font: 600 11px var(--font-head); letter-spacing: .16em; color: var(--ink-3); padding-bottom: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { filter: brightness(0) invert(1); } }
:root[data-theme="dark"] .logo { filter: brightness(0) invert(1); }
nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); padding: 16px 10px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; text-decoration: none !important; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.nav-item .count { margin-left: auto; background: var(--hl); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.side-who { color: var(--ink-2); margin-bottom: 10px; }
.side-who b { color: var(--ink); font-weight: 600; }
.side-foot { font-size: 11.5px; color: var(--ink-3); padding: 16px 22px 20px; line-height: 1.5; border-top: 1px solid var(--line); }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 22px; margin: 0; white-space: nowrap; font-weight: 600; }
.top-right { margin-left: auto; display: flex; gap: 10px; align-items: center; position: relative; }
.search-wrap { position: relative; display: block; }
.search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: flex; pointer-events: none; }
.search { width: 280px; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.search-results { position: absolute; top: 44px; left: 0; width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); max-height: 380px; overflow: auto; z-index: 30; padding: 4px; }
.search-results div { padding: 8px 10px; cursor: pointer; border-radius: var(--r-sm); }
.search-results div:hover { background: var(--brand-soft); }
.user-sel { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); max-width: 220px; }
.menu-btn { display: none; }
.view { padding: 8px 28px 48px; max-width: 1760px; width: 100%; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 13px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { border-color: var(--brand); color: var(--brand-strong); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.primary:hover { color: #08181c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary, :root:not([data-theme="light"]) .btn.primary:hover { color: #08181c; } }
.btn.accent { background: var(--hl); border-color: var(--hl); color: #fff; }
.btn.good { color: var(--good); } .btn.bad { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: var(--r-sm); color: var(--ink-2); display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .ico { width: 20px; height: 20px; }
input[type=text], input[type=number], input[type=email], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 10px; background: var(--surface); width: 100%; min-width: 0; }
input:disabled { background: var(--surface-2); color: var(--ink-3); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
label.f { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.span2 { grid-column: span 2; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 .sub { font: 400 12.5px var(--font-body); color: var(--ink-3); letter-spacing: 0; }
.card.full { grid-column: 1 / -1; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; }
.kpi { padding: 16px 20px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .l { font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.kpi .v { font: 600 26px/1.2 var(--font-head); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.alert .v { color: var(--hl); }
.dash { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.dash .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }

/* Chips, avatars */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 20px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; line-height: 18px; }
.chip.blue { background: var(--brand-soft); color: var(--brand-strong); border-color: var(--brand-line); }
.chip.orange { background: var(--hl-soft); color: var(--hl); border-color: transparent; }
.chip.red { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.green { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.halo { background: var(--halo); color: var(--surface); border-color: var(--halo); }
.chip .ico { width: 12px; height: 12px; vertical-align: -2px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: none; letter-spacing: .02em; }
.temp { display: inline-flex; gap: 2px; align-items: center; }
.temp i { width: 5px; height: 11px; border-radius: 2px; background: var(--line-strong); display: inline-block; }
.temp i.on { background: var(--hl); }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }

/* Lists */
.att { display: flex; flex-direction: column; }
.att-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px; border-top: 1px solid var(--line); cursor: pointer; border-radius: var(--r-sm); }
.att-row:first-child { border-top: 0; }
.att-row:hover { background: var(--surface-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.red { background: var(--bad); } .dot.amber { background: var(--warn); } .dot.green { background: var(--good); } .dot.blue { background: var(--brand); }
.att-main { flex: 1; min-width: 0; }
.att-main b { font-weight: 600; }
.att-main .m { font-size: 12.5px; color: var(--ink-2); }

/* Toolbars */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar select, .toolbar input[type=text], .toolbar input[type=date] { width: auto; min-width: 128px; }
.toolbar .spacer { flex: 1; }
.chk { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.chk input { width: auto; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; }

/* Funnel (classic) */
.funnel { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 4px 14px; align-items: center; }
.fn-seg { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-decoration: none !important; text-align: center; padding: 0 18%; transition: filter .15s; }
.fn-seg:hover { filter: brightness(1.08); }
.fn-seg b { font: 600 14px var(--font-head); line-height: 1.2; }
.fn-seg span { font-size: 12px; opacity: .9; font-variant-numeric: tabular-nums; }
.fn-seg.target { color: var(--brand-strong); background: var(--brand-soft); }
.fn-seg.won { height: 56px; background: var(--good); }
.fn-side { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.fn-side b { display: block; color: var(--ink); font: 600 15px var(--font-head); font-variant-numeric: tabular-nums; }
.fn-halo { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--hl); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 2px 0; }
.fn-halo::before, .fn-halo::after { content: ""; flex: 1; border-top: 1.5px dashed var(--hl); opacity: .7; }
.fn-gap { grid-column: 1 / -1; height: 4px; }
.fn-note { font-size: 12px; color: var(--ink-3); margin-top: 12px; }

/* Kanban */
.board-wrap { overflow-x: auto; padding-bottom: 8px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr); gap: 14px; align-items: start; min-width: min-content; }
.col-k { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 260px); min-height: 220px; }
.col-k.parked { background: var(--warn-soft); border-color: transparent; }
.col-h { padding: 12px 14px 10px; }
.col-h .t { display: flex; align-items: center; gap: 7px; font: 600 14px var(--font-head); }
.col-h .t .n { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; font: 600 11.5px var(--font-body); color: var(--ink-2); }
.col-h .vals { font-size: 12px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.col-h .halo-tag { font: 700 10px var(--font-body); color: var(--hl); margin-left: auto; text-transform: uppercase; letter-spacing: .08em; }
.col-b { padding: 4px 10px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col-k.drag-over { outline: 2px dashed var(--brand); outline-offset: -3px; background: var(--brand-soft); }
.kc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; cursor: pointer; position: relative; }
.kc:hover { border-color: var(--brand-line); box-shadow: 0 2px 8px rgba(12, 28, 33, .06); }
.kc.flag-red::before, .kc.flag-amber::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bad); }
.kc.flag-amber::before { background: var(--warn); }
.kc.dragging { opacity: .4; }
.kc .co { font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.kc .co span:first-child { flex: 1; min-width: 0; }
.kc .ti { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.kc .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }
.kc .val { font-size: 12.5px; font-weight: 600; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.kc .nx { font-size: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; }
.kc .nx .ico { width: 14px; height: 14px; margin-top: 1px; }
.kc .nx.over { color: var(--bad); font-weight: 500; }
.kc .nx.none { color: var(--warn); }
.outcomes { display: grid; gap: 12px; margin-top: 14px; }
.drop-out { border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 12px; text-align: center; color: var(--ink-3); cursor: pointer; background: transparent; }
.drop-out b { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.drop-out.drag-over, .drop-out.on { border-color: var(--brand); border-style: solid; background: var(--brand-soft); }
.drop-out.won b { color: var(--good); } .drop-out.lost b { color: var(--bad); } .drop-out.park b { color: var(--warn); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 11.5px; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
/* Number columns hug their content and sit right; the label column takes the remaining width. */
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; padding-left: 22px; }
.card table.t th:first-child, .card table.t td:first-child { padding-left: 0; }
.card table.t th:last-child, .card table.t td:last-child { padding-right: 0; }
.card.flush { padding: 0; }
.card.flush table.t th:first-child, .card.flush table.t td:first-child { padding-left: 20px; }
.card.flush table.t th:last-child, .card.flush table.t td:last-child { padding-right: 20px; }

/* Drawer */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-bg { position: absolute; inset: 0; background: var(--scrim); }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(780px, 100%); background: var(--bg); overflow-y: auto; box-shadow: var(--shadow-lg); }
.dr-head { background: var(--surface); padding: 18px 24px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.dr-head h2 { margin: 0; font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.dr-head .x { margin-left: auto; }
.dr-sub { color: var(--ink-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dr-body { padding: 18px 24px 32px; display: flex; flex-direction: column; gap: 14px; }
.stepper { display: flex; margin-top: 18px; position: relative; }
.step { flex: 1; min-width: 0; text-align: center; padding: 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid var(--line); position: relative; }
.step:hover { color: var(--ink); }
.step.done { color: var(--brand-strong); border-color: var(--brand-line); }
.step.cur { color: var(--brand-strong); border-color: var(--brand); }
.step.halo-line::before { content: "Halo"; position: absolute; top: -14px; left: 0; font-size: 9.5px; color: var(--hl); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-left: 1.5px dashed var(--hl); padding-left: 4px; height: 38px; }
.guide { background: var(--brand-soft); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; line-height: 1.55; color: var(--ink); }
.guide b { color: var(--brand-strong); }
.guide ul { margin: 6px 0 0; padding-left: 18px; }
.flags { display: flex; flex-direction: column; gap: 6px; }
.flag { padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.flag.red { background: var(--bad-soft); color: var(--bad); } .flag.amber { background: var(--warn-soft); color: var(--warn); } .flag.ok { background: var(--good-soft); color: var(--good); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.likes { display: flex; gap: 6px; flex-wrap: wrap; }
.like { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; text-align: center; min-width: 76px; font-weight: 500; }
.like small { display: block; color: var(--ink-3); font-size: 11px; font-weight: 400; }
.like.on { background: var(--hl); color: #fff; border-color: var(--hl); }
.like.on small { color: #fff; opacity: .85; }
.qual { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.qual label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.qual input { accent-color: var(--good); }
.qbar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 12px; }
.qbar i { display: block; height: 100%; background: var(--good); }
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl-item:first-child { border-top: 0; }
.tl-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex: none; border: 1px solid var(--line); }
.tl-ico .ico { width: 14px; height: 14px; }
.tl-item .w { font-size: 12px; color: var(--ink-3); }
.tl-item .body { white-space: pre-wrap; font-size: 13.5px; }
.kd { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.valsum { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.valsum div { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; }
.valsum span { display: block; font-size: 11.5px; color: var(--ink-2); }
.valsum b { font: 600 15px var(--font-head); font-variant-numeric: tabular-nums; }
.valsum .hl { background: var(--brand-soft); } .valsum .hl b { color: var(--brand-strong); }
.parked-card { background: var(--warn-soft); border-color: transparent; }
.dup { font-size: 12.5px; color: var(--warn); margin-top: 4px; }

/* Modal */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: var(--scrim); }
.modal { position: relative; background: var(--surface); border-radius: 12px; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal .mh { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal .mh h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal .mb { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal .mf { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.note-demo { font-size: 12px; color: var(--ink-3); background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; }

/* Charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 10px; position: relative; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-stack { width: 100%; max-width: 40px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; }
.bar-stack i { display: block; }
.bar-lbl { font-size: 11px; line-height: 13px; height: 13px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; }
.bar-val { font-size: 10.5px; color: var(--ink-2); margin-bottom: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 6px; }
.cap-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--hl); }
.cap-line span { position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--hl); font-weight: 600; background: var(--surface); padding: 0 4px; }
.hbar { display: grid; grid-template-columns: 160px minmax(0, 1fr) 96px; gap: 12px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.hbar .tr { background: var(--surface-2); border-radius: 4px; height: 14px; overflow: hidden; display: flex; }
.hbar .tr i { display: block; height: 100%; }
.hbar > :last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Gantt */
.gantt { position: relative; min-width: 900px; }
.g-head { display: grid; border-bottom: 1px solid var(--line); }
.g-head div { font-size: 11.5px; color: var(--ink-3); padding: 6px 4px; border-left: 1px solid var(--line); font-weight: 600; }
.g-group { font: 600 11.5px var(--font-body); padding: 14px 0 4px; color: var(--brand-strong); text-transform: uppercase; letter-spacing: .08em; }
.g-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: center; min-height: 32px; border-bottom: 1px solid var(--line); }
.g-row .lbl { font-size: 13px; padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.g-row .lbl small { color: var(--ink-3); }
.g-track { position: relative; height: 32px; }
.g-bar { position: absolute; top: 8px; height: 16px; border-radius: 4px; font-size: 11px; color: #fff; padding: 0 6px; line-height: 16px; white-space: nowrap; overflow: hidden; cursor: pointer; }
.g-out { position: absolute; top: 8px; font-size: 11px; line-height: 16px; color: var(--ink-2); white-space: nowrap; pointer-events: none; }
.g-mark { position: absolute; top: 10px; width: 11px; height: 11px; transform: rotate(45deg); background: var(--ink); margin-left: -5px; }
.g-key { position: absolute; top: 5px; width: 2px; height: 22px; background: var(--hl); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--hl); z-index: 0; pointer-events: none; }
.g-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); pointer-events: none; }

.list-item { padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.list-item:hover { background: var(--surface-2); }
.list-item.on { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.chips-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-edit .chip { font-size: 13px; padding: 3px 4px 3px 10px; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 11px; padding: 0 4px; opacity: .7; display: inline-flex; }
.chip-x .ico { width: 12px; height: 12px; }
.chip-x:hover { opacity: 1; }
.tip { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-3); font-size: 10.5px; align-items: center; justify-content: center; cursor: help; font-weight: 700; flex: none; }
.tip:hover { color: var(--brand-strong); border-color: var(--brand); }
.tipbox { position: fixed; z-index: 100; max-width: min(320px, calc(100vw - 16px)); background: var(--ink); color: var(--surface); padding: 8px 11px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.45; pointer-events: none; box-shadow: var(--shadow-lg); }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: var(--r-sm); z-index: 80; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .side { position: fixed; left: 0; z-index: 70; transform: translateX(-100%); transition: transform .2s; padding-top: env(safe-area-inset-top, 0px); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .search { width: 180px; }
  .two, .split { grid-template-columns: minmax(0, 1fr); }
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); top: env(safe-area-inset-top, 0px); }
  .view { padding: 8px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; row-gap: 10px; }
  .top h1 { font-size: 19px; }
  .top-right { width: 100%; margin-left: 0; }
  .search-wrap { flex: 1; min-width: 0; }
  .search { width: 100%; }
  .search-results { width: 100%; }
  .user-sel { max-width: 120px; }
  #newBtn .lbl { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0 !important; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .kpi .v { font-size: 21px; }
  .grid2, .grid3, .qual { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .valsum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .valsum .hl { grid-column: span 2; }
  .board { grid-auto-columns: 82vw; }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) 76px; }
  .bars { gap: 3px; }
  .bar-val { font-size: 9px; }
  .bar-lbl { font-size: 9.5px; overflow: hidden; max-width: 100%; }
  .funnel { grid-template-columns: minmax(0, 1fr) 64px; gap: 4px 8px; }
  .fn-seg { padding: 0 14%; }
  .fn-seg b { font-size: 13px; }
  .fn-seg span { font-size: 11px; }
  .dr-head, .dr-body { padding-left: 16px; padding-right: 16px; }
  .step { font-size: 11px; padding: 8px 2px; }
  .toolbar select, .toolbar input[type=text], .toolbar input[type=date] { min-width: 0; flex: 1 1 140px; }
  .card { padding: 16px; }
}
