/* Web platform only (the phone app does not load this file): colour system, light and dark themes, and the dashboard.
   Clean light design (owner, 23 Oct 2026): light by default, white cards on a pale grey page, one accent colour (the brand
   teal) for numbers and charts, big numbers with one short line, and the definitions in "i" tips. Colours with a meaning
   are kept only where the meaning matters: complete / good = green, in progress / warning = amber, problem / flagged = rose,
   not started = slate, and they always come with a word or an icon. Fill colours (--c-*) are the same in both themes;
   text colours (--t-*) change so they stay readable (WCAG AA, checked in server/test/design.test.js). */
:root {
  --c-hh: #3B82F6; --c-girl: #8B5CF6; --c-cov-a: #14B8A6; --c-cov-b: #10B981;
  --c-ok: #22C55E; --c-warn: #F59E0B; --c-bad: #F43F5E; --c-none: #64748B;
  --dash-ease: cubic-bezier(.2, .8, .3, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220; --surface: #141C2F; --surface-2: #1A2338; --ink: #E6EBF5; --muted: #A3B0C5;
  --line: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .14); --edge: rgba(255, 255, 255, .34);
  --brand: #2DD4BF; --brand-strong: #14B8A6; --brand-ink: #04211E; --brand-soft: rgba(45, 212, 191, .14);
  --mark: #FBBF24; --mark-soft: rgba(245, 158, 11, .16);
  --ok: #4ADE80; --ok-soft: rgba(34, 197, 94, .16); --info: #93C5FD; --info-soft: rgba(59, 130, 246, .18);
  --warn: #FBBF24; --warn-soft: rgba(245, 158, 11, .16); --error: #FB7185; --error-soft: rgba(244, 63, 94, .16);
  --t-hh: #93C5FD; --t-girl: #C4B5FD; --t-cov: #5EEAD4; --t-ok: #4ADE80; --t-warn: #FBBF24; --t-bad: #FB7185; --t-none: #A3B0C5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F8FAFB; --ink: #111827; --muted: #4B5563;
  --line: rgba(17, 24, 39, .08); --line-strong: rgba(17, 24, 39, .15); --edge: rgba(17, 24, 39, .50);
  --brand: #0F766E; --brand-strong: #115E59; --brand-ink: #FFFFFF; --brand-soft: #CCFBF1;
  --ok: #15803D; --ok-soft: #DCFCE7; --info: #1D4ED8; --info-soft: #DBEAFE; --warn: #B45309; --warn-soft: #FEF3C7; --error: #BE123C; --error-soft: #FFE4E6;
  --t-hh: #1D4ED8; --t-girl: #6D28D9; --t-cov: #0F766E; --t-ok: #15803D; --t-warn: #B45309; --t-bad: #BE123C; --t-none: #4B5563;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04); --shadow-lg: 0 20px 48px rgba(16, 24, 40, .14);
}
html { scrollbar-gutter: stable; }
body { transition: background-color .3s; }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; }
.theme-btn svg { width: 18px; height: 18px; }
header.top .who { flex-wrap: wrap; }
main:has(> #v-dash:not([hidden])) { max-width: 1360px; }

/* ---- Small shared pieces ---- */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1 1 220px; }
#v-dash .card { border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px; }
#v-dash .card h2 { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; margin: 0; }
#v-dash .card h2 .sub { font-size: 13px; font-weight: 500; color: var(--muted); }
#v-dash .card-head { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; justify-content: space-between; }
#v-dash .hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.ghost-btn { background: transparent !important; border-color: var(--line-strong) !important; }
.ghost-btn:hover { background: var(--surface-2) !important; }
/* "i" tips: the definition of a number or chart, on hover and on keyboard focus, and read out by screen readers (aria-label) */
.qi { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); font: italic 700 12px/1 Georgia, serif; cursor: help; padding: 0; flex: none; }
.qi:hover, .qi:focus-visible { color: var(--brand); border-color: var(--brand); }
.qi:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 1px; }
.qi:hover::after, .qi:focus-visible::after { content: attr(data-tip); position: absolute; z-index: 30; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(300px, 80vw); padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--surface);
  font: 400 13px/1.45 var(--font); text-align: left; white-space: normal; box-shadow: var(--shadow-lg); pointer-events: none; }
.qi[data-tip=""]::after { display: none; }

/* ---- Top: title, refresh status, filters ---- */
.dash-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.dash-title { margin: 0; font-size: 24px; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.d-status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.d-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c-ok); }
.d-status[data-state="loading"]::before { background: var(--c-warn); }
.d-status[data-state="failed"] { color: var(--t-bad); font-weight: 600; }
.d-status[data-state="failed"]::before { background: var(--c-bad); }
#d-reset:disabled, #d-refresh:disabled { opacity: .5; cursor: default; text-decoration: none; }
.dash-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-top: 16px; }
.fsel { display: inline-flex; flex-direction: column; gap: 4px; margin: 0; }
.fsel > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.fsel .sel, .fsel .inp { min-height: 40px; min-width: 170px; margin: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--edge); border-radius: 10px; font-size: 14px; }
.fsel.grow .inp { width: 100%; }
.reset-btn { align-self: center; margin-top: 18px; }

