/* ============================================================
   CampaignOS — design system
   wwwroot/css/campaignos.css
   Fonts: @import in _Layout.cshtml <head>:
   <link href="https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
   ============================================================ */

:root {
  /* surfaces */
  --canvas:        #0F1A2E;
  --canvas-deep:   #0A1322;
  --panel:         #16233C;
  --panel-raised:  #1D2C48;
  --panel-hover:   #223354;
  --line:          #26375A;
  --line-soft:     #1F2E4C;

  /* ink */
  --ink:           #E8EEF8;
  --ink-muted:     #93A3BF;
  --ink-dim:       #6B7C9E;

  /* accents */
  --green:         #23C48A;
  --green-soft:    rgba(35,196,138,.14);
  --blue:          #4A87F5;
  --blue-soft:     rgba(74,135,245,.14);
  --sand:          #E5C264;
  --sand-soft:     rgba(229,194,100,.14);
  --orange:        #F5A623;
  --orange-soft:   rgba(245,166,35,.14);
  --red:           #EF4757;
  --red-soft:      rgba(239,71,87,.14);
  /* Added for the Reports page's per-section colour accents/charts - same
     saturation/lightness family as the 5 accents above, just two more hues
     so an 11-section report doesn't lean on only 5 colours. */
  --violet:        #A78BFA;
  --violet-soft:   rgba(167,139,250,.14);
  --teal:          #2DD4BF;
  --teal-soft:     rgba(45,212,191,.14);

  /* type */
  --display: "Source Serif 4", Georgia, serif;
  --body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* geometry */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --gap:  20px;
  --shell-w: 250px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--shell-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--canvas-deep);
  border-right: 1px solid var(--line-soft);
  padding: 26px 18px;
  display: flex; flex-direction: column; gap: 26px;
  /* Without an explicit height, a grid item stretches to match the row
     height (i.e. .main's content height) — on a long page that leaves the
     nav stopping partway down a much taller stretched box, with a huge dead
     gap of background below the last item instead of ending with normal
     padding. Pin it to the viewport and let it scroll on its own instead. */
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.brand span { color: var(--green); }
.brand small {
  display: block; font-family: var(--body); font-size: 10px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ink-dim); margin-top: 5px;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  /* flex-start, not space-between: icon+label should always hug the left.
     Items with a trailing chevron/count push it right via their own
     margin-left: auto (see .nav-parent > summary::after and .count) rather
     than relying on the parent — otherwise a 2-child item with no such
     trailing element (e.g. Dashboard) gets its label shoved to the far
     right instead of sitting next to its icon. */
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--ink-muted); font-size: 14px; font-weight: 500;
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--panel); color: var(--ink); border-left-color: var(--green); }
.nav-item .count { font-size: 12px; color: var(--ink-dim); margin-left: auto; }

.nav-parent > summary { cursor: pointer; list-style: none; }
.nav-parent > summary::-webkit-details-marker { display: none; }
.nav-parent > summary::after {
  content: '\203A'; margin-left: auto; color: var(--ink-dim);
  transition: transform .15s ease;
}
.nav-parent[open] > summary::after { transform: rotate(90deg); }
.nav-children { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; margin-top: 2px; }
.nav-child { font-size: 13px; padding: 7px 11px; }

/* min-width: 0 overrides the grid item's default min-width: auto, which
   otherwise sizes this 1fr track to fit its widest descendant's min-content
   (e.g. the topbar search box) instead of the space actually available next
   to the sidebar. Left unset, the page grows wider than the viewport, and a
   fragment link (#section) that pulls the browser's default horizontal
   scroll-into-view drags the sticky sidebar (only sticky on the y-axis)
   off-screen to the left. */
.main { padding: 28px 34px 60px; max-width: 1440px; min-width: 0; }

/* ---------- signature: scope breadcrumb ---------- */
.scope {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; margin-bottom: 26px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
}
.scope-seg { color: var(--ink); }
.scope-seg.is-above { color: var(--ink-dim); }          /* above your authority */
.scope-seg.is-current { color: var(--green); }
.scope-sep { color: var(--ink-dim); }
.scope-note {
  margin-left: auto; text-transform: none; letter-spacing: 0;
  font-size: 12px; font-weight: 400; color: var(--ink-dim);
}

/* ---------- page head ---------- */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .24em;
  text-transform: uppercase; color: var(--green); margin-bottom: 10px;
}
.eyebrow.is-sand { color: var(--sand); }
.page-title { font-size: 34px; line-height: 1.15; margin-bottom: 8px; }
.page-sub { color: var(--ink-muted); max-width: 68ch; margin: 0 0 28px; }

