:root {
  color-scheme: light;
  --surface: #fcfcfb; --plane: #f9f9f7; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --ring: rgba(11,11,11,0.10);
  --series: #2a78d6; --series-soft: #cde2fb; --series-2: #d9741a;
  /* Age bands: traffic-light ramp, youngest green to oldest red. Labels carry identity; color is reinforcement. */
  --age-1: #0ca30c; --age-2: #e0a800; --age-3: #e07b1f; --age-4: #d03b3b;
  --good: #0ca30c; --good-text: #006300; --bad: #d03b3b; --warn: #fab219;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #1a1a19; --plane: #0d0d0d; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --ring: rgba(255,255,255,0.10);
    --series: #3987e5; --series-soft: #184f95; --series-2: #d9741a; --good-text: #0ca30c;
    --age-1: #16b016; --age-2: #e6b21a; --age-3: #e8892e; --age-4: #e04848;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--plane); color: var(--ink); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--series); text-decoration: none; } a:hover { text-decoration: underline; }
button { font: inherit; border-radius: 6px; padding: 6px 12px; border: 1px solid var(--ring); background: var(--surface); color: var(--ink); cursor: pointer; }
button.primary { background: var(--series); color: #fff; border-color: transparent; }
button.ghost { background: transparent; }
button:disabled { opacity: .5; cursor: progress; }
select, input { font: inherit; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--ring); background: var(--surface); color: var(--ink); }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); }

