/* WAM: Windows Plus brand (navy #22232B / #383B47, pink #CF219F, Poppins) */
:root {
  color-scheme: light;
  --navy: #22232B; --navy-2: #383B47; --pink: #CF219F; --pink-hover: #E039B2; --pink-wash: #fbe9f5;
  --bg: #f4f4f2; --surface: #ffffff; --surface-2: #f7f7f5; --ink: #1d1e24; --ink-2: #52535c; --muted: #85868d;
  --line: #e3e2dc; --grid: #ecebe6; --axis: #c3c2b7;
  --good: #0ca30c; --good-ink: #006300; --good-wash: #e3f4e3;
  --warn: #fab219; --warn-ink: #8a5a00; --warn-wash: #fff3d6;
  --crit: #d03b3b; --crit-ink: #b42828; --crit-wash: #fbe5e5;
  --series: #2a78d6;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 2px 8px rgba(20, 20, 30, .04);
  --r: 10px;
}
/* Always light: white pages, even when the computer is set to dark mode (Ben, 11/12/2026). */

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: #ffffff; color: var(--ink); font: 400 15px/1.5 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 26px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
a { color: inherit; }
code { font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px Poppins, sans-serif; padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn.primary:hover { background: var(--pink-hover); border-color: var(--pink-hover); }
.btn.danger { color: var(--crit-ink); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.link-btn:hover { color: var(--pink); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link { color: var(--pink); text-decoration: none; font-weight: 500; font-size: 14px; }
input, select, textarea { font: 400 14px Poppins, sans-serif; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--pink); outline-offset: 1px; }
input:disabled, textarea:disabled, select:disabled { background: var(--surface-2); color: var(--ink-2); }
textarea { width: 100%; resize: vertical; min-height: 64px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- shell ---------- */
.preview-bar { background: var(--warn-wash); color: var(--warn-ink); font-size: 13px; padding: 6px 16px; text-align: center; }
.top { background: #ffffff; color: var(--navy); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 30px; }
.wam { font-weight: 700; letter-spacing: .08em; font-size: 13px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--navy); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px; padding: 18px 10px 16px; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--navy); }
.nav a.on { color: var(--navy); border-bottom-color: var(--pink); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who .link-btn { color: var(--ink-2); } .who .link-btn:hover { color: var(--pink); }
.role { padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; }
.role.edit { background: var(--pink); color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-2); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; }

/* ---------- page parts ---------- */
.page-head, .hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sub { color: var(--ink-2); margin: 4px 0 0; }
.eyebrow { margin: 0 0 4px; color: var(--pink); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-sub { color: var(--ink-2); font-size: 13px; margin: 4px 0 14px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 12px; }
.mini { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }
.note { background: var(--pink-wash); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }
.foot-note { color: var(--muted); font-size: 12px; }
.setup-note { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.setup-scroll { overflow-x: auto; }
.kpi-setup input[data-f="owner"] { width: 120px; }
.kpi-setup td { white-space: nowrap; }
.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.cols.tight { gap: 24px; grid-template-columns: 1fr 1fr; }
.cols > .card { margin-bottom: 20px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--pink); }
.tile-k { font-size: 13px; color: var(--ink-2); }
.tile-v { font-size: 30px; font-weight: 600; line-height: 1.2; margin: 4px 0; }
.tile-v small { font-size: 15px; color: var(--muted); font-weight: 500; }
.tile-s { font-size: 12px; color: var(--muted); }
.bad-ink { color: var(--crit-ink); }

/* status pills & tags: always icon + words, never color alone */
.pill, .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill.good, .tag.good { background: var(--good-wash); color: var(--good-ink); }
.pill.bad, .pill.crit, .tag.crit { background: var(--crit-wash); color: var(--crit-ink); }
.pill.warn, .tag.warn { background: var(--warn-wash); color: var(--warn-ink); }
.pill.done { background: var(--surface-2); color: var(--ink-2); }
.owner { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.delta { font-weight: 600; font-size: 13px; }
.delta.good { color: var(--good-ink); } .delta.bad { color: var(--crit-ink); }

/* flags */
.flags { list-style: none; margin: 0; padding: 0; }
.flag { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-bottom: 1px solid var(--grid); cursor: pointer; font-size: 14px; border-radius: 6px; }
.flag:hover { background: var(--surface-2); }
.flag:last-child { border-bottom: 0; }
.flag-i { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; margin-top: 1px; }
.flag.crit .flag-i { background: var(--crit); } .flag.warn .flag-i { background: var(--warn); color: #0b0b0b; } .flag.good .flag-i { background: var(--good); }

.list { list-style: none; margin: 0; padding: 0; }
.row-line { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.row-line > span:first-child, .row-line > span:nth-child(2):not(.owner) { flex: 1; }
.row-line:last-child { border-bottom: 0; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; color: inherit; box-shadow: var(--shadow); }
.kpi:hover { border-color: var(--pink); }
.kpi-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.kpi-n { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.kpi-v { font-size: 24px; font-weight: 600; }
.kpi-d { font-size: 12px; }
.kpi-f { display: flex; justify-content: space-between; align-items: flex-end; font-size: 12px; margin-top: 4px; }
.spark path { fill: none; stroke: var(--series); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--series); }

/* segmented control */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; font: 500 13px Poppins, sans-serif; color: var(--ink-2); padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }
.seg button small { opacity: .7; margin-left: 2px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { min-width: 220px; }

/* ---------- scorecard ---------- */
.sc-scroll { overflow-x: auto; }
.sc { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.sc th, .sc td { padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; background: var(--surface); }
.sc thead th { font-weight: 500; color: var(--muted); font-size: 12px; text-align: right; line-height: 1.25; position: sticky; top: 0; }
.sc thead th span { color: var(--muted); opacity: .75; }
.sc thead th.stick { text-align: left; }
.sc tbody th { text-align: left; font-weight: 500; }
.sc .stick { position: sticky; z-index: 2; }
.sc .s1 { left: 0; min-width: 190px; } .sc .s2 { left: 190px; min-width: 90px; } .sc .s3 { left: 280px; min-width: 80px; } .sc .s4 { left: 360px; min-width: 100px; border-right: 1px solid var(--line); }
.sc td.num { text-align: right; font-variant-numeric: tabular-nums; min-width: 66px; }
.sc td.ok { background: var(--good-wash); color: var(--good-ink); }
.sc td.miss { background: var(--crit-wash); color: var(--crit-ink); font-weight: 600; }
.sc .cur { box-shadow: inset 2px 0 0 var(--pink); }
.sc tbody tr:hover td, .sc tbody tr:hover th { background: var(--surface-2); }
.kpi-link { font-weight: 500; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.small td, .tbl.small th { padding: 6px 10px; }
.wrap-cell { white-space: normal; max-width: 420px; }
.num-in { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.num-in.saved { border-color: var(--good); box-shadow: 0 0 0 2px var(--good-wash); }
.by { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.todos input[type=checkbox]:disabled { opacity: .35; cursor: not-allowed; }
.entry td { padding: 6px 10px; }
.status-sel { font-size: 13px; padding: 4px 8px; }
.status-sel.s-on { color: var(--good-ink); } .status-sel.s-off { color: var(--crit-ink); } .status-sel.s-hold { color: var(--warn-ink); }

/* ---------- meeting ---------- */
.meet { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.agenda { list-style: none; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); position: sticky; top: 80px; }
.agenda button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 9px 10px; border-radius: 8px; cursor: pointer; font: 500 14px Poppins, sans-serif; color: var(--ink-2); text-align: left; }
.agenda button:hover { background: var(--surface-2); }
.agenda button.on { background: var(--pink-wash); color: var(--ink); }
.ag-n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; flex: none; }
.agenda button.on .ag-n { background: var(--pink); color: #fff; }
.ag-t { flex: 1; } .ag-m { font-size: 12px; color: var(--muted); }
.step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.step-nav { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--grid); }
.clock { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px 4px 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.notes { min-height: 140px; }
.notes.sm { min-height: 60px; }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.inline-add input[name=text], .inline-add input[name=title] { flex: 1; min-width: 220px; }
.plan { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.plan-h { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.plan-h .owner { margin-left: auto; }
.rate { display: flex; align-items: flex-end; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.rate input { width: 90px; }
.ratings { display: flex; gap: 8px; flex-wrap: wrap; }
.ratings span { display: flex; flex-direction: column; align-items: center; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.ratings small { color: var(--muted); font-size: 11px; }

/* IDS */
.ids-list { list-style: none; margin: 0; padding: 0; }
.ids-list li { border-bottom: 1px solid var(--grid); }
.ids-list.page li:last-child { border-bottom: 0; }
.ids-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 11px 14px; background: none; border: 0; font: 400 14px Poppins, sans-serif; color: var(--ink); text-align: left; cursor: pointer; }
.ids-row > span:first-child { flex: 1; }
.ids-row:hover { background: var(--surface-2); }
.ids-list li.open > .ids-row { background: var(--pink-wash); font-weight: 500; }
.ids-ed { padding: 12px 14px 16px; display: grid; gap: 10px; background: var(--surface-2); }
.ids-ed textarea { min-height: 56px; }
.prior { margin: 0; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }

/* to-dos */
.todos { list-style: none; margin: 0; padding: 0; }
.todos li { display: grid; grid-template-columns: 22px 1fr 130px 70px 96px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--grid); font-size: 14px; }
.todos li:last-child { border-bottom: 0; }
.todos input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--pink); }
.td-main { display: flex; flex-direction: column; min-width: 0; }
.td-n { font-size: 12px; color: var(--muted); }
.td-due { font-size: 13px; color: var(--ink-2); }
.todos li.done .td-t { text-decoration: line-through; color: var(--muted); }
.todos .tag { justify-self: start; }

/* KPI detail */
.kd-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.kd-v { font-size: 34px; font-weight: 600; line-height: 1.1; }
.kd-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.stats div { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; }
.stats span { font-size: 12px; color: var(--muted); } .stats strong { font-size: 16px; }

/* chart */
.chart { min-height: 280px; }
.chart-wrap { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .goal { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .goal-lbl { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.chart .dot.miss { fill: var(--crit); }
.chart .xhair { stroke: var(--axis); stroke-width: 1; visibility: hidden; }
.chart .hl { fill: none; stroke: var(--series); stroke-width: 2; visibility: hidden; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 140px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.tip-v { font-size: 16px; font-weight: 600; }
.tip-w { color: #c9cad3; }
.tip-s.good { color: #7fe07f; } .tip-s.bad { color: #ff9b9b; }

/* modal & toast */
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
#modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(15, 15, 22, .5); }
.modal { position: relative; background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.modal-body > label { margin-bottom: 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.modal-foot .danger { margin-right: auto; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: opacity .3s; }
.toast.bad { background: var(--crit); }
.toast.out { opacity: 0; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: #ffffff; }
.login-card { background: #ffffff; border: 1px solid var(--line); border-radius: 16px; padding: 36px 32px; width: min(440px, 100%); text-align: center; box-shadow: 0 8px 30px rgba(20,20,30,.08); }
.login-logo { height: 46px; margin-bottom: 18px; }
.login-card h1 { font-size: 34px; letter-spacing: .06em; }
.login-card .sub { margin-bottom: 24px; }
.gsi { display: flex; justify-content: center; min-height: 44px; }
.fine { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.preview-login { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.preview-login p { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.preview-login .btn { justify-content: center; }
.err { color: var(--crit-ink); background: var(--crit-wash); padding: 8px 12px; border-radius: 8px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cols, .cols.tight { grid-template-columns: 1fr; }
  .meet { grid-template-columns: 1fr; }
  .agenda { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .agenda button { white-space: nowrap; }
  .ag-m { display: none; }
  .who .role { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .top-in { flex-wrap: wrap; gap: 8px 16px; padding-top: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a { padding: 10px 8px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile-v { font-size: 24px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .todos li { grid-template-columns: 22px 1fr; }
  .todos li > .owner, .todos li > .td-due, .todos li > .tag, .todos li > span:last-child { grid-column: 2; }
  .sc .s2, .sc .s3 { display: none; }
  .sc .s4 { left: 190px; }
  .tbl.entry th:nth-child(2), .tbl.entry td:nth-child(2), .tbl.entry th:nth-child(4), .tbl.entry td:nth-child(4) { display: none; }
  .card { padding: 16px; }
}