/* ---- Sections ---- */
.dtabs { display: flex; gap: 2px; margin: 18px 0 2px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.dtabs [role="tab"] { font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 14px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; white-space: nowrap; }
.dtabs [role="tab"]:hover { color: var(--ink); }
.dtabs [role="tab"][aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.dtabs [role="tab"]:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; border-radius: 8px 8px 0 0; }
.tab-n { font-size: 12px; font-weight: 700; color: var(--t-bad); background: color-mix(in srgb, var(--c-bad) 14%, transparent); border-radius: 99px; padding: 1px 8px; }
.dpane > .card, .dpane > .ogrid, .dpane > .qgrid { margin-top: 18px; }
.load-failed { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; border: 1px solid var(--c-bad); background: var(--error-soft); color: var(--ink); }
.load-failed svg { width: 22px; height: 22px; color: var(--t-bad); flex: none; }

/* ---- Overview: three headline numbers ---- */
.hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr 1fr; } .hero > :first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .hero { grid-template-columns: 1fr; } }
.kcard { position: relative; text-align: left; font: inherit; color: var(--ink); width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.kcard:hover { border-color: color-mix(in srgb, var(--brand) 40%, transparent); box-shadow: 0 4px 16px rgba(16, 24, 40, .08); }
.kcard:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.kcard.static { cursor: default; }
.kcard .k-top { color: var(--muted); font-size: 14px; font-weight: 600; }
.kcard .k-val { display: block; font-size: 40px; font-weight: 750; letter-spacing: -.03em; line-height: 1.05; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kcard .k-val small { font-size: 18px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kcard .k-val.na { color: var(--muted); }
.kcard .k-sub { display: block; font-size: 14px; color: var(--muted); margin-top: 8px; }
.kcard .k-bar { height: 6px; border-radius: 99px; background: var(--line-strong); overflow: hidden; margin-top: 14px; }
.kcard .k-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand); transition: width .8s var(--dash-ease); }
.hero-cov { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.tag { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.band { font-weight: 700; } .band.b-bad { color: var(--t-bad); } .band.b-warn { color: var(--t-warn); } .band.b-ok { color: var(--t-ok); }
.ring { width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line-strong); }
.ring .fill { stroke: var(--brand); transition: stroke-dashoffset .9s var(--dash-ease); }

/* ---- Overview: the eight smaller numbers in one strip ---- */
.strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
@media (max-width: 1240px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: 0 -1px -1px 0; padding: 16px 18px; min-height: 104px; cursor: pointer; }
.stat:hover { background: var(--surface-2); }
.stat:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.stat.static { cursor: default; }
.stat.static:hover { background: none; }
.s-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.s-val { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; display: inline-flex; align-items: center; gap: 6px; }
.s-val small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.s-val.na { color: var(--muted); }
.s-alert { color: var(--t-bad); display: inline-flex; }
.s-alert svg { width: 18px; height: 18px; }
.s-sub { font-size: 13px; color: var(--muted); }

/* ---- Overview: charts. Forms per day across the page; district coverage beside the two result charts ---- */
.ogrid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.ogrid > .card { margin-top: 0; }
.ostack { display: grid; gap: 16px; }
.ostack > .card { margin-top: 0; }
@media (max-width: 1000px) { .ogrid { grid-template-columns: 1fr; } }
.chart { width: 100%; height: 280px; margin-top: 12px; }
.chart-table { margin-top: 10px; }
.chart-note { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 150px; margin-top: 12px; padding: 18px; color: var(--muted); font-size: 14px;
  border: 1px dashed var(--line-strong); border-radius: 12px; }
.chart-note svg { width: 24px; height: 24px; flex: none; opacity: .8; }
.chart[hidden], .chart-note[hidden], .chart-table[hidden] { display: none; }

/* ---- Data quality: one line per check ---- */
.qgrid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
.qgrid > .card { margin-top: 0; }
@media (max-width: 900px) { .qgrid { grid-template-columns: 1fr; } }
.qlist { list-style: none; margin: 10px 0 0; padding: 0; }
.qlist li + li { border-top: 1px solid var(--line); }
.qrow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 6px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-radius: 10px; min-height: 60px; }
.qrow:hover { background: var(--surface-2); }
.qrow:focus-visible { outline: 3px solid var(--brand); outline-offset: -2px; }
.qrow.static { cursor: default; }
.qrow.static:hover { background: none; }
.q-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.q-ic svg { width: 17px; height: 17px; }
.q-ic.q-bad { color: var(--t-bad); background: color-mix(in srgb, var(--c-bad) 12%, transparent); }
.q-ic.q-warn { color: var(--t-warn); background: color-mix(in srgb, var(--c-warn) 14%, transparent); }
.q-ic.q-none { color: var(--t-none); background: color-mix(in srgb, var(--c-none) 12%, transparent); }
.q-ic.q-ok { color: var(--t-ok); background: color-mix(in srgb, var(--c-ok) 12%, transparent); }
.q-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.q-text b { font-size: 15px; font-weight: 650; }
.q-text small { font-size: 13px; color: var(--muted); }
.q-n { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.q-go { font-size: 22px; color: var(--muted); width: 14px; }

/* ---- Map ---- */
.map { height: 480px; border-radius: 12px; margin-top: 10px; border: 1px solid var(--line); z-index: 0; }
.map-tools { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid rgba(255, 255, 255, .8); }
.map-legend i.ring { background: transparent; border: 2.5px solid var(--c-bad); width: 10px; height: 10px; }
.map-legend i.dash { background: transparent; border: 2px dashed var(--muted); }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.leaflet-container a { color: var(--brand); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted) !important; }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
/* OpenStreetMap tiles are light; in the dark theme they are only dimmed a little (no inversion: roads and water keep their colours) */
:root[data-theme="dark"] .map .leaflet-tile-pane { filter: brightness(.8) saturate(.8); }
.map.no-tiles { background: repeating-linear-gradient(45deg, var(--surface-2) 0 12px, var(--surface) 12px 24px); }
.dist-label { background: none; border: 0; font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; transform: translate(-50%, -50%);
  text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 6px var(--surface); pointer-events: none; }
.pick-list { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-height: 260px; overflow-y: auto; }
.pick-list .linkish { min-height: 32px; text-align: left; }

/* ---- Status pills with an icon (never colour alone) ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 650; line-height: 1.4; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill svg { width: 13px; height: 13px; flex: none; }
.pill.p-ok { color: var(--t-ok); background: color-mix(in srgb, var(--c-ok) 14%, transparent); }
.pill.p-warn { color: var(--t-warn); background: color-mix(in srgb, var(--c-warn) 16%, transparent); }
.pill.p-bad { color: var(--t-bad); background: color-mix(in srgb, var(--c-bad) 13%, transparent); }
.pill.p-none { color: var(--t-none); background: color-mix(in srgb, var(--c-none) 14%, transparent); }
/* "Under review": blue, as in the phone app (amber is "changes requested") */
.pill.p-info { color: var(--t-hh); background: color-mix(in srgb, var(--c-hh) 14%, transparent); }

/* ---- Tables ---- */
#v-dash .table-wrap { max-height: none; overflow-y: visible; margin-top: 12px; }
#v-dash table { width: 100%; }
#v-dash th { background: transparent; border-bottom: 1px solid var(--line-strong); font-size: 12px; }
#v-dash tbody tr:last-child > * { border-bottom: 0; }
#v-dash tbody tr[data-row], #v-dash tbody tr[data-st], #v-dash tbody tr[data-ev], #v-dash tbody tr[data-rh] { cursor: pointer; }
#v-dash tbody tr[data-row]:hover, #v-dash tbody tr[data-st]:hover, #v-dash tbody tr[data-ev]:hover, #v-dash tbody tr[data-rh]:hover { background: var(--surface-2); }
#v-dash tr[tabindex]:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
#v-dash th button.sort { font: inherit; font-weight: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 6px 0; min-height: 32px; cursor: pointer; white-space: nowrap; text-align: inherit; }
#v-dash th button.sort::after { content: '↕'; opacity: .45; margin-left: 4px; font-size: 11px; }
#v-dash th[aria-sort="ascending"] button.sort::after { content: '↑'; opacity: 1; font-size: 12px; }
#v-dash th[aria-sort="descending"] button.sort::after { content: '↓'; opacity: 1; font-size: 12px; }
#v-dash th button.sort:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.tbl-tools { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.tbl-tools .inp { min-width: 220px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.cl-table td.x, .cl-table th.x { width: 44px; padding-right: 0; }
.cl-table th[scope="row"] { text-align: left; font-weight: inherit; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); position: static; background: none; border-bottom: 1px solid var(--line); }
.exp { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--edge); background: var(--surface); color: var(--ink); font: inherit; font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; }
.exp:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.cl-row.open > * { background: var(--surface-2); }
.cl-detail > td { background: var(--surface-2); padding-top: 4px; padding-bottom: 16px; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 20px; margin: 0 0 8px; }
dl.facts div { min-width: 0; }
dl.facts dt { font-size: 12px; font-weight: 600; color: var(--muted); }
dl.facts dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.audit-line { font-size: 13px; color: var(--muted); margin: 6px 0 10px; overflow-wrap: anywhere; }
.audit-line b { color: var(--ink); }
@media (max-width: 700px) { .cl-table .opt { display: none; } }
#v-dash tbody tr.stale > td { background: color-mix(in srgb, var(--c-bad) 7%, transparent); }
.ibar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.ibar .t { flex: 1; height: 6px; border-radius: 99px; background: var(--line-strong); overflow: hidden; min-width: 50px; }
.ibar .t i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .6s var(--dash-ease); }
.ibar span { font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--muted); }
.pager .row-gap { margin: 0; }
.more-btn { margin-top: 12px; }
.ev-count { font-size: 12px; font-weight: 700; color: var(--info); background: var(--info-soft); border-radius: 99px; padding: 1px 8px; margin-left: 6px; }

