/* RNR Desk — styles. Brainmine green and white. */
:root {
  color-scheme: light;
  --brand: #0E8A4B;
  --brand-deep: #0B4A2B;
  --brand-ink: #08391F;
  --brand-soft: #E5F2EA;
  --brand-wash: #F1F7F3;
  --paper: #FFFFFF;
  --ink: #14261C;
  --ink-2: #3F5247;
  --muted: #687A70;
  --line: #DCE6E0;
  --line-2: #C7D5CD;
  --rag-r: #D64545;
  --rag-a: #E0A100;
  --rag-g: #1F9D55;
  --txt-r: #B4302F;
  --txt-a: #9A6A00;
  --txt-g: #157A41;
  --blue: #2D6AA8;
  --radius: 10px;
  --radius-sm: 6px;
  --side: 232px;
  --f-head: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --f-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--f-body); color: var(--ink); background: var(--brand-wash); }
body.modal-open { overflow: hidden; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 700; margin: 0; letter-spacing: -0.01em; line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); }
.small, small { font-size: 12.5px; }
.txt-r { color: var(--txt-r) !important; }
.txt-a { color: var(--txt-a) !important; }
.txt-g { color: var(--txt-g) !important; }
.grow { flex: 1; }
.link { color: var(--brand); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- sidebar ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--brand-deep); color: #fff; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark.big { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 8px; }
.brand-mark.big svg { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-family: var(--f-head); font-size: 18px; letter-spacing: -0.02em; }
.brand-text small { color: #A9CDB8; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #D7E9DE; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav a.on { background: #fff; color: var(--brand-ink); font-weight: 600; }
.nav a.on .ico { stroke: var(--brand); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.badge { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 10px; background: rgba(255,255,255,0.18); color: #fff; }
.badge-r { background: var(--rag-r); }
.nav a.on .badge { background: var(--brand-soft); color: var(--brand-ink); }
.nav a.on .badge-r { background: var(--rag-r); color: #fff; }
.side-foot { padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,0.12); }
.me-label { display: block; font-size: 12px; color: #A9CDB8; margin-bottom: 4px; }
.me-select { width: 100%; background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 7px; padding: 7px 8px; }
.me-select option { color: var(--ink); }
.sync { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; color: #C6DDCF; cursor: default; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-ok { background: #5FD38D; }
.dot-wait { background: #C6DDCF; }
.dot-warn { background: var(--rag-a); }
.dot-local { background: #fff; box-shadow: inset 0 0 0 2px var(--rag-a); }

/* ---------- main ---------- */
.main-wrap { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: rgba(241,247,243,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.week-switch { display: flex; align-items: center; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.week-label { border: 0; background: none; padding: 5px 10px; font-weight: 600; cursor: pointer; border-radius: 6px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.week-label:hover { background: var(--brand-wash); }
.now-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.icon-btn { border: 0; background: none; width: 32px; height: 32px; border-radius: 7px; cursor: pointer; font-size: 17px; line-height: 1; color: var(--ink-2); display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--brand-wash); color: var(--ink); }
.icon-btn.sm { width: 24px; height: 24px; font-size: 12px; }
.view { padding: 18px 24px 40px; outline: none; }
.page { display: flex; flex-direction: column; gap: 16px; max-width: 1480px; }

/* ---------- panels & grids ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel > h3 { margin-bottom: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head .count { font-family: var(--f-body); font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand-ink); padding: 1px 7px; border-radius: 9px; margin-left: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2.wide-left { grid-template-columns: 1.5fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 12px; }
.sub-h { font-size: 14px; margin: 16px 0 8px; }
.sum-line { color: var(--ink-2); margin: 0; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; min-width: 0; }
a.tile:hover { border-color: var(--brand); }
.tile-wide { grid-column: span 2; }
@media (min-width: 1280px) { .tiles.dash { grid-template-columns: 1.7fr repeat(7, 1fr); } .tiles.dash .tile-wide { grid-column: auto; } }
.tile-label { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tile-num { font-family: var(--f-head); font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile-num small { font-size: 16px; color: var(--muted); font-weight: 500; }
.tile-foot { font-size: 12.5px; color: var(--muted); }
.tile-r { border-left: 4px solid var(--rag-r); }
.tile-a { border-left: 4px solid var(--rag-a); }
.tile-g { border-left: 4px solid var(--rag-g); }
.meter { display: block; height: 6px; background: var(--brand-soft); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s; }
.meter > span.near { background: var(--rag-a); }
.meter > span.over { background: var(--rag-r); }
.delta { font-size: 12px; color: var(--muted); }
.delta.up { color: var(--txt-g); }
.delta.down { color: var(--txt-r); }

/* ---------- RAG chips ---------- */
.rag { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; flex: none; font-variant-numeric: tabular-nums; }
.rag-r { background: var(--rag-r); }
.rag-a { background: var(--rag-a); color: #1C1600; }
.rag-g { background: var(--rag-g); }
.rag-none { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.rag-big { min-width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.rag-label { font-weight: 600; font-size: 13px; }
.mini-rag { display: inline-flex; gap: 3px; }

/* ---------- needs attention ---------- */
.attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.attn li { padding: 10px 0; border-top: 1px solid var(--line); }
.attn li:first-child { border-top: 0; padding-top: 0; }
.attn-name { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.attn-name:hover b { text-decoration: underline; }
.attn-meta { display: block; font-size: 12.5px; color: var(--muted); margin: 2px 0 4px 30px; }
.attn-risk, .attn-ask { margin: 2px 0 0 30px; color: var(--ink-2); }
.attn-ask b { color: var(--brand-ink); }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .tick { font-size: 10.5px; fill: var(--muted); font-family: var(--f-body); }
.chart .hit:hover { fill: rgba(14,138,75,0.06); }
.legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.table-view summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
#tip { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.4; padding: 7px 10px; border-radius: 7px; max-width: 280px; opacity: 0; transition: opacity .1s; }
#tip.on { opacity: 1; }
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar-track { height: 14px; background: var(--brand-wash); border-radius: 4px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.hbar-fill.warn { background: var(--rag-a); }
.hbar-fill.bad { background: var(--rag-r); }
.hbar-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 56px; text-align: right; }
.spark { width: 96px; height: 26px; display: block; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-target { stroke: var(--line-2); stroke-dasharray: 3 3; }
.spark-ok { fill: var(--rag-g); stroke: #fff; stroke-width: 1.5; }
.spark-bad { fill: var(--rag-r); stroke: #fff; stroke-width: 1.5; }

/* ---------- heatmap ---------- */
.heat { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: minmax(160px, 240px) repeat(var(--cols), minmax(34px, 1fr)); gap: 3px; align-items: center; text-decoration: none; color: inherit; border-radius: 6px; }
a.heat-row:hover { background: var(--brand-wash); }
.heat-headrow { font-size: 11.5px; color: var(--muted); text-align: center; }
.heat-wk.cur { color: var(--brand-ink); font-weight: 700; }
.heat-name { display: flex; flex-direction: column; line-height: 1.2; padding: 3px 6px; min-width: 0; }
.heat-name b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-name small { color: var(--muted); font-size: 11.5px; }
.heat-cell { height: 28px; border-radius: 5px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,0.92); }
.h-R { background: var(--rag-r); }
.h-A { background: var(--rag-a); color: #2A2000; }
.h-G { background: var(--rag-g); }
.h-none { background: repeating-linear-gradient(135deg, var(--brand-wash) 0 4px, #E4EBE6 4px 6px); }
.strip { display: inline-flex; gap: 2px; }
.strip i { width: 9px; height: 18px; border-radius: 2px; }
.hist { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px; margin-bottom: 14px; }
.hist-col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hist-col .heat-cell { width: 100%; }
.hist-col small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.panel:not(.flush) .tbl th:first-child, .panel:not(.flush) .tbl td:first-child { padding-left: 0; }
.panel:not(.flush) .tbl th:last-child, .panel:not(.flush) .tbl td:last-child { padding-right: 0; }
.tbl-compact td { padding: 6px 10px; }
.tbl-compact th { padding: 6px 10px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-click tbody tr { cursor: pointer; }
.tbl-click tbody tr:hover td { background: var(--brand-wash); }
.tbl-foot { padding: 10px 14px; margin: 0; border-top: 1px solid var(--line); }
.panel:not(.flush) .tbl-foot { padding: 10px 0 0; border: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: #EDF2EF; color: var(--ink-2); white-space: nowrap; }
.chip-r { background: #FBE7E6; color: var(--txt-r); }
.chip-g { background: var(--brand-soft); color: var(--txt-g); }
.chip-b { background: #E6EFF8; color: var(--blue); }
.inline-sel { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--paper); }

/* ---------- tasks ---------- */
.tasks { list-style: none; margin: 0 0 6px; padding: 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task-check { width: 17px; height: 17px; accent-color: var(--brand); flex: none; cursor: pointer; }
.task-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; }
.task-main:hover .task-title { text-decoration: underline; }
.task-title { font-weight: 500; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); align-items: center; }
.task-due { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-due.late { color: var(--txt-r); font-weight: 600; }
.prio { font-size: 11px; font-weight: 700; color: var(--txt-r); border: 1px solid #F0C4C3; border-radius: 4px; padding: 0 5px; }
.group-h { font-family: var(--f-body); font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 14px 0 4px; display: flex; gap: 6px; align-items: center; }
.group-h:first-child { margin-top: 0; }
.group-h span { font-weight: 600; color: var(--muted); }
.group-h.late { color: var(--txt-r); }
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.col { background: #E9F0EC; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col.over { box-shadow: inset 0 0 0 2px var(--brand); }
.col h3 { font-size: 14px; margin: 2px 4px 10px; display: flex; gap: 6px; align-items: baseline; }
.col h3 span { color: var(--muted); font-family: var(--f-body); font-weight: 600; font-size: 12.5px; }
.col-body { display: flex; flex-direction: column; gap: 8px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; cursor: grab; display: flex; flex-direction: column; gap: 3px; }
.card:hover { border-color: var(--brand); }
.card.overdue { border-left: 3px solid var(--rag-r); }
.card.dragging { opacity: .5; }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.col-empty { text-align: center; padding: 18px 0; margin: 0; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.3; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0B7840; }
.btn-ghost { background: var(--paper); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-danger-ghost { background: none; border-color: #EBC0BF; color: var(--txt-r); }
.btn-danger-ghost:hover { background: #FBE7E6; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 6px; }
.row-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-btns.wrap { margin-bottom: 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input[type=search], .toolbar select, .field input, .field select, .field textarea, .add-line input, #notes, .run-side textarea {
  border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; background: var(--paper); min-width: 0; width: 100%;
}
.toolbar input[type=search] { width: 240px; }
.toolbar select { width: auto; }
textarea { resize: vertical; }
input.invalid, select.invalid { border-color: var(--rag-r) !important; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; border: 0; padding: 0; }
.field > span, .field > legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0; }
.field > legend { margin-bottom: 6px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > span { white-space: nowrap; }
.field.inline select { width: auto; }
.span2 { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.kpi-row { display: grid; grid-template-columns: 1.6fr 0.8fr 0.5fr 1.1fr auto; gap: 6px; margin-bottom: 6px; }
.kpi-row input, .kpi-row select { border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px; min-width: 0; width: 100%; background: var(--paper); }
.file-btn { cursor: pointer; }

/* segmented radio */
.seg { display: inline-flex; background: #EAF0EC; border-radius: 9px; padding: 3px; gap: 3px; }
.seg label { cursor: pointer; position: relative; }
.field > .seg { align-self: flex-start; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 18px; border-radius: 7px; font-weight: 600; color: var(--ink-2); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.seg input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(20,38,28,0.15); }
.seg-G input:checked + span { background: var(--rag-g); color: #fff; }
.seg-A input:checked + span { background: var(--rag-a); color: #1C1600; }
.seg-R input:checked + span { background: var(--rag-r); color: #fff; }
.seg-sm span { padding: 4px 12px; font-size: 13px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(12,30,20,0.42); z-index: 60; display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--paper); border-radius: 14px; box-shadow: 0 20px 60px rgba(8,30,18,0.3); }
.modal-wide { max-width: 780px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; }
.modal-head h2 { font-size: 19px; }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 6px 20px 16px; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--brand-wash); border-radius: 0 0 14px 14px; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 9px; font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,0.18); transition: opacity .3s, transform .3s; }
.toast-warn { background: #7A4E00; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- empty & welcome ---------- */
.empty { padding: 18px 4px; color: var(--ink-2); }
.empty-title { font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.empty .btn { margin-top: 6px; }
.welcome { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; border-top: 5px solid var(--brand); max-width: 760px; }
.welcome h2 { font-size: 26px; margin-bottom: 14px; }
.steps { margin: 0 0 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.steps b { color: var(--ink); }

/* ---------- missing ---------- */
.missing-group { padding: 8px 0; border-top: 1px solid var(--line); }
.missing-group:first-of-type { border-top: 0; padding-top: 0; }
.missing-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 2px; }

/* ---------- weekly update ---------- */
.upd-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.upd-who { display: flex; flex-direction: column; gap: 6px; }
.upd-who p { margin: 0; }
.upd-progress { display: flex; flex-direction: column; min-width: 180px; }
.upd-list { display: flex; flex-direction: column; gap: 8px; }
.upd-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.upd-card.open { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.upd-card-head { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 12px 16px; cursor: pointer; text-align: left; }
.upd-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.upd-name small { color: var(--muted); }
.upd-status { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.upd-status.ok { color: var(--txt-g); }
.upd-status.todo { color: var(--txt-a); }
.chev { font-size: 20px; color: var(--muted); width: 18px; text-align: center; }
.upd-form { padding: 4px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.upd-form > :first-child { margin-top: 12px; }
.upd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.upd-grid.four { grid-template-columns: repeat(4, 1fr); }
.upd-grid small { display: block; margin-top: 4px; }
.kpi-tbl input { width: 110px; border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; text-align: right; }
.kpi-tbl td { padding: 5px 10px; }
.upd-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.help { margin: 0; }

/* ---------- account detail ---------- */
.crumb { margin: 0; font-size: 13px; color: var(--muted); }
.acct-head { display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: start; }
.acct-head > .row-btns { grid-column: 1 / -1; }
.acct-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.acct-title h2 { font-size: 22px; }
.facts { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 22px; margin: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.kv dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }
.kv.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain.bullets { list-style: disc; padding-left: 20px; }
.opp-li { display: flex; flex-direction: column; padding: 7px 0; border-top: 1px solid var(--line); cursor: pointer; }
.opp-li:first-child { border-top: 0; }
.opp-li:hover b { text-decoration: underline; }

/* ---------- revenue ---------- */
.pipe { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; }
.pipe-col { background: var(--brand-wash); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pipe-col h3 { font-size: 13.5px; display: flex; justify-content: space-between; margin: 2px 2px 4px; }
.pipe-col h3 span { font-family: var(--f-body); color: var(--muted); font-size: 12.5px; }
.pipe-card { border: 1px solid var(--line); background: var(--paper); border-radius: 7px; padding: 8px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.pipe-card:hover { border-color: var(--brand); }
.pipe-val { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- meeting ---------- */
.prep { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.prep h2 { font-size: 21px; margin-bottom: 4px; }
.ready { list-style: none; padding: 0; margin: 14px 0 16px; display: flex; flex-direction: column; gap: 6px; }
.ready li { padding: 8px 12px 8px 34px; border-radius: 8px; position: relative; background: var(--brand-wash); }
.ready li::before { position: absolute; left: 12px; top: 8px; font-weight: 700; }
.ready li.ok::before { content: '✓'; color: var(--txt-g); }
.ready li.warn { background: #FDF5E1; }
.ready li.warn::before { content: '!'; color: var(--txt-a); }
.agenda-preview { border-left: 1px solid var(--line); padding-left: 24px; }
.agenda-preview ol { padding-left: 18px; margin: 10px 0; }
.agenda-preview li { padding: 4px 0; }
.agenda-preview li span:first-child { display: inline-block; min-width: 70%; }
.run-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; }
.run-top > div:first-child { flex: 1; min-width: 200px; }
.run-clock { display: flex; flex-direction: column; align-items: flex-end; }
.run-clock b { font-family: var(--f-head); font-size: 24px; font-variant-numeric: tabular-nums; }
.attend { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pill { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 14px; border: 1px solid var(--line-2); cursor: pointer; color: var(--muted); }
.pill.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.pill input { display: none; }
.run { display: grid; grid-template-columns: 230px minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.run-agenda { position: sticky; top: 74px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.run-agenda ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.run-agenda li { counter-increment: s; }
.run-agenda li button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 8px 8px 30px; border-radius: 7px; cursor: pointer; display: flex; flex-direction: column; position: relative; }
.run-agenda li button::before { content: counter(s); position: absolute; left: 8px; top: 9px; width: 16px; height: 16px; border-radius: 50%; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; background: #EAF0EC; color: var(--ink-2); }
.run-agenda li button small { color: var(--muted); font-variant-numeric: tabular-nums; }
.run-agenda li button:hover { background: var(--brand-wash); }
.run-agenda li.cur button { background: var(--brand-soft); font-weight: 600; }
.run-agenda li.cur button::before { background: var(--brand); color: #fff; }
.run-agenda li.past button::before { content: '✓'; background: var(--rag-g); color: #fff; }
.run-agenda li.past button > span { color: var(--muted); }
.seg-timer { padding: 8px; border-top: 1px solid var(--line); margin-top: 6px; }
.seg-timer .btn { width: 100%; white-space: normal; text-align: center; }
.run-side { display: flex; flex-direction: column; gap: 10px; }
.run-side .panel { padding: 12px 14px; }
.run-side .panel-head { margin-bottom: 6px; }
.mini-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-list li { display: flex; flex-direction: column; font-size: 13px; }
.mini-list li.li-row { flex-direction: row; justify-content: space-between; gap: 6px; align-items: flex-start; }
.add-line { display: flex; gap: 6px; }
.review { list-style: none; margin: 0; padding: 0; }
.review li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: center; }
.review li:first-child { border-top: 0; }
.review li > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.review li.done b { text-decoration: line-through; color: var(--muted); }
.review li.overdue b { color: var(--txt-r); }
.review-btns { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.scan-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.scan-tiles > div { background: var(--brand-wash); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.scan-tiles .tile-r, .scan-tiles .tile-a, .scan-tiles .tile-g { background: var(--paper); border: 1px solid var(--line); }
.scan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.scan-list li p { margin: 2px 0 0 30px; color: var(--ink-2); }
.deep { border: 1px solid var(--line); border-left: 4px solid var(--rag-r); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.deep header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deep-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.note-warn { background: #FDF5E1; color: #6B4A00; border-radius: 6px; padding: 6px 10px; margin: 0; font-size: 13px; }
.add-deep { margin-top: 6px; }
.showcase-ctx { background: var(--brand-wash); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.minutes h3 { margin: 18px 0 6px; font-size: 16px; }
.min-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.min-head h2 { font-size: 21px; }
.min-deep { padding: 6px 0; }
.min-deep p { margin: 2px 0; }
.min-foot { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- settings ---------- */
.agenda-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.agenda-row { display: grid; grid-template-columns: 16px 1fr 70px auto; gap: 8px; align-items: center; }
.agenda-row input { border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px; min-width: 0; }
.score-tbl td { white-space: nowrap; }
.score-tbl th { white-space: normal; vertical-align: bottom; min-width: 70px; }

/* ---------- lock ---------- */
.lock { min-height: 100vh; display: grid; place-items: center; background: var(--brand-deep); padding: 20px; }
.lock-card { background: var(--paper); border-radius: 16px; padding: 30px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.lock-card h1 { font-size: 26px; }
.lock-card input { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; }
.lock-card .btn { width: 100%; padding: 10px; }
.lock-err { color: var(--txt-r); font-size: 13px; }
.scrim { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .run { grid-template-columns: 210px minmax(0, 1fr); }
  .run-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .grid-2, .grid-2.wide-left, .prep { grid-template-columns: 1fr; }
  .agenda-preview { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .grid-3 { grid-template-columns: 1fr; }
  .acct-head { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 25; }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .top { padding: 10px 14px; flex-wrap: wrap; }
  .top h1 { font-size: 19px; }
  .week-switch { order: 3; width: 100%; justify-content: space-between; }
  .view { padding: 14px 14px 40px; }
  .run { grid-template-columns: 1fr; }
  .run-agenda { position: static; }
  .run-side { grid-template-columns: 1fr; }
  .tile-wide { grid-column: span 1; }
  .upd-grid, .upd-grid.four, .deep-inputs, .kv.two, .modal-body, .form-grid { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: repeat(2, auto); }
  .scan-tiles { grid-template-columns: repeat(2, 1fr); }
  .toolbar input[type=search] { width: 100%; }
}
@media (max-width: 560px) {
  .upd-grid, .upd-grid.four, .deep-inputs, .kv.two, .modal-body, .form-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .upd-card-head { flex-wrap: wrap; }
  .upd-status { order: 4; width: 100%; padding-left: 34px; }
  .review li { flex-direction: column; align-items: flex-start; }
  .hbar { grid-template-columns: 90px 1fr auto; }
}

/* ---------- print (minutes) ---------- */
@media print {
  .side, .top, .no-print, #toasts, .crumb { display: none !important; }
  .main-wrap { margin: 0; }
  .view { padding: 0; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
  .task-check { display: none; }
}

/* dashboard renewals mini list */
.ren-mini { list-style: none; margin: 0; padding: 0; }
.ren-mini li { display: grid; grid-template-columns: 1fr auto 44px; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ren-mini li:first-child { border-top: 0; }
.ren-mini a { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.ren-mini a b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ren-mini li > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-compact td:not(:first-child) { white-space: nowrap; }
@media (max-width: 860px) {
  .panel .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hist { overflow-x: auto; grid-template-columns: repeat(var(--cols), minmax(34px, 1fr)); }
  .kpi-tbl input { width: 80px; }
}

/* =================== v2: service tasks, client care, team & PIP, pay, notifications =================== */
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { text-decoration: underline; }
.pad { padding: 14px 18px 0; }
.row-btns.pad { padding: 12px 18px 16px; }
.note-info { background: #E6EFF8; color: #1F4E7E; border-radius: 6px; padding: 6px 10px; margin: 0; font-size: 13px; }
.chip-a { background: #FDF1D6; color: var(--txt-a); }
.chip-btn { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; }
.svc-seo { background: #E5F2EA; color: var(--txt-g); }
.svc-gads { background: #E6EFF8; color: var(--blue); }
.svc-meta { background: #EFE9F7; color: #5B3F8C; }

/* sidebar identity + bell */
.who { display: flex; flex-direction: column; margin-bottom: 10px; color: #fff; }
.who-name { font-weight: 700; }
.who small { color: #A9CDB8; }
.who-btns { font-size: 12px; margin-top: 4px; color: #A9CDB8; }
.who .link-btn { color: #D7E9DE; font-size: 12px; font-weight: 500; }
.bell-wrap { position: relative; }
.bell { position: relative; }
.bell em { position: absolute; top: 2px; right: 1px; background: var(--rag-r); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 3px; }
.bell-pop { position: absolute; right: 0; top: 40px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(8,30,18,0.18); z-index: 40; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell-pop ul { list-style: none; margin: 0; padding: 0; }
.bell-pop li a { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; text-decoration: none; border-bottom: 1px solid var(--line); font-size: 13px; }
.bell-pop li a:hover { background: var(--brand-wash); }
.bell-pop li.unread a { border-left: 3px solid var(--brand); }
.bell-pop li.nt-pip a b, .bell-pop li.nt-feedback-low a b { color: var(--txt-r); }
.bell-pop li span { color: var(--ink-2); }
.bell-pop li small { color: var(--muted); font-size: 11.5px; }

/* banners */
.banner { border-radius: var(--radius); padding: 10px 14px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.banner-warn { background: #FDF5E1; border: 1px solid #F1DDA7; color: #5C4200; }
.banner-bad { background: #FBE7E6; border: 1px solid #F0C4C3; color: #6E1E1D; }

/* dashboard strip */
.dash-strip { margin-bottom: 0; }
.strip-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.strip-card:hover { border-color: var(--brand); }
.strip-card h2 { font-size: 15px; margin-bottom: 4px; }

/* service task checklist */
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.item-main:hover .item-title { text-decoration: underline; }
.item-title { font-weight: 500; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }
.item.late .item-title { color: var(--txt-r); }
.item-meta { display: flex; flex-wrap: wrap; gap: 3px 6px; font-size: 12.5px; color: var(--muted); align-items: center; }
.item-est { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.item-due { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; min-width: 74px; text-align: right; }
.item-due.late { color: var(--txt-r); font-weight: 600; }
.item-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; margin: 0 4px; }
.item-dot.ok { background: var(--rag-g); }
.item-dot.late { background: var(--rag-r); }
.days { display: inline-flex; gap: 3px; }
.day { border: 1px solid var(--line-2); background: var(--paper); border-radius: 5px; font-size: 11px; font-weight: 600; width: 26px; height: 24px; padding: 0; cursor: pointer; color: var(--ink-2); }
.day.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.day.today { box-shadow: 0 0 0 2px var(--brand-soft); }
.day:disabled { cursor: not-allowed; opacity: .55; }
.acct-items h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pct-cell { display: inline-block; min-width: 44px; padding: 2px 6px; border-radius: 5px; background: #EDF2EF; font-weight: 600; }
.pct-cell.ok { background: var(--brand-soft); color: var(--txt-g); }
.pct-cell.bad { background: #FBE7E6; color: var(--txt-r); }
.cap { display: inline-block; width: 120px; height: 10px; background: var(--brand-wash); border-radius: 5px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.cap-fill { display: block; height: 100%; background: var(--brand); }
.cap-fill.near { background: var(--rag-a); }
.cap-fill.over { background: var(--rag-r); }
.lib input.hr-in { width: 64px; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; text-align: right; }
.lib-title { display: block; }
.lib td small { display: block; }
.lib tr.removed td { opacity: .5; }
.lib tfoot td { border-top: 1px solid var(--line-2); }
.tier-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 8px; }

/* account modal: plans */
.plans { display: flex; flex-direction: column; gap: 8px; }
.plan { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.plan-box { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 6px; }
.plan-box .field.inline select, .plan-box .field.inline input { width: auto; }
.scope-list { flex-basis: 100%; max-height: 260px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 6px; }
.scope-area { margin-bottom: 6px; }
.scope-area b { display: block; font-size: 12.5px; margin: 4px 0; }
.scope-area .check { display: flex; align-items: flex-start; font-size: 12.5px; margin: 2px 0; }
.scope-area .check input { margin-top: 2px; }

/* history log */
.history summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.history ul { list-style: none; padding: 0; margin: 8px 0 0; max-height: 220px; overflow-y: auto; }
.history li { border-left: 2px solid var(--line-2); padding: 3px 0 6px 10px; font-size: 12.5px; }

/* client care */
.score { display: inline-grid; place-items: center; min-width: 34px; height: 22px; border-radius: 6px; font-weight: 700; font-size: 12px; color: #fff; padding: 0 5px; }
.score.ok { background: var(--rag-g); }
.score.mid { background: var(--rag-a); color: #1C1600; }
.score.bad { background: var(--rag-r); }
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.fb-list li:first-child { border-top: 0; }
.fb-list p { margin: 4px 0 0; color: var(--ink-2); }
.li-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.li-row:first-child { border-top: 0; }

/* PIP */
.mini-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 24px; }
.mini-bars i { width: 6px; border-radius: 2px 2px 0 0; background: var(--rag-g); }
.mini-bars i.bad { background: var(--rag-r); }
.mini-bars i.none { background: var(--line-2); }
.letter { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; max-height: 360px; overflow-y: auto; }

/* pay */
.sc-in { width: 64px; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; text-align: right; }
.sc-in::placeholder { color: #9AABA1; }
.ledger .lg-in { width: 100px; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; text-align: right; }
.ledger select.lg-in { width: auto; text-align: left; }
.ledger input[type=checkbox].lg-in { width: auto; }
.pay-hero { display: flex; flex-direction: column; margin-bottom: 10px; }
.slip { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.slip-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 10px; }
.slip-head b { color: var(--brand-deep); }

/* settings: automation */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 12px; }
.auto-grid fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; margin: 0; min-width: 0; }
.auto-grid legend { font-weight: 700; font-family: var(--f-head); padding: 0 4px; }
.mail-log { margin-top: 12px; }
.mail-log summary { cursor: pointer; font-weight: 600; }
.mail-frame { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.lock-card input:not([type=checkbox]) { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; }

@media (max-width: 860px) {
  .item { flex-wrap: wrap; }
  .item-main { flex-basis: calc(100% - 40px); }
  .days { margin-left: 27px; }
  .bell-pop { position: fixed; right: 12px; top: 56px; }
}
details.acct-items > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.acct-items > summary::-webkit-details-marker { display: none; }
details.acct-items > summary h2::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
details.acct-items[open] > summary h2::before { transform: rotate(90deg); }
details.acct-items[open] > summary { margin-bottom: 8px; }
.acct-sum { display: flex; align-items: center; gap: 10px; }
.meter.mini { width: 90px; margin: 0; }
.bell em[hidden] { display: none; }

/* ---------- template v3 ---------- */
.dash-strip.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .dash-strip.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .dash-strip.four { grid-template-columns: 1fr; } }
.svc-cm { background: #F3ECE1; color: #7A5418; }
.svc-gbp { background: #E8F3F1; color: #1B6B5E; }
.svc-smo { background: #FCE8EF; color: #9B2C55; }
.svc-amc { background: #ECEEF2; color: #3F4B5E; }
.svc-yt { background: #FBE9E7; color: #A3361F; }
.item-title .code { font-weight: 700; color: var(--ink-2); font-size: 11px; margin-right: 2px; letter-spacing: .02em; }
.seat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 800px) { .seat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan-load { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #F5F8F6; }
.load-sum { margin-bottom: 6px; }
.load-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.load-chip { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: #fff; border: 1px solid #DCE6E0; }
.load-chip.unowned { border-color: #E9B4B0; background: #FBE7E6; color: var(--txt-r); }
.load-chip.total { background: var(--brand-soft); border-color: transparent; }
.seat-gap { background: #FBE7E6; }
.reg-tbl td, .reg-tbl th { white-space: nowrap; }
.reg-tbl small { font-size: 10.5px; }
.cap-tbl td { vertical-align: middle; }
.lib3 .hr-in.sm { width: 58px; }
.seg.wrap { flex-wrap: wrap; }
ol.rules { padding-left: 20px; line-height: 1.55; }
ol.rules li { margin: 4px 0; }
.txt-b { color: var(--blue); }
.imp-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
@media (max-width: 700px) { .imp-sum { grid-template-columns: 1fr; } }

/* ---------- v4: audit fixes — one clock, decisions, five lights, hours ---------- */
.nav-group .nav-sub { display: none; flex-direction: column; gap: 1px; margin: 1px 0 4px 26px; border-left: 1px solid rgba(255,255,255,0.14); padding-left: 6px; }
.nav-group.open .nav-sub { display: flex; }
.nav a.nav-head.on-group { color: #fff; font-weight: 600; background: rgba(255,255,255,0.06); }
.nav a.sub { padding: 6px 10px; font-size: 13.5px; }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 12px; padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); width: max-content; max-width: 100%; }
.subnav a { padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.subnav a.on { background: var(--brand); color: #fff; }
.subnav a:not(.on):hover { background: var(--brand-soft); }
.period-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--brand-soft); color: var(--brand-ink); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.decide { border-top: 4px solid var(--brand); }
.decide-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.decide-list.clip li:nth-child(n+9) { display: none; }
.decide-list li a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; text-decoration: none; border: 1px solid var(--line); background: var(--paper); }
.decide-list li a:hover { border-color: var(--line-2); background: var(--brand-wash); }
.decide-list li.sev-3 a { border-left: 4px solid var(--rag-r); }
.decide-list li.sev-2 a { border-left: 4px solid var(--rag-a); }
.decide-list li.sev-1 a { border-left: 4px solid var(--line-2); }
.decide-kind { flex: none; min-width: 108px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.decide .tiles { margin: 0; }
.light { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; font-weight: 700; background: #EEF2EF; color: var(--muted); }
.light.l-R { background: var(--rag-r); color: #fff; }
.light.l-A { background: var(--rag-a); color: #1C1600; }
.light.l-G { background: #DDF1E4; color: var(--txt-g); }
.acct-board td { vertical-align: top; }
.acct-board td:last-child { min-width: 260px; }
.acct-board td:first-child { min-width: 170px; }
.acct-board tr[data-href] { cursor: pointer; }
.acct-board tr[data-href]:hover td { background: var(--brand-wash); }
.nowrap { white-space: nowrap; }
tr.hrs-red td:first-child { box-shadow: inset 4px 0 0 var(--rag-r); }
tr.hrs-amber td:first-child { box-shadow: inset 4px 0 0 var(--rag-a); }
.hrs-cell { display: inline-block; padding: 1px 7px; border-radius: 6px; font-weight: 600; }
.hrs-cell.red { background: #FBE7E6; color: var(--txt-r); }
.hrs-cell.amber { background: #FFF3D6; color: var(--txt-a); }
.hrs-cell.ok { color: var(--txt-g); }
.item-est small { color: var(--muted); font-weight: 400; }
.score-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.score-line > div { display: flex; flex-direction: column; gap: 2px; }
.score-line b { font-family: var(--f-head); font-size: 26px; line-height: 1.1; }
.sys-says { margin-top: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; background: var(--brand-wash); }
.sys-says.bad { background: #FBE7E6; color: var(--txt-r); }
.sys-says.warn { background: #FFF3D6; color: #6B4A00; }
.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 10px; }
.health-grid > div { display: flex; flex-direction: column; gap: 4px; }
.setup-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: 8px; }
.waiver { padding: 8px 10px; background: #FFF3D6; border-radius: 8px; }
#kpi-rows.locked input, #kpi-rows.locked select { background: #F4F6F5; }
.history-panel > summary { cursor: pointer; list-style: none; padding: 2px 0; }
.history-panel[open] > summary { margin-bottom: 12px; }
.month-tbl td, .month-tbl th { white-space: nowrap; }
@media (max-width: 860px) {
  .score-line, .health-grid { grid-template-columns: repeat(2, 1fr); }
  .decide-list li a { flex-direction: column; gap: 2px; }
  .decide-kind { min-width: 0; }
  .subnav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}
@media (min-width: 1280px) { .tiles.dash.nine { grid-template-columns: 1.5fr repeat(8, 1fr); } }
.tiles.six { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
/* locked controls stay clickable so they can say why */
.task-check.locked { opacity: .4; cursor: not-allowed; }
.day[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.item.theirs { background: #FAFBFA; }
.item.theirs .item-title { color: var(--ink-2); }
.owner-me { color: var(--brand); }
.owner-other { color: var(--ink); font-weight: 600; }