.top { display: flex; align-items: center; gap: 20px; padding: 12px 20px; border-bottom: 1px solid var(--grid); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 600; font-size: 16px; } .ver { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.views button { padding: 6px 14px; font-weight: 600; }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.controls label { display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.warnings { margin: 12px 20px 0; padding: 10px 14px; border: 1px solid var(--warn); border-radius: 8px; background: var(--surface); }
.warnings li { margin: 2px 0; }
main { padding: 16px 20px 40px; display: grid; gap: 20px; }
.view { display: grid; gap: 20px; }
.view > section + section { border-top: 1px solid var(--grid); padding-top: 18px; }
main > section.drill { border-top: 1px solid var(--ring); padding-top: 14px; }
.sechead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sechead h2 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.sechead span { font-size: 12px; color: var(--muted); }
footer { padding: 0 20px 20px; font-size: 12px; }

.sechead button.small { margin-left: auto; padding: 3px 10px; font-size: 12px; }
.focusform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; }
.focusform input[name="title"] { flex: 2; min-width: 220px; } .focusform input[name="note"] { flex: 3; min-width: 220px; }
.focusform label { display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.focus { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.focus .empty { padding: 4px 0; }
.doom .sechead h2 { color: var(--bad); }
.honors { display: flex; flex-wrap: wrap; gap: 12px; } .honors[hidden] { display: none; }
.view > section.honors + section { border-top: 0; padding-top: 0; }
.award { display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 12px; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 22%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 50%, var(--ring)); }
.award.wet { background: linear-gradient(90deg, color-mix(in srgb, var(--series) 22%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--series) 50%, var(--ring)); }
.award.wet .role { color: var(--series); }
.award .icon { font-size: 26px; line-height: 1; }
.award .txt { display: grid; gap: 2px; line-height: 1.2; }
.award .line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.award .names { font-size: 16px; font-weight: 800; }
.award .role { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--series-2); }
.award .tally { font-size: 12px; color: var(--muted); }
.off { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.off .empty { grid-column: 1 / -1; padding: 4px 0; }
.offgroup { display: grid; gap: 8px; align-content: start; padding-left: 12px; border-left: 2px solid var(--grid); }
.offgroup h3 { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.offgroup:first-child { border-left-color: var(--series-2); } .offgroup:first-child h3 { color: var(--series-2); }
.offgroup.none h3 { color: var(--muted); } .offgroup .dash { color: var(--axis); font-size: 13px; }
.ocard { position: relative; display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 52px 8px 12px; border: 1px solid var(--ring); border-radius: 10px; background: var(--surface); }
.ocard .who { font-weight: 700; }
.ocard .span { font-size: 13px; color: var(--ink-2); }
.ocard .sub { font-size: 12px; color: var(--muted); }
.ocard.now { border-color: color-mix(in srgb, var(--series-2) 60%, var(--ring)); background: color-mix(in srgb, var(--series-2) 10%, var(--surface)); }
.ocard.now .who::after { content: "out"; margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--series-2); }
.ocard .acts { position: absolute; top: 4px; right: 4px; display: flex; opacity: 0; }
.ocard .acts button { border: 0; background: transparent; color: var(--muted); padding: 2px 6px; font-size: 13px; line-height: 1; }
.ocard:hover .acts { opacity: 1; } .ocard .ed:hover { color: var(--series); } .ocard .rm:hover { color: var(--bad); }
.fcard { position: relative; --accent: var(--series); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--ring)); border-left: 8px solid var(--accent); border-radius: 10px; padding: 14px 16px 14px 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: start; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface) 65%); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.fcard.soon { --accent: var(--warn); } .fcard.over { --accent: var(--bad); }
.fcard .count { grid-row: 1 / span 3; text-align: center; min-width: 72px; color: var(--accent); }
.fcard.soon .count { color: var(--ink); }
.fcard .count .n { font-size: 44px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.fcard .count .u { display: block; font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.fcard .title { font-weight: 700; font-size: 16px; line-height: 1.25; padding-right: 20px; }
.fcard .when { font-size: 12px; color: var(--ink-2); }
.fcard .note { font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; }
.fcard .rm { position: absolute; top: 6px; right: 6px; border: 0; background: transparent; color: var(--muted); padding: 2px 6px; font-size: 14px; line-height: 1; opacity: 0; }
.fcard:hover .rm { opacity: 1; } .fcard .rm:hover { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.tile .name, .card .name { font-weight: 600; color: var(--ink-2); font-size: 13px; }
.tile .value { font-size: 32px; line-height: 1.1; font-weight: 600; }
.tile .split { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tile .split > div:first-child { display: grid; gap: 4px; min-width: 0; }
.people { display: grid; grid-auto-flow: column; grid-template-rows: repeat(6, auto); grid-auto-columns: max-content; column-gap: 12px; row-gap: 1px; font-size: 11px; color: var(--muted); flex-shrink: 0; margin-top: 4px; }
.people .p { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.people .n { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile .meta, .card .meta { display: flex; gap: 12px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.tile svg { width: 100%; height: 36px; display: block; margin-top: 4px; }
.agebar { display: flex; gap: 2px; height: 10px; margin-top: 6px; }
.agebar .seg { border-radius: 3px; cursor: pointer; min-width: 4px; }
.agebar .seg:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.agebar .seg.empty { display: none; }
.agelegend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.agelegend button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.agelegend button:hover .n { text-decoration: underline; }
.agelegend .n { font-weight: 600; color: var(--ink); }
.tile .pair { display: flex; gap: 16px; align-items: baseline; }
.tile .pair .value { display: flex; align-items: baseline; gap: 6px; }
.tile .pair small { font-size: 12px; font-weight: 400; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--series); }
.swatch.s2 { background: var(--series-2); }
.b1 { background: var(--age-1); } .b2 { background: var(--age-2); } .b3 { background: var(--age-3); } .b4 { background: var(--age-4); }
.status { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.status.good { color: var(--good-text); } .status.bad { color: var(--bad); } .status.none { color: var(--muted); font-weight: 400; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; cursor: pointer; border-top: 3px solid var(--axis); }
.card:hover, .card.active { border-color: var(--series); }
.card.over { border-top-color: var(--bad); } .card.ok { border-top-color: var(--good); }
.card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .big { font-size: 28px; font-weight: 600; line-height: 1; }
.card .big small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.card .sub { display: flex; gap: 12px; color: var(--ink-2); font-size: 12px; flex-wrap: wrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--ring); color: var(--ink-2); background: var(--plane); }
.badge.unq { background: var(--bad); color: #fff; border-color: transparent; font-weight: 600; }
.badge.new { background: var(--series); color: #fff; border-color: transparent; }
.badge.risk { border-color: var(--warn); color: var(--ink); background: color-mix(in srgb, var(--warn) 22%, var(--surface)); font-weight: 600; }
.strip { display: flex; align-items: flex-end; gap: 2px; height: 34px; border-bottom: 1px solid var(--axis); padding-bottom: 1px; }
.strip .bar { flex: 1; background: var(--series); border-radius: 3px 3px 0 0; min-height: 0; position: relative; }
.strip .bar.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.strip .bar.zero { background: transparent; border-bottom: 2px solid var(--grid); }
.paretos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bigpareto { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; border-top: 3px solid var(--axis); }
.bigpareto.active { border-top-color: var(--series); }
.bigpareto .phead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; cursor: pointer; }
.bigpareto .phead .name { font-weight: 700; font-size: 16px; } .bigpareto .phead .tot { color: var(--muted); font-size: 13px; }
.bigpareto .phead:hover .name { color: var(--series); }
.bigpareto .prow { display: grid; grid-template-columns: minmax(0, 1.3fr) 2fr 3ch 4ch; gap: 12px; align-items: center; font-size: 15px; padding: 4px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; }
.bigpareto .prow:hover, .bigpareto .prow.on { background: color-mix(in srgb, var(--series) 12%, transparent); }
.bigpareto .prow .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bigpareto .prow .track { height: 22px; background: var(--plane); border-radius: 0 4px 4px 0; }
.bigpareto .prow .bar { display: block; height: 100%; background: var(--series); border-radius: 0 4px 4px 0; }
.bigpareto .prow.unq .bar { background: var(--warn); } .bigpareto .prow.unq .lbl { color: var(--ink-2); font-style: italic; }
.bigpareto .prow .n { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.bigpareto .prow .cum { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.bigpareto .empty { padding: 4px 0; }
@media (max-width: 900px) { .paretos { grid-template-columns: 1fr; } }
.pareto { display: grid; gap: 3px; font-size: 12px; }
.pareto .row { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr auto; gap: 8px; align-items: center; }
.pareto .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pareto .bar { height: 10px; background: var(--series); border-radius: 0 3px 3px 0; }
.pareto .n { color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

.risk { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 4px 14px; overflow-x: auto; }
.risk .empty { padding: 10px 0; }
.risk tbody tr:last-child td { border-bottom: 0; }
.drill { background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 14px 16px; display: grid; gap: 12px; }
.drill .dhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.drill h2 { margin: 0; font-size: 16px; }
.drill .def { color: var(--ink-2); font-size: 13px; margin: 0; }
.tabs { display: flex; gap: 4px; }
.tabs button.on { background: var(--series); color: #fff; border-color: transparent; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.unq td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.group td { background: var(--plane); font-weight: 600; }
td .title { display: block; max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .detail { max-width: 60ch; font-size: 12px; color: var(--ink-2); font-style: italic; white-space: normal; margin-top: 2px; }
.reason { display: flex; gap: 6px; align-items: center; }
.reason select { min-width: 160px; }
.reason input.note { width: 200px; }
.empty { color: var(--muted); padding: 12px 0; }
.pop { position: fixed; z-index: 6; width: 480px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.28); padding: 10px 12px; font-size: 12.5px; display: grid; gap: 6px; }
.pop .pop-head { display: flex; gap: 8px; align-items: baseline; } .pop .ttl { font-weight: 600; }
.pop b { font-weight: 600; color: var(--muted); margin-right: 4px; }
.pop .pop-facts { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--ink-2); }
.pop .pop-desc { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; line-height: 1.45; }
.pop .small { font-size: 11px; }
tr.pv td { background: var(--plane); }
.toast { position: fixed; bottom: 16px; right: 16px; background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 8px; font-size: 13px; z-index: 5; }
@media (max-width: 1100px) { .tiles, .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .tiles, .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Compact, aligned checks beneath Workload; color only signals severity and increases. */
.dq-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; list-style: none; margin: 0; padding: 0; }
.dq-check { display: grid; grid-template-columns: minmax(0, 1fr) 5.5em 6em 4em; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); color: var(--ink); font-size: 14px; font-weight: 400; }
.dq-name { overflow-wrap: anywhere; }
.dq-name a { color: inherit; text-decoration: underline; text-decoration-color: var(--axis); text-underline-offset: 3px; }
.dq-name a:hover, .dq-name a:focus-visible { color: var(--series); text-decoration-color: currentColor; }
.dq-status { font-size: inherit; font-weight: 600; }
.dq-status.crit, .dq-trend.increasing { color: var(--bad); }
.dq-status.warn, .dq-status.high { color: var(--series-2); }
.dq-status.ok { color: var(--good-text); }
.dq-status.unknown { color: var(--ink-2); }
.dq-count, .dq-trend { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dq-trend, .dq-overdue, .dq-note { color: var(--ink-2); }
.dq-trend.increasing { font-weight: 600; }
.dq-note { margin: 8px 0 0; font-size: 14px; }
@media (max-width: 1200px) { .dq-checks { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .dq-check { grid-template-columns: minmax(0, 1fr) 5em 5.5em; gap: 8px; } .dq-name { grid-column: 1 / -1; } .dq-status { grid-column: 1; } }
@media (max-width: 1400px) { .top { flex-wrap: wrap; } .controls { margin-left: 0; } }