/* ---- Details panel: the records behind a number, over the page (full screen on a phone) ---- */
.dpanel { position: fixed; inset: 0; z-index: 1000; }
.dpanel[hidden] { display: none; }
.dpanel-back { position: absolute; inset: 0; background: rgba(17, 24, 39, .4); }
.dpanel-box { position: absolute; top: 0; right: 0; bottom: 0; width: min(920px, 100%); background: var(--bg); color: var(--ink); border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg); overflow-y: auto; padding: 0 22px 28px; overscroll-behavior: contain; }
.dpanel-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg); padding: 18px 0 8px; z-index: 1; }
.dpanel-head h2 { margin: 0; font-size: 19px; }
.dpanel-head h2:focus { outline: none; }
#d-drill-rows tr { cursor: pointer; }
#d-drill-rows tr:hover { background: var(--surface-2); }
body.panel-open { overflow: hidden; }
@media (max-width: 600px) { .dpanel-box { padding: 0 14px 24px; border-left: 0; } }

/* ---- Skeletons ---- */
.sk-kcard { height: 150px; border-radius: 14px; }
.sk-stat { height: 104px; border-radius: 0; }
.sk-row { height: 14px; margin: 14px 0; }

/* ---- Narrow screens ---- */
@media (max-width: 700px) {
  .dash-title { font-size: 21px; }
  .dash-bar .fsel { flex: 1 1 140px; }
  .fsel .sel { min-width: 0; width: 100%; }
  .reset-btn { margin-top: 0; }
  .kcard .k-val { font-size: 34px; }
  .map { height: 380px; }
  #v-dash .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .kcard, .ring .fill, .kcard .k-bar i, .ibar .t i { transition: none !important; }
}