/* ---------- layout helpers ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--gap); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 12px; }
.push { margin-left: auto; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px;
}
.panel-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.panel-title { font-family: var(--body); font-size: 15px; font-weight: 600; }
.panel-note { font-size: 12px; color: var(--ink-dim); margin-left: auto; }

/* ---------- KPI tile ---------- */
.kpi {
  background: var(--panel-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px;
}
a.kpi { display: block; transition: border-color .15s; }
a.kpi:hover { border-color: var(--ink-muted); text-decoration: none; }
.kpi-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-muted); margin-bottom: 12px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--green); }
.dot.blue { background: var(--blue); } .dot.sand { background: var(--sand); }
.dot.orange { background: var(--orange); } .dot.red { background: var(--red); }
.kpi-value {
  font-family: var(--display); font-size: 38px; font-weight: 700;
  line-height: 1; letter-spacing: -0.02em;
}
.kpi-value.green { color: var(--green); } .kpi-value.blue { color: var(--blue); }
.kpi-value.sand  { color: var(--sand); }  .kpi-value.red  { color: var(--red); }
.kpi-foot { margin-top: 9px; font-size: 12.5px; color: var(--ink-dim); }
.kpi-foot.green { color: var(--green); } .kpi-foot.sand { color: var(--sand); }
.kpi-foot.red { color: var(--red); }

/* ---------- health bar ---------- */
.health {
  display: flex; align-items: center; gap: 26px;
  background: var(--panel-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 24px;
}
.health-value { font-family: var(--display); font-size: 40px; font-weight: 700; color: var(--green); line-height: 1; }
.health-value.amber { color: var(--orange); } .health-value.red { color: var(--red); }

.bar { flex: 1; height: 13px; background: var(--canvas-deep); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.bar > i.blue { background: var(--blue); } .bar > i.sand { background: var(--sand); }
.bar > i.orange { background: var(--orange); } .bar > i.red { background: var(--red); }
.bar.sm { height: 9px; }

/* coverage list (deck's ward-coverage chart, as HTML) */
.meter { display: grid; grid-template-columns: 120px 1fr 46px; align-items: center; gap: 14px; padding: 7px 0; }
.meter-name { font-size: 13.5px; color: var(--ink-muted); text-align: right; }
.meter-pct { font-size: 13px; font-weight: 600; text-align: right; }

/* clickable meter row, e.g. the Election Day charts' geography drill-down */
a.meter-link { text-decoration: none; color: inherit; border-radius: 8px; margin: 0 -8px; padding: 7px 8px; }
a.meter-link .meter-name, a.meter-link .meter-pct { color: inherit; }
a.meter-link:hover { background: var(--panel-hover); text-decoration: none; }
a.meter-link:hover .meter-name { color: var(--ink); }

/* grouped vertical bar chart, e.g. Election Day's "votes by party per LGA" */
.grouped-bar-chart { display: flex; padding: 6px 0 0; }
.grouped-bar-chart-axis { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; width: 46px; height: 260px; padding-right: 8px; font-size: 11px; color: var(--ink-dim); }
.grouped-bar-chart-plot { position: relative; flex: 1; height: 260px; }
.grouped-bar-chart-gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line-soft); }
.grouped-bar-chart-groups { position: relative; z-index: 1; display: flex; justify-content: space-around; align-items: flex-end; height: 100%; border-bottom: 1px solid var(--line); }
.grouped-bar-chart-group { display: flex; align-items: flex-end; gap: 3px; height: 100%; padding: 0 4px; }
.grouped-bar-chart-bar { width: 16px; border-radius: 3px 3px 0 0; min-height: 1px; }
.grouped-bar-chart-labels { display: flex; justify-content: space-around; margin-left: 46px; margin-top: 8px; }
.grouped-bar-chart-label { font-size: 12px; color: var(--ink-muted); text-align: center; flex: 1; }
.grouped-bar-chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* wide-label meter row, e.g. Election Day's "Upload Completion by LGA" —
   same .meter/.bar building blocks, just a left-aligned name and enough
   room in the trailing column for a "121 sheets · 86%" style label. The
   track is capped at a max-width rather than stretching to fill the whole
   1fr column — full-width made even a modest percentage's fill travel most
   of the panel, which read as tracking the panel's width more than the
   percentage; capping it keeps the same percentage the same physical bar
   length on any panel wide enough for the full 640px, while still
   shrinking with the column (not overflowing past the panel's edge and
   pushing the trailing label off-screen) on narrower ones. The middle
   column needs minmax(0, 1fr), not plain 1fr, so it's actually allowed to
   shrink below the bar's own natural width — a bare 1fr's default min-width
   is auto (its content's size), which is exactly what let the row overflow. */
.meter-wide { grid-template-columns: 110px minmax(0, 1fr) 190px; }
.meter-wide .meter-name { text-align: left; text-transform: uppercase; font-weight: 600; letter-spacing: .02em; }
.meter-wide .meter-pct { color: var(--green); }
.meter-wide .bar { width: 100%; max-width: 640px; justify-self: start; }

/* ---------- pills / status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.pill.verified { background: var(--green-soft); color: var(--green); border-color: rgba(35,196,138,.3); }
.pill.pending  { background: var(--blue-soft);  color: var(--blue);  border-color: rgba(74,135,245,.3); }
.pill.review   { background: var(--sand-soft);  color: var(--sand);  border-color: rgba(229,194,100,.3); }
.pill.flagged  { background: var(--red-soft);   color: var(--red);   border-color: rgba(239,71,87,.3); }
.pill.duplicate{ background: rgba(107,124,158,.14); color: var(--ink-muted); border-color: var(--line); }
/* A possible duplicate is a WARNING, not a note: two rows may be the same person, and until
   someone confirms it a broadcast can go out twice. Amber rather than red because it is not
   necessarily wrong - one person legitimately holds both a ward and an LGA position - and not grey,
   which read as informational and got ignored.
   Separate from .pill.duplicate, which Demographics still uses for its neutral "MODELLED" legend
   badge and must stay quiet. */
.pill.warn     { background: var(--orange-soft); color: var(--orange); border-color: rgba(245,166,35,.3); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-muted); background: var(--panel-raised);
  border-bottom: 1px solid var(--line);
}
.table th:first-child { border-top-left-radius: var(--r-sm); }
.table th:last-child  { border-top-right-radius: var(--r-sm); }
.table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table.zebra tbody tr:nth-child(even) { background: var(--panel); }
.table tbody tr:hover { background: var(--panel-raised); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-rank { width: 1%; white-space: nowrap; padding-left: 8px; padding-right: 8px; text-align: center; }
.table .col-actions { text-align: right; white-space: nowrap; }

.row-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: none; border: 1px solid var(--line); color: var(--ink-muted); cursor: pointer;
}
.row-action:hover { color: var(--ink); background: var(--panel-hover); text-decoration: none; }
.row-action svg { width: 14px; height: 14px; }