/* ---- Today and Results (owner, 23 Oct 2026) ---- */
.strip-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1240px) { .strip-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .strip-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pane-note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.pane-note + .strip { margin-top: 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-ok) 60%, transparent); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.rgrid > .card { margin-top: 0; }
@media (max-width: 1000px) { .rgrid { grid-template-columns: 1fr; } }
.dpane > .card.wide { margin-top: 16px; }
.feed { list-style: none; margin: 8px 0 0; padding: 0; max-height: 330px; overflow-y: auto; }
.feed li + li { border-top: 1px solid var(--line); }
.feed li.blank { padding: 14px 4px; color: var(--muted); font-style: italic; }
.feed-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 4px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-radius: 8px; flex-wrap: wrap; }
.feed-row:hover { background: var(--surface-2); }
.feed-row:focus-visible { outline: 3px solid var(--brand); outline-offset: -2px; }
.feed-time { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; width: 44px; }
.feed-what { flex: 1; min-width: 150px; display: flex; flex-direction: column; }
.feed-what b { font-size: 14px; font-weight: 650; }
.feed-what small { font-size: 13px; color: var(--muted); }
#v-dash tbody tr.sub-row > td { background: var(--surface-2); font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
#v-dash tbody tr[data-tteam] { cursor: pointer; }
#v-dash tbody tr[data-tteam]:hover { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ---- Admin layout (owner, 23 Oct 2026, after the Dabang design): sidebar menu, top bar with search, pastel summary tiles ---- */
header.top .brand { flex-direction: row; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; }
.logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand); color: var(--brand-ink); }
.logo svg { width: 21px; height: 21px; }
.tab-ic { width: 20px; height: 20px; flex: none; }
nav.tabs button { display: inline-flex; align-items: center; gap: 8px; }
.side-dash { display: none; }
@media (min-width: 1000px) {
  body:has(#topbar:not([hidden])) main { margin-left: 244px; max-width: none; padding: 26px 28px 56px; }
  /* the Review table has 12 columns: tighter cells so the decision buttons stay in view next to the sidebar */
  #v-review th, #v-review td { padding: 9px 8px; }
  #v-review td .btn { white-space: nowrap; }
  header.top { position: fixed; top: 0; left: 0; bottom: 0; width: 244px; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px 18px;
    border-bottom: 0; border-right: 1px solid var(--line); box-shadow: none; overflow-y: auto; z-index: 20; }
  header.top .in { display: contents; }
  header.top .brand { order: 0; flex: none; padding: 0 6px 22px; font-size: 15px; line-height: 1.25; }
  nav.tabs { order: 1; flex-direction: column; max-width: none; margin: 0; padding: 0; gap: 4px; overflow: visible; }
  nav.tabs button { width: 100%; gap: 12px; padding: 11px 14px; min-height: 46px; border: 0; border-radius: 12px; font-size: 15px; text-align: left; }
  nav.tabs button:hover { background: var(--surface-2); }
  nav.tabs button[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); border: 0; box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 28%, transparent); }
  .side-dash { order: 2; display: block; }
  .side-dash[hidden] { display: none; }
  header.top .who { order: 3; margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 8px 12px; font-size: 14px; }
  .side-dash .dtabs { flex-direction: column; flex-wrap: nowrap; margin: 6px 0 0 24px; padding: 0 0 0 10px; border: 0; border-left: 2px solid var(--line); overflow: visible; gap: 2px; }
  .side-dash .dtabs [role="tab"] { border: 0; border-radius: 9px; padding: 8px 12px; min-height: 40px; margin: 0; font-size: 14px; font-weight: 600; justify-content: flex-start; width: 100%; }
  .side-dash .dtabs [role="tab"]:hover { background: var(--surface-2); }
  .side-dash .dtabs [role="tab"][aria-selected="true"] { background: var(--brand-soft); color: var(--brand); border: 0; }
  .side-card { margin: 22px 4px 8px; padding: 16px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
  .side-card b { font-size: 15px; }
  .side-card .side-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
  .side-card .side-ic svg { width: 18px; height: 18px; }
  .side-card .btn { margin: 8px 0 0; background: var(--surface); color: var(--brand); border: 0; font-weight: 700; }
}
/* top bar: title, search, refresh and download */
.dash-top { gap: 12px 20px; }
.search-box { flex: 1 1 260px; max-width: 440px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: var(--surface);
  border: 1px solid var(--edge); border-radius: 12px; color: var(--muted); margin: 0; }