/* ---------- pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; font-size: 13px; color: var(--ink-muted);
}
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.pagination a, .pagination span.page-current {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r-sm);
  border: 1px solid var(--line); color: var(--ink-muted); font-size: 13px;
}
.pagination a:hover { background: var(--panel-hover); color: var(--ink); text-decoration: none; }
.pagination span.page-current { background: var(--green); border-color: var(--green); color: #06281C; font-weight: 700; }
.pagination .page-disabled { opacity: .35; pointer-events: none; }
.masked { color: var(--ink-muted); letter-spacing: .04em; }
.reveal {
  margin-left: 8px; font-size: 11px; color: var(--blue);
  background: none; border: 0; cursor: pointer; padding: 0;
}

/* ---------- sequence markers (only for real sequences) ---------- */
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  font-family: var(--body); font-size: 13px; font-weight: 700; color: var(--canvas-deep);
  background: var(--green);
}
.step-num.blue { background: var(--blue); } .step-num.sand { background: var(--sand); }
.step-num.orange { background: var(--orange); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.field .hint { font-size: 12px; color: var(--ink-dim); }
.input, .select, .textarea {
  background: var(--canvas-deep); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); padding: 11px 13px; font: inherit; font-size: 14px; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); outline: none; }
.input::placeholder { color: var(--ink-dim); }
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-dim); font-size: 11.5px; }
.field-error { color: var(--red); font-size: 12.5px; }

/* ---------- multi-select checkbox dropdown ----------
   Same details/summary interaction the sidebar nav already uses — a
   dropdown of checkboxes instead of a native <select multiple>, which
   forces ctrl/cmd-click and shows no closed-state summary. */
.multiselect { position: relative; }
.multiselect-summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.multiselect-summary::-webkit-details-marker { display: none; }
.multiselect-summary::after { content: '\203A'; transform: rotate(90deg); color: var(--ink-dim); flex: none; transition: transform .15s ease; }
.multiselect[open] .multiselect-summary::after { transform: rotate(-90deg); }
.multiselect-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 220px; max-height: 260px; overflow-y: auto;
  background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 6px; box-shadow: 0 14px 30px rgba(0,0,0,.45);
}
/* .field label (which this also is) sets text-transform: uppercase at
   higher specificity (0-1-1) than a single class could override (0-1-0) —
   qualify with .field to win without !important. */
.field .multiselect-option {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); cursor: pointer;
}
.multiselect-option:hover { background: var(--panel-hover); }
.multiselect-option input { width: auto; flex: none; }

.consent {
  background: var(--green-soft); border: 1px solid rgba(35,196,138,.32);
  border-radius: var(--r); padding: 16px; font-size: 13px; color: var(--ink-muted);
}
.consent strong { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--panel-raised); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--panel-hover); text-decoration: none; }
.btn-primary { background: var(--green); border-color: var(--green); color: #06281C; }
.btn-primary:hover { background: #2ADCA0; }
.btn-danger { background: var(--red-soft); border-color: rgba(239,71,87,.4); color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- alerts ---------- */
.alert {
  display: flex; gap: 14px; align-items: flex-start;
  border-radius: var(--r); padding: 15px 17px; font-size: 13.5px;
  border: 1px solid var(--line); background: var(--panel-raised);
}
.alert-title { font-weight: 700; margin-bottom: 3px; }
.alert.flag { background: var(--red-soft); border-color: rgba(239,71,87,.35); }
.alert.flag .alert-title { color: var(--red); }
.alert.note { background: var(--sand-soft); border-color: rgba(229,194,100,.32); }
.alert.note .alert-title { color: var(--sand); }
.alert-icon {
  flex: none; width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--sand); color: var(--canvas-deep);
}
.alert.flag .alert-icon { background: var(--red); color: #fff; }

/* ---------- breaking-news ticker (Election Day live results) ---------- */
/* Sticky, not fixed: it stays exactly where it already sits in the page
   flow (right below the topbar) rather than jumping to overlay the topbar
   or sidebar, but a page scroll no longer carries it away with the rest of
   the content below it. `top` is set inline by JS to the topbar's actual
   measured height, not hardcoded, so it can't drift if the topbar's own
   padding ever changes. z-index sits just under the topbar's (40) so the
   topbar still wins if they ever overlap during the scroll transition. */
.ticker { display: none; align-items: stretch; border-radius: var(--r); overflow: hidden; margin-bottom: 18px; height: 44px; position: sticky; z-index: 39; }
.ticker.is-active { display: flex; }
.ticker-label {
  flex: none; display: flex; align-items: center; padding: 0 26px 0 16px;
  background: var(--red); color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: .02em; white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
  margin-right: -1px; z-index: 1;
}
.ticker-track-wrap { flex: 1; background: var(--canvas-deep); overflow: hidden; display: flex; align-items: center; }
.ticker-track { display: flex; white-space: nowrap; will-change: transform; animation: ticker-scroll 30s linear infinite; }
.ticker-item { display: inline-flex; align-items: center; padding: 0 28px; font-size: 13.5px; }
.ticker-item strong { color: var(--ink); font-weight: 700; margin-right: 10px; }
.ticker-item .ticker-party { color: var(--ink-muted); margin-right: 10px; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- simulation warm-up (CSS-animated, no external gif) ---------- */
.warmup-spinner { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--green); animation: warmup-spin .9s linear infinite; }
@keyframes warmup-spin { to { transform: rotate(360deg); } }
.warmup-dots::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: warmup-dots 1.4s steps(4,end) infinite; }
@keyframes warmup-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75%, 100% { content: '...'; } }

/* ---------- confirm modal (themed replacement for window.confirm) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(6,11,22,.72);
}
.modal-overlay.is-open { display: flex; }
.modal-box {
  width: 100%; max-width: 420px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.modal-title { margin: 0 0 10px; font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--ink); }
.modal-body { margin: 0 0 22px; font-size: 14px; line-height: 1.55; color: var(--ink-muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Announcement variant (e.g. the simulation-complete winner modal) — same
   box, centered content with a badge icon up top instead of a left-aligned
   confirm/cancel prompt. */
.modal-box.center { text-align: center; }
.modal-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green-soft); color: var(--green);
}
.modal-icon svg { width: 30px; height: 30px; }
.modal-box.center .modal-actions { justify-content: center; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-muted); }
.empty h3 { font-size: 19px; color: var(--ink); margin-bottom: 6px; }