.search-box svg { width: 18px; height: 18px; flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); outline: none; min-height: 40px; }
.search-box:focus-within { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
/* cards: rounder and softer */
:root[data-theme="light"] #v-dash .card, :root[data-theme="light"] .strip { border-color: transparent; box-shadow: 0 1px 3px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .05); }
#v-dash .card, .strip { border-radius: 20px; }
.card-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
/* summary card with four pastel tiles, beside forms per day */
.ov-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 18px; margin-top: 20px; align-items: stretch; }
.ov-top > .card { margin-top: 0; }
@media (max-width: 1200px) { .ov-top { grid-template-columns: 1fr; } }
.ptiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
@media (max-width: 760px) { .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ptile { --tile: #FFE2E5; --dot: #FA5A7D; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--ink);
  background: var(--tile); border: 0; border-radius: 16px; padding: 18px 16px; cursor: pointer; min-height: 168px; transition: transform .2s var(--dash-ease), box-shadow .2s; }
.ptile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 24, 40, .08); }
.ptile:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.p-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--dot); color: #fff; margin-bottom: 10px; }
.p-ic svg { width: 20px; height: 20px; }
.p-val { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.p-val small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.p-val.na { color: var(--muted); }
.p-label { font-size: 14px; font-weight: 650; }
.p-foot { font-size: 13px; color: var(--muted); }
.sk-ptile { height: 168px; border-radius: 16px; }
.ov-top .chart { height: 250px; }
/* three charts in a row, then the ranked lists */
.ogrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; align-items: start; }
.ogrid3 > .card { margin-top: 0; }
@media (max-width: 1280px) { .ogrid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ogrid3 > :nth-child(2) { grid-row: span 2; } }
@media (max-width: 800px) { .ogrid3 { grid-template-columns: 1fr; } .ogrid3 > :nth-child(2) { grid-row: auto; } }
#dp-overview > .ogrid { margin-top: 18px; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 1000px) { #dp-overview > .ogrid { grid-template-columns: 1fr; } }
.toplist { margin-top: 10px; }
.toplist .blank { color: var(--muted); font-style: italic; margin: 14px 0 4px; }
.top-head, .top-row { display: grid; grid-template-columns: 34px minmax(0, 1.7fr) minmax(60px, 1.4fr) 76px 66px; gap: 12px; align-items: center; }
.top-head { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line-strong); }
.top-head > :last-child { text-align: right; }
.top-row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--ink); text-align: left; padding: 12px 8px; cursor: pointer; min-height: 50px; }
.top-row:last-child { border-bottom: 0; }
.top-row:hover { background: var(--surface-2); }
.top-row:focus-visible { outline: 3px solid var(--brand); outline-offset: -2px; border-radius: 8px; }
.top-i { color: var(--muted); font-weight: 600; font-size: 13px; }
.top-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar { height: 6px; border-radius: 99px; background: var(--line-strong); overflow: hidden; }
.top-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.top-p { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.top-pill { justify-self: end; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 8px; border: 1px solid; font-variant-numeric: tabular-nums; }
.top-pill.b-ok { color: var(--t-ok); background: color-mix(in srgb, var(--c-ok) 10%, transparent); border-color: color-mix(in srgb, var(--c-ok) 45%, transparent); }
.top-pill.b-warn { color: var(--t-warn); background: color-mix(in srgb, var(--c-warn) 10%, transparent); border-color: color-mix(in srgb, var(--c-warn) 50%, transparent); }
.top-pill.b-bad { color: var(--t-bad); background: color-mix(in srgb, var(--c-bad) 9%, transparent); border-color: color-mix(in srgb, var(--c-bad) 45%, transparent); }
.top-pill.b-none { color: var(--t-none); border-color: var(--line-strong); }
@media (max-width: 560px) { .top-head, .top-row { grid-template-columns: 28px minmax(0, 1fr) 70px 58px; } .top-bar, .top-head .h-bar { display: none; } }
@media (prefers-reduced-motion: reduce) { .ptile { transition: none; } }
/* with the sidebar, the eight numbers of the Overview sit in two rows of four on laptop screens */
@media (min-width: 561px) and (max-width: 1599px) { .strip:not(.strip-6) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- Dropdowns in the same design (owner, 23 Oct 2026). Chrome and Edge let the open list be styled while it stays a real dropdown
   (keyboard, screen readers and phones work as before); other browsers keep their own list. Web platform only. ---- */
@supports (appearance: base-select) {
  select.sel, .form-grid select, select.sel::picker(select), .form-grid select::picker(select) { appearance: base-select; }
  .form-grid select { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
  .form-grid select:open { border-color: var(--brand); outline: 3px solid var(--brand-soft); outline-offset: 0; }
  select.sel { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px 0 14px; min-height: 40px;
    border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
  select.sel:hover { border-color: var(--brand); }
  select.sel:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 0; border-color: var(--brand); }
  select.sel:open { border-color: var(--brand); outline: 3px solid var(--brand-soft); outline-offset: 0; }
  :is(select.sel, .form-grid select)::picker-icon { color: var(--muted); transition: rotate .2s; }
  :is(select.sel, .form-grid select):open::picker-icon { rotate: 180deg; }
  :is(select.sel, .form-grid select)::picker(select) { border: 1px solid var(--line-strong); border-radius: 14px; padding: 6px; margin-block: 6px; background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow-lg); max-height: min(360px, 60vh); min-width: anchor-size(width); }
  :is(select.sel, .form-grid select) option { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 0; min-block-size: 0; line-height: 1.35; margin: 1px 0; border-radius: 9px; font-size: 14px; color: var(--ink);
    background: transparent; cursor: pointer; }
  :is(select.sel, .form-grid select) option:hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
  :is(select.sel, .form-grid select) option:focus-visible { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); outline: 2px solid var(--brand); outline-offset: -2px; }
  :is(select.sel, .form-grid select) option:checked { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
  :is(select.sel, .form-grid select) option::checkmark { order: 1; margin-left: auto; color: var(--brand); }
}
@media (prefers-reduced-motion: reduce) { select.sel::picker-icon { transition: none; } }

/* ---- Find a cluster: one box (no second border inside), and suggestions in the page's own list ---- */
.search-box { position: relative; }
.search-box input, .search-box input:focus, .search-box input:focus-visible { border: 0 !important; outline: none !important; box-shadow: none !important; background: none; padding: 0; margin: 0; }
.find-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; list-style: none; margin: 0; padding: 6px; max-height: min(360px, 60vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); }
.find-list[hidden] { display: none; }
.find-list li[role="option"] { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 9px; cursor: pointer; color: var(--ink); }
.find-list li[role="option"] b { font-size: 14px; font-weight: 700; }
.find-list li[role="option"] span { font-size: 13px; color: var(--muted); }
.find-list li[role="option"]:hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.find-list li[aria-selected="true"] { background: var(--brand-soft); }
.find-list li[aria-selected="true"] b { color: var(--brand); }
.find-list .find-none { padding: 10px 12px; font-size: 14px; color: var(--muted); }

/* ---- Audit fixes (23 Oct 2026) ---- */
/* chart cards: the title wraps on its own line space and the Table button stays at the top right */
#v-dash .chart-card .card-head { flex-wrap: nowrap; align-items: flex-start; }
#v-dash .chart-card .card-head h2 { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
#v-dash .chart-card .card-head .tbl-btn { flex: none; margin: 0; }
/* Users: CNIC usernames and phone numbers on one line */
#u-rows td:nth-child(2), #u-rows td:nth-child(5) { white-space: nowrap; }
/* login: the same logo as the sidebar */
.login-logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 16px; }
.login-logo svg { width: 26px; height: 26px; }
/* sidebar: the sections and the fieldwork card stay compact so the name and Log out fit on a laptop screen */
@media (min-width: 1000px) {
  .side-dash .dtabs [role="tab"] { min-height: 36px; padding: 7px 12px; }
  .side-card { margin-top: 16px; padding: 14px; gap: 4px; }
  .side-card .side-ic { display: none; }
  .side-card .btn { margin-top: 6px; }
  header.top .brand { padding-bottom: 16px; }
  nav.tabs button { min-height: 44px; padding: 10px 14px; }
}
@media (min-width: 1000px) and (max-height: 820px) { .side-card { display: none; } }
/* pop-up boxes (notifications, review decisions) cover the sidebar too */
.ask { z-index: 1100; }