/* ---------- footnote (deck style) ---------- */
.footnote { margin-top: 26px; font-size: 12px; font-style: italic; color: var(--ink-dim); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split  { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; padding: 14px 16px; }
  .sidebar .nav-group { flex-direction: row; }
  .main { padding: 20px 16px 48px; }
  .page-title { font-size: 26px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .meter { grid-template-columns: 92px 1fr 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- print (Reports page "Print report" button) ---------- */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { display: block !important; }
  .main { padding: 0 !important; }
  .panel, .kpi { break-inside: avoid; border: 1px solid #ccc !important; background: #fff !important; }
  body { background: #fff !important; color: #000 !important; }

  /* .table.zebra's even-row background (--panel, a dark navy meant for this
     app's dark screen theme) would otherwise print as a near-illegible
     dark-navy stripe with black text on top of it - true on any page with a
     zebra table, not just Reports, so this fix is deliberately unscoped. */
  .table.zebra tbody tr:nth-child(even) { background: #f3f6fa !important; }

  /* Reports-page-only: flat grey/white read as "plain" on a printed/
     PDF-exported report, so every panel here gets a coloured top accent
     (--accent, set per <section> in Reports.cshtml) instead of a uniform
     grey border, and KPI tiles get a soft matching tint. Scoped to
     .report-page so no other page's print output changes. */
  .report-page .panel, .report-page .kpi {
    border: 1px solid #ddd !important;
    border-top: 3px solid var(--accent, var(--green)) !important;
  }
  .report-page .panel-head { border-bottom-color: #eee !important; }
  .report-page .panel-title { color: #000 !important; }
  .report-page .kpi:has(.kpi-value.green) { background: var(--green-soft) !important; }
  .report-page .kpi:has(.kpi-value.blue)  { background: var(--blue-soft) !important; }
  .report-page .kpi:has(.kpi-value.sand)  { background: var(--sand-soft) !important; }
  .report-page .kpi:has(.kpi-value.red)   { background: var(--red-soft) !important; }

  .report-banner {
    background: linear-gradient(120deg, var(--green), var(--blue)) !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .report-banner * { color: #06281C !important; }
  .report-section-num {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    background: var(--accent, var(--green)) !important; color: #06281C !important;
  }

  /* Canvas pixels are fixed once Chart.js draws them - this page's own
     beforeprint handler (Reports.cshtml) calls chart.resize() so each
     canvas redraws to fit this print width before the browser snapshots
     the page, but it still needs a defined print-time box to resize into. */
  .chart-container { height: 220px !important; break-inside: avoid; }
}

/* Reports page chart canvases (Chart.js) - a relatively-positioned box
   because Chart.js's responsive mode sizes the canvas to fill its parent. */
.chart-container { position: relative; height: 280px; margin: 6px 0 14px; }

/* ---------- Reports page colour accents (Reports.cshtml only, all scoped
   under .report-page so nothing here touches any other page's panels) ----------
   --accent is set per <section> in Reports.cshtml (one of the 7 accent
   tokens above, rotated so adjacent sections never repeat) and cascades
   down to every .panel/.report-section-num inside it. */
.report-page .panel { border-top: 3px solid var(--accent, var(--green)); }
.report-section-title { display: flex; align-items: center; gap: 10px; }
.report-section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--accent, var(--green)); color: #06281C;
  font-family: var(--body); font-size: 13px; font-weight: 700;
}
.report-banner {
  background: linear-gradient(120deg, var(--green), var(--blue));
  border-radius: var(--r-lg); padding: 22px 26px; margin-bottom: 22px;
}
.report-banner .page-title, .report-banner .eyebrow, .report-banner .page-sub { color: #06281C; }
.report-banner .eyebrow { opacity: .75; }

/* ============================================================
   Deck shell — shared by wwwroot/index.html and the single-view
   pages under wwwroot/pages/. Was inline in index.html's <style>;
   moved here so every page that reuses the sidebar/topbar shell
   doesn't have to duplicate ~100 lines of CSS.
   ============================================================ */
html { scroll-behavior: smooth; }
body { max-width: none; }
.deck-slide {
  /* No left/right padding here: this used to be wwwroot/index.html, plain
     HTML with no surrounding layout, so 80px was the only horizontal
     spacing. Now it renders inside _Layout.cshtml's standard content
     wrapper, which already adds 34px — the two were stacking to 114px,
     shifting deck content much further right than every other page. */
  min-height: 100vh; padding: 64px 0 56px; display: flex; flex-direction: column;
  border-bottom: 1px solid var(--line-soft); position: relative;
}
.deck-slide.center { justify-content: center; }
/* Cover slide (#s1) is short — vertically centering it in a full 100vh
   block (fine for slide 7, which has enough content to fill the space)
   left a huge empty gap above "CampaignOS" on what's now a real app
   landing page, not a full-screen presentation. */
#s1.deck-slide.center { justify-content: flex-start; padding-top: 10px; min-height: 0; padding-bottom: 40px; }
.deck-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.deck-title { font-size: 38px; line-height: 1.15; margin: 0 0 26px; max-width: 940px; }
.deck-sub { color: var(--ink-muted); max-width: 780px; margin: 0 0 28px; }
.deck-footnote { margin-top: auto; padding-top: 26px; font-size: 12.5px; font-style: italic; color: var(--ink-dim); }
.deck-pill-row { display: flex; gap: 12px; flex-wrap: wrap; }
.deck-pill {
  border: 1px solid var(--green); color: var(--green); padding: 10px 20px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  display: inline-block; cursor: pointer;
}
.deck-pill:hover { background: var(--green); color: #06281C; text-decoration: none; }
.deck-pill.active { background: var(--green); color: #06281C; cursor: default; }
.badge {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--body); font-weight: 700; color: var(--canvas-deep); background: var(--green); flex: none;
}
.badge.blue { background: var(--blue); } .badge.sand { background: var(--sand); } .badge.orange { background: var(--orange); }
.badge-lg { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
.quote-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; font-size: 14.5px; color: var(--ink); }
.quote-box.outcome-clickable, .quote-box.org-clickable, .quote-box.intel-clickable { transition: border-color .15s, background .15s; }
.quote-box.outcome-clickable:hover, .quote-box.org-clickable:hover, .quote-box.intel-clickable:hover { border-color: var(--green); background: var(--panel-hover); }
.panel.lga-card { transition: border-color .15s, background .15s; }
.panel.lga-card:hover { border-color: var(--green); background: var(--panel-hover); }
.arrow-sep { color: var(--ink-dim); font-size: 20px; align-self: center; }
.slide-nav {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 50;
  display: flex; flex-direction: column; gap: 6px; background: rgba(15,26,46,.85); border: 1px solid var(--line);
  border-radius: 99px; padding: 8px 5px; backdrop-filter: blur(4px);
}
.slide-nav a { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block; }
.slide-nav a.is-active { background: var(--green); }

/* ---------- sidebar shell ---------- */
.app { transition: grid-template-columns .18s ease; }
.sidebar { transition: width .18s ease, padding .18s ease; }

.nav-icon { width: 18px; height: 18px; flex: none; }

/* Collapsed = a narrow icon-only rail, not fully hidden, so the icons stay
   visible as a quick way back to any section without reopening the sidebar. */
.app.sidebar-collapsed { grid-template-columns: 64px 1fr; }
.app.sidebar-collapsed .sidebar { width: 64px; min-width: 64px; padding: 26px 10px; align-items: center; }
.app.sidebar-collapsed .sidebar .brand,
.app.sidebar-collapsed .sidebar .nav-label-text,
.app.sidebar-collapsed .sidebar .nav-children,
.app.sidebar-collapsed .sidebar .nav-parent > summary::after {
  display: none;
}
.app.sidebar-collapsed .sidebar .nav-group { align-items: center; }
.app.sidebar-collapsed .sidebar .nav-item { justify-content: center; padding: 10px; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99; }

@media (max-width: 820px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 250px; z-index: 100;
    flex-direction: column !important; overflow-x: hidden; overflow-y: auto;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .sidebar.is-open { transform: translateX(0); width: 250px; padding: 26px 18px; }
  .sidebar-overlay.is-open { display: block; }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 12px 28px; background: var(--canvas-deep); border-bottom: 1px solid var(--line-soft);
}
.topbar-toggle {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-muted); cursor: pointer;
}
.topbar-toggle:hover { color: var(--ink); background: var(--panel-hover); }
.topbar-search {
  display: flex; align-items: center; gap: 8px; flex: 1; max-width: 340px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px;
}
.topbar-search svg { flex: none; color: var(--ink-dim); }
.topbar-search input {
  background: none; border: none; outline: none; color: var(--ink); font: inherit;
  width: 100%; padding: 9px 0; font-size: 13.5px;
}
.topbar-search input::placeholder { color: var(--ink-dim); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative; width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-muted); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: var(--panel-hover); }
.icon-dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--canvas-deep);
}
/* Numeric badge on the bell/mail icon-btns — same corner spot as .icon-dot,
   but sized to fit a number rather than just signalling "something's new". */
.icon-count {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--red); color: #fff; border: 2px solid var(--canvas-deep);
  font-size: 10px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.user-menu { position: relative; }
.user-menu-btn {
  width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #06281C;
  font-weight: 700; font-size: 13px; border: none; cursor: pointer; display: grid; place-items: center;
}
.user-menu-dropdown {
  display: none; position: absolute; right: 0; top: 46px; min-width: 180px;
  background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--r); padding: 6px;
  box-shadow: 0 14px 30px rgba(0,0,0,.45); z-index: 60;
}
.user-menu-dropdown.is-open { display: block; }
.user-menu-dropdown .dropdown-name { padding: 8px 12px 4px; font-size: 12px; color: var(--ink-dim); }
.dropdown-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink); font-size: 13.5px; background: none; border: none; font: inherit; cursor: pointer;
}
.dropdown-item:hover { background: var(--panel-hover); text-decoration: none; }

/* ---------- global AI chat panel (topbar icon, next to bell/mail) ---------- */
.ai-chat-panel {
  display: none; position: absolute; right: 0; top: 46px; width: 380px; height: 520px;
  background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 14px 30px rgba(0,0,0,.45); z-index: 60;
  flex-direction: column; overflow: hidden;
}
.ai-chat-panel.is-open { display: flex; }
.ai-chat-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px; color: var(--ink); }
.ai-chat-header #aiChatClear { margin-left: auto; background: none; border: none; color: var(--ink-dim); font-size: 12px; cursor: pointer; }
.ai-chat-header #aiChatClear:hover { color: var(--ink); }
.ai-chat-header #aiChatClose { background: none; border: none; color: var(--ink-dim); font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.ai-chat-header #aiChatClose:hover { color: var(--ink); }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-chat-empty { color: var(--ink-dim); font-size: 13px; margin: 0; }
.ai-chat-bubble { max-width: 85%; padding: 9px 12px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.ai-chat-bubble.user { align-self: flex-end; background: var(--green); color: #06281C; }
.ai-chat-bubble.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.ai-chat-bubble.error { align-self: flex-start; background: var(--red-soft); color: var(--red); border: 1px solid rgba(239,71,87,.3); }
.ai-chat-source { font-size: 11px; color: var(--ink-dim); margin-top: 4px; }
.ai-chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ai-chat-input-row input { flex: 1; }
@media (max-width: 560px) {
  .ai-chat-panel { position: fixed; top: 60px; right: 8px; left: 8px; width: auto; height: calc(100vh - 76px); }
}

@media (max-width: 560px) {
  .topbar-search { display: none; }
}

/* ---------- Comms inbox ---------- */
.comms-thread-list { display: flex; flex-direction: column; gap: 2px; max-height: 72vh; overflow-y: auto; }
.comms-thread-item {
  display: block; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid transparent;
  color: var(--ink); text-decoration: none;
}
.comms-thread-item:hover { background: var(--panel-hover); text-decoration: none; }
.comms-thread-item.is-selected { background: var(--panel-hover); border-color: var(--line); }
.comms-thread-name { font-weight: 600; font-size: 13.5px; }
.comms-thread-preview { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comms-thread-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comms-unread-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--green); color: var(--canvas-deep);
  font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.comms-conversation { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px 4px 12px; }
.comms-bubble-row { display: flex; }
.comms-bubble-row.out { justify-content: flex-end; }
.comms-bubble-row.in { justify-content: flex-start; }
.comms-bubble {
  max-width: 72%; padding: 10px 13px; border-radius: var(--r); font-size: 13.5px; line-height: 1.4;
  white-space: pre-wrap; word-break: break-word;
}
.comms-bubble-row.out .comms-bubble { background: var(--green-soft); border: 1px solid rgba(35,196,138,.3); }
.comms-bubble-row.in .comms-bubble { background: var(--panel-raised); border: 1px solid var(--line); }
.comms-bubble-meta { font-size: 10.5px; color: var(--ink-dim); margin-top: 4px; text-align: right; }
.comms-reply-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }

/* ---------- auth cover (login page) ----------
   Same split-screen pattern as CabbashAdminPortal's Login.cshtml (branded
   cover panel + plain form panel), reskinned with this app's own dark
   tokens/fonts instead of pulling in Bootstrap — the rest of CampaignOS
   never touches Bootstrap, so keeping login self-consistent avoids a jarring
   light/purple flash right before the dark app shell loads. */
.auth-cover { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-cover-side {
  background: linear-gradient(135deg, var(--canvas-deep) 0%, #16233c 100%);
  color: var(--ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-cover-side::before {
  content: ""; position: absolute; bottom: -100px; right: -100px; width: 300px; height: 300px;
  border-radius: 50%; background: var(--green-soft);
}
.auth-cover-side::after {
  content: ""; position: absolute; top: -60px; left: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: var(--blue-soft);
}
.auth-cover-side > * { position: relative; z-index: 1; }
.auth-cover-copy h2 { font-size: 28px; line-height: 1.2; margin-bottom: 10px; }
.auth-cover-copy p { color: var(--ink-muted); max-width: none; margin: 0; }
.auth-form-side { padding: 40px; display: flex; align-items: center; justify-content: center; background: var(--canvas); }
.auth-card { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) {
  .auth-cover { grid-template-columns: 1fr; }
  .auth-cover-side { display: none; }
}
.comms-reply-form textarea { flex: 1; resize: vertical; }

/* Group heading row inside a list table - the Stakeholders list uses it to separate Party Ward
   Executives / Party LGA Leaders / Party Ward Leaders. The !important beats .table.zebra's
   nth-child striping, which would otherwise tint half the headings a different shade and make
   them read as ordinary rows. */
.table tbody tr td.group-head {
    background: var(--panel-2, rgba(255, 255, 255, .05)) !important;
    color: var(--ink-dim);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding-top: 14px;
    padding-bottom: 8px;
}

/* ============================================================
   Switch — a real on/off control for a setting that changes what
   an action DOES, rather than a checkbox that reads as one item
   in a list. Used by the imports' "Override existing".

   Built on a real <input type="checkbox">, visually hidden rather
   than display:none, so it keeps keyboard focus, the label click
   target, and the posted form value.
   ============================================================ */
.switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.switch > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  transition: background .16s ease, border-color .16s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-muted);
  transition: transform .16s ease, background .16s ease;
}

.switch > input:checked + .switch-track {
  background: var(--green-soft);
  border-color: rgba(35,196,138,.5);
}

.switch > input:checked + .switch-track::after {
  transform: translateX(18px);
  background: var(--green);
}

/* Keyboard users get the focus ring the hidden input would have shown. */
.switch > input:focus-visible + .switch-track {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.switch > input:disabled + .switch-track { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .switch-track, .switch-track::after { transition: none; }
}

/* ============================================================
   Checkbox — one item either chosen or not, where .switch above
   would overstate it: a switch says "this changes what the button
   is about to do", a checkbox says "count me in". Used by the
   login page's "Remember me".

   Same construction as .switch — a real <input type="checkbox">
   kept in the page and merely hidden from view, so the label
   click target, keyboard focus and posted form value all survive.
   The tick is drawn in CSS (two borders on a rotated box) rather
   than a background image, so it inherits colour and needs no
   asset request on the one page a signed-out visitor ever sees.
   ============================================================ */
/* Qualified with .field for the same reason .field .multiselect-option is: this
   is a <label>, and .field label (0-1-1) sets uppercase + letter-spacing at a
   higher specificity than a lone class (0-1-0) could undo. "REMEMBER ME" in
   caps reads as a field heading, not as the thing you tick. */
.field .checkbox,
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-muted);
}

.checkbox > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.checkbox-box {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  transition: background .16s ease, border-color .16s ease;
}

/* The tick: the bottom-left corner of a box, rotated 45deg so the two
   remaining borders read as a check. Scaled from nothing so it grows in
   rather than appearing, and nudged up a pixel because a rotated glyph
   sits visually low in its box. */
.checkbox-box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 4px;
  height: 8px;
  border: solid #06281C;
  border-width: 0 2px 2px 0;
  border-radius: 1px;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform .16s ease;
}

.checkbox:hover .checkbox-box { border-color: var(--ink-dim); }

/* + is safe here even though asp-for on a bool also emits a hidden "false" input
   (what the form posts when the box is unchecked): ASP.NET Core's default
   CheckBoxHiddenInputRenderMode is EndOfForm, so that input lands just before
   </form>, not next to the checkbox. Anything that switched it to Inline would
   break the tick without breaking the markup — swap these to ~ if that happens. */
.checkbox > input:checked + .checkbox-box {
  background: var(--green);
  border-color: var(--green);
}

.checkbox > input:checked + .checkbox-box::after { transform: rotate(45deg) scale(1); }

/* Keyboard users get the focus ring the hidden input would have shown. */
.checkbox > input:focus-visible + .checkbox-box {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* The box and the label text both dim; ~ * covers the box too, so it needs no rule of its own. */
.checkbox > input:disabled ~ * { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .checkbox-box, .checkbox-box::after { transition: none; }
}

/* ============================================================
   Busy spinner — shown on a button that has started something
   slow, so nobody presses it twice. Lives here rather than in a
   partial because two different mechanisms use it now: the
   import forms (_BusyForm) and every delete confirmation
   (_ConfirmDialog), and a style defined inside one partial is
   simply absent on pages that do not include it.
   ============================================================ */
@keyframes campaignos-spin { to { transform: rotate(360deg); } }

.busy-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: campaignos-spin .7s linear infinite;
}

/* Honours a viewer who has asked for less motion: still clearly busy, just not spinning. */
@media (prefers-reduced-motion: reduce) {
  .busy-spinner { animation: none; opacity: .6; }
}