/* ---- Profile card (owner, 23 Oct 2026): avatar with initials, name and role, then menu rows with icons ---- */
.who-card { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); font-weight: 750; font-size: 14px; letter-spacing: .03em; }
.who-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who-name { font-weight: 650; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-id .role { background: none; padding: 0; border-radius: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.side-act { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; min-height: 36px; }
.side-act svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.side-act:hover { color: var(--brand); text-decoration: none; }
.side-act:hover svg { color: currentColor; }
#logout.side-act:hover { color: var(--t-bad); }
.side-act .w-badge { margin-left: auto; }
@media (min-width: 1000px) {
  header.top .who { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 0 0; }
  .who-card { padding: 6px 12px 12px; }
  .side-act { width: 100%; padding: 8px 12px; min-height: 40px; border-radius: 10px; }
  .side-act:hover { background: var(--surface-2); }
}
@media (max-width: 999px) {
  header.top .who { gap: 6px 16px; }
  .who-card { order: -1; flex-basis: 100%; }
}
/* the profile block stays at the bottom of the sidebar, always in view; the menu above it scrolls when the screen is short */
@media (min-width: 1000px) {
  header.top .who { position: sticky; bottom: -18px; z-index: 2; background: var(--surface); margin-bottom: -18px; padding-bottom: 18px; }
}
/* accounts with a long menu (admin, supervisor): no fieldwork card on laptop-height screens, so nothing hides behind the profile block */
@media (min-width: 1000px) and (max-height: 1000px) { header.top:has(nav.tabs button:nth-child(3)) .side-card { display: none; } }

/* ---- Review forms (audit of 23 Oct 2026, C1 and C3) ---- */
.rv-table td.times span { display: block; white-space: nowrap; font-size: 13px; }
.rv-table td.times span + span { color: var(--muted); }
.rv-act { white-space: nowrap; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
/* destructive actions: red outline; red fill only on the final confirmation (text colour keeps 4.5:1 in both themes) */
.btn.danger-btn { color: var(--error) !important; border-color: color-mix(in srgb, var(--error) 55%, transparent) !important; background: var(--surface) !important; }
.btn.danger-btn:hover { background: var(--error-soft) !important; }
.btn.danger-solid { background: var(--error) !important; border-color: var(--error) !important; color: var(--bg) !important; }
/* funnel: households and girls as two labelled groups, each with its own scale (C4) */
.chart-group { margin: 14px 0 0; font-size: 13px; font-weight: 650; color: var(--muted); }
.chart-group + .chart { margin-top: 4px; }

/* ==== Audit of 23 Oct 2026: phase 2 (consistency) and phase 3 (polish). Web only; the shared styles.css is not changed. ==== */
/* S1: the page title is the section; the dashboard's name sits above it */
.title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.overline { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
/* S7: summary tiles in the colour system's own category colours (coverage teal, households blue, girls violet, clusters slate) */
.ptile.p-teal { --tile: #DDF5F1; --dot: #0D9488; } .ptile.p-blue { --tile: #E3EEFF; --dot: #2563EB; }
.ptile.p-violet { --tile: #EEE8FF; --dot: #7C3AED; } .ptile.p-slate { --tile: #ECF0F4; --dot: #64748B; }
:root[data-theme="dark"] .ptile.p-teal { --tile: rgba(20, 184, 166, .14); --dot: #14B8A6; } :root[data-theme="dark"] .ptile.p-blue { --tile: rgba(59, 130, 246, .15); --dot: #3B82F6; }
:root[data-theme="dark"] .ptile.p-violet { --tile: rgba(139, 92, 246, .16); --dot: #8B5CF6; } :root[data-theme="dark"] .ptile.p-slate { --tile: rgba(148, 163, 184, .13); --dot: #64748B; }
/* S9: table headers in sentence case at 13 px, like every other label */
th, #v-dash th { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
/* S10: the header row of long tables stays in view while scrolling (wide screens, where these tables fit without sideways scrolling) */
@media (min-width: 1280px) {
  .table-wrap:has(#d-staff), .table-wrap:has(#d-events), .table-wrap:has(#u-rows) { overflow: visible; }
  /* the Review table is wider than the page column: it scrolls inside its card, with its header row staying in view */
  .table-wrap:has(#rv-rows) { overflow: auto; max-height: calc(100vh - 230px); }
  .table-wrap:has(#d-staff) th, .table-wrap:has(#d-events) th, .table-wrap:has(#rv-rows) th, .table-wrap:has(#u-rows) th { position: sticky; top: 0; z-index: 3; background: var(--surface); }
}
/* S12: required markers and hints under fields */
.req { font-weight: 500; color: var(--muted); }
.field-hint { margin: 5px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.form-submit { align-self: end; }
/* S13: the four summary tiles go 2 x 2 when their card is narrow (laptops with the sidebar, tablets) */
.summary-card { container-type: inline-size; }
@container (max-width: 640px) { .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* S8 / P1: one icon family (Lucide, 2 px stroke) in place of typed characters */
.qi { font: inherit; width: 24px; height: 24px; }
.qi svg { width: 16px; height: 16px; }
.qi:hover::after, .qi:focus-visible::after { content: none; display: none; }
.exp { display: inline-grid; place-items: center; }
.exp svg { width: 18px; height: 18px; transition: transform .2s; }
.exp[aria-expanded="true"] svg { transform: rotate(90deg); }
.q-go { display: inline-flex; width: auto; color: var(--muted); }
.q-go svg { width: 18px; height: 18px; }
#v-dash th button.sort::after, #v-dash th[aria-sort="ascending"] button.sort::after, #v-dash th[aria-sort="descending"] button.sort::after {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; font-size: 0; background-color: currentColor;
  -webkit-mask: var(--sort-icon) no-repeat center / contain; mask: var(--sort-icon) no-repeat center / contain; }
#v-dash th button.sort { --sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E"); }
#v-dash th button.sort::after { opacity: .45; }
#v-dash th[aria-sort="ascending"] button.sort { --sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3Cpath d='M12 19V5'/%3E%3C/svg%3E"); }
#v-dash th[aria-sort="descending"] button.sort { --sort-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='m19 12-7 7-7-7'/%3E%3C/svg%3E"); }
#v-dash th[aria-sort="ascending"] button.sort::after, #v-dash th[aria-sort="descending"] button.sort::after { opacity: 1; }
/* P2: one badge look (round, tinted, 13 px semi-bold) and one corner scale: cards 16, tiles 14, controls 10, badges round */
.st { font-weight: 650; padding: 2px 9px; line-height: 1.4; }
.st.done { color: var(--t-ok); background: color-mix(in srgb, var(--c-ok) 14%, transparent); }
.st.part { color: var(--t-warn); background: color-mix(in srgb, var(--c-warn) 16%, transparent); }
.st.off { color: var(--t-bad); background: color-mix(in srgb, var(--c-bad) 13%, transparent); }
.st.info { color: var(--t-hh); background: color-mix(in srgb, var(--c-hh) 14%, transparent); }
.st:not(.done):not(.part):not(.off):not(.info) { color: var(--t-none); background: color-mix(in srgb, var(--c-none) 14%, transparent); }
.top-pill { border: 0 !important; border-radius: 999px; padding: 2px 9px; }
.top-pill.b-none { background: color-mix(in srgb, var(--c-none) 14%, transparent); }
#v-dash .card, .strip, .kcard { border-radius: 16px; }
.ptile, .sk-ptile { border-radius: 14px; }
.small-btn { border-radius: 10px !important; }
/* P3: "Table" as a small icon button; pressed while its table is shown */
.btn.icon-btn { width: 34px; min-width: 34px; padding: 0 !important; display: inline-grid; place-items: center; }
.btn.icon-btn svg { width: 17px; height: 17px; }
.btn.icon-btn[aria-pressed="true"] { color: var(--brand); border-color: var(--brand) !important; background: var(--brand-soft) !important; }
/* P4: Reset filters is a real button, shown only when a filter is set */
.reset-btn { align-self: flex-end; margin: 0 0 3px; }
.reset-btn[hidden] { display: none; }
/* P5: supporting text at least 13 px */
.fsel > span, .tag, .tab-n, .dist-label, dl.facts dt, .ev-count, .top-head { font-size: 13px; }
/* P7: the one tooltip of the platform (floats above the page; see tipShow in dashboard.js) */
.tip-pop { position: fixed; z-index: 2000; max-width: min(300px, calc(100vw - 16px)); padding: 9px 12px; border-radius: 10px; background: var(--ink); color: var(--surface);
  font: 400 13px/1.45 var(--font); box-shadow: var(--shadow-lg); pointer-events: none; }
.tip-pop[hidden] { display: none; }
/* P9: login with the product name and a show-password button */
.login-product { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--brand); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { color: var(--brand); }
.pw-eye:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.pw-eye svg { width: 20px; height: 20px; }
/* amber badges on the tested warning background: 4.5:1 or more in both themes (the 16 % tint was 4.4:1 in light) */
.pill.p-warn, .st.part { background: var(--warn-soft); }
/* Review: decision buttons inside a form keep their own width (a shared rule widens primary buttons in cards); the table fits the page,
   alerts wrap, and the View / Approve column stays in view at the right edge when the table scrolls sideways */
.rec-actions .btn { width: auto !important; margin: 0 !important; }
.rv-table td:nth-child(8) .pill { white-space: normal; }   /* only the alerts may wrap */
.rv-table .btn { width: auto !important; margin: 2px 4px 2px 0 !important; }
.rv-table th:last-child, .rv-table td.rv-act { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .18); }
.rv-table th:last-child { z-index: 4; }
