/* UKRF Intelligence: application stylesheet (v9, 13 Oct 2026; v6 added linked numbers and the people list page, v7 dark mode and the design review fixes, v8 the Users page, v9 the new brand direction)
   Brand: January 2026 toolkit. Enlightenment Berry, Gentle Rose, Connected Magenta, Grounded Teal; Lato (self-hosted, Arial fallback).

   Deliberately a NEW file (not a replacement for style.css) so the older
   pages keep working if a release ever has to be rolled back. Bump
   UKRF_ASSET_VERSION in lib/layout.php whenever this file changes, because
   Hostinger's CDN caches stylesheets hard.

   Structure:
   1. Design tokens (colours, spacing, radius, shadow). Change the look of
      the whole app here.
   2. Base
   3. App shell (header, sidebar, main)
   4. Components (cards, KPIs, tables, bars, pills, lists)
   5. Responsive
   6. Print
   7. v7: interaction, accessibility preferences, mobile cards
   8. v8: Users page
   9. v9: brand layer (fonts, image headers, sign-in page, chart styles)

   DARK MODE: every colour in this file comes from the tokens in section 1,
   so dark mode is just a second set of token values (the two dark blocks at
   the end of section 1). Never write a raw colour into a rule below; add a
   token instead, in the light block AND both dark blocks. The dark palette is
   the UKRF plum brand pack taken into deep aubergine, not a grey: surfaces
   are dark plum, headings a pale blush, and the primary button stays brand
   plum with white text. The logo sits on a white plate in dark mode so it is
   never recoloured.
*/

/* ---------- 0. Lato, self-hosted (SIL Open Font License, see fonts/LATO-OFL-LICENSE.txt) ---------- */
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/lato-latin-400.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/assets/fonts/lato-latin-ext-400.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/assets/fonts/lato-latin-700.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/assets/fonts/lato-latin-ext-700.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- 1. Tokens ---------- */
:root {
  --plum: #6E4363;
  --plum-dark: #4E2F47;
  --plum-deep: #3A2236;
  --plum-light: #9B6A8C;
  --plum-tint: #F3EAF0;
  --plum-wash: #FAF6F9;

  --ink: #2B2230;
  --ink-soft: #4A3F4F;
  --muted: #6F636C;
  --line: #E8DFE5;
  --line-strong: #D8CAD3;
  --bg: #F6F3F5;
  --white: #FFFFFF;

  --ok: #2A7048;
  --ok-bg: #E4F1E9;
  --warn: #8F5A08;
  --warn-bg: #FBF0DB;
  --danger: #9A1D6A;
  --danger-bg: #F8E4EF;
  --info: #3F5F8F;
  --info-bg: #E5ECF6;

  --ok-line: #BFE0CC;
  --warn-line: #E9D3A8;
  --danger-line: #EBBDD6;
  --info-line: #C8D6EC;
  --ok-line-2: #C6E2D1;
  --warn-line-2: #EBD7AF;
  --warn-ink: #6E4C0E;
  --info-ink: #2F4A73;

  --btn-bg: #6E4363;
  --btn-bg-hover: #4E2F47;
  --btn-fg: #FFFFFF;
  --header-bg: rgba(255, 255, 255, 0.88);
  --header-rule: #6E4363;
  --logo-plate: transparent;
  --logo-pad: 0px;
  --scrim: rgba(43, 34, 48, 0.4);
  color-scheme: light;

  /* v9 brand tokens (January 2026 toolkit) */
  --rose: #C19FA0;
  --rose-tint: #F6EEEE;
  --magenta: #9A1D6A;
  --teal: #48A09E;
  --teal-ink: #17413F;
  --teal-text: #17413F;
  --teal-bg: #E2F1F0;
  --chart-base: #6E4363;
  --chart-join: #48A09E;
  --chart-lapse: #9A1D6A;
  --chart-track: #F1E8EE;
  --hero-panel: rgba(255, 255, 255, 0.88);
  --hero-veil: none;
  --hero-ink: #4E2F47;
  --art-panel: rgba(110, 67, 99, 0.94);
  --login-card: #FFFFFF;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(43, 34, 48, 0.06), 0 2px 8px rgba(43, 34, 48, 0.04);
  --shadow-hover: 0 2px 4px rgba(43, 34, 48, 0.08), 0 8px 20px rgba(43, 34, 48, 0.08);

  --sidebar-w: 248px;
  --header-h: 64px;
}

/* Dark theme, chosen two ways that give the same result:
   1. the person picked Dark with the header toggle (data-theme="dark"), or
   2. they left it on Auto and their device is set to dark. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --plum: #D3A9C7;
  --plum-dark: #EBD6E6;
  --plum-deep: #F5E8F2;
  --plum-light: #A877A0;
  --plum-tint: #3A2A43;
  --plum-wash: #2A1F32;

  --ink: #F2EAF1;
  --ink-soft: #D9CCD7;
  --muted: #AE9FAB;
  --line: #3B2D44;
  --line-strong: #503E5A;
  --bg: #17101C;
  --white: #221829;

  --ok: #7FD1A0;
  --ok-bg: #17382A;
  --warn: #F2BE6B;
  --warn-bg: #3D2D10;
  --danger: #F29AC6;
  --danger-bg: #4A1D3A;
  --info: #9DBCEB;
  --info-bg: #1E2E4A;
  --ok-line: #2B5F44;
  --warn-line: #6B5121;
  --danger-line: #7C2F63;
  --info-line: #35507D;
  --ok-line-2: #2B5F44;
  --warn-line-2: #6B5121;
  --warn-ink: #F0D9A6;
  --info-ink: #BFD3F3;

  --btn-bg: #8E5C83;
  --btn-bg-hover: #A06B94;
  --btn-fg: #FFFFFF;
  --header-bg: rgba(34, 24, 41, 0.86);
  --header-rule: #8E5C83;
  --logo-plate: #FFFFFF;
  --logo-pad: 4px;
  --scrim: rgba(0, 0, 0, 0.6);
  /* v9 brand tokens, dark */
  --rose: #C19FA0;
  --rose-tint: #2F2236;
  --magenta: #E58BC0;
  --teal: #6CC3C0;
  --teal-ink: #0F2E2D;
--teal-text: #6CC3C0;
  --teal-bg: #1B3A3A;
  --chart-base: #D3A9C7;
  --chart-join: #5DB8B5;
  --chart-lapse: #E27FB8;
  --chart-track: #33253C;
  --hero-panel: rgba(34, 24, 41, 0.86);
  --hero-veil: linear-gradient(rgba(23, 16, 28, 0.58), rgba(23, 16, 28, 0.58));
  --hero-ink: #F5E8F2;
  --art-panel: rgba(58, 34, 54, 0.92);
  --login-card: #221829;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --plum: #D3A9C7;
    --plum-dark: #EBD6E6;
    --plum-deep: #F5E8F2;
    --plum-light: #A877A0;
    --plum-tint: #3A2A43;
    --plum-wash: #2A1F32;

    --ink: #F2EAF1;
    --ink-soft: #D9CCD7;
    --muted: #AE9FAB;
    --line: #3B2D44;
    --line-strong: #503E5A;
    --bg: #17101C;
    --white: #221829;

    --ok: #7FD1A0;
    --ok-bg: #17382A;
    --warn: #F2BE6B;
    --warn-bg: #3D2D10;
    --danger: #F29AC6;
    --danger-bg: #4A1D3A;
    --info: #9DBCEB;
    --info-bg: #1E2E4A;
    --ok-line: #2B5F44;
    --warn-line: #6B5121;
    --danger-line: #7C2F63;
    --info-line: #35507D;
    --ok-line-2: #2B5F44;
    --warn-line-2: #6B5121;
    --warn-ink: #F0D9A6;
    --info-ink: #BFD3F3;

    --btn-bg: #8E5C83;
    --btn-bg-hover: #A06B94;
    --btn-fg: #FFFFFF;
    --header-bg: rgba(34, 24, 41, 0.86);
    --header-rule: #8E5C83;
    --logo-plate: #FFFFFF;
    --logo-pad: 4px;
    --scrim: rgba(0, 0, 0, 0.6);
    /* v9 brand tokens, dark */
    --rose: #C19FA0;
    --rose-tint: #2F2236;
    --magenta: #E58BC0;
    --teal: #6CC3C0;
    --teal-ink: #0F2E2D;
--teal-text: #6CC3C0;
    --teal-bg: #1B3A3A;
    --chart-base: #D3A9C7;
    --chart-join: #5DB8B5;
    --chart-lapse: #E27FB8;
    --chart-track: #33253C;
    --hero-panel: rgba(34, 24, 41, 0.86);
    --hero-veil: linear-gradient(rgba(23, 16, 28, 0.58), rgba(23, 16, 28, 0.58));
    --hero-ink: #F5E8F2;
    --art-panel: rgba(58, 34, 54, 0.92);
    --login-card: #221829;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.35);
  }
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Lato, Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--plum); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--plum);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 10px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.up { color: var(--ok); }
.down { color: var(--danger); }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--btn-bg); color: var(--btn-fg);
  padding: 8px 14px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- 3. App shell ---------- */
.ukrf-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 3px solid var(--header-rule);
}

.ukrf-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ukrf-brand img { height: 38px; display: block; background: var(--logo-plate); padding: var(--logo-pad); border-radius: 8px; box-sizing: content-box; }
.ukrf-brand-title { font-size: 18px; font-weight: bold; color: var(--plum-dark); line-height: 1.15; white-space: nowrap; }
.ukrf-brand-title span {
  display: block; font-size: 11px; font-weight: normal; color: var(--muted);
  letter-spacing: 0.7px; text-transform: uppercase;
}

.ukrf-header-right { display: flex; align-items: center; gap: 14px; }

.ukrf-sync {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-soft);
  background: var(--plum-wash); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; white-space: nowrap;
}
.ukrf-sync:hover { text-decoration: none; border-color: var(--plum-light); }
.ukrf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.ukrf-dot.stale { background: var(--warn); }
.ukrf-dot.none { background: var(--muted); }

.ukrf-user { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.25; }
.ukrf-user strong { color: var(--ink); display: block; }
.ukrf-signout { font-weight: bold; }

.ukrf-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.ukrf-sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 18px 12px 24px;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.ukrf-nav-group-label {
  font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); padding: 14px 12px 6px;
}
.ukrf-nav-group-label:first-child { padding-top: 0; }

.ukrf-nav, .ukrf-subnav { list-style: none; margin: 0; padding: 0; }

.ukrf-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: 14px;
}
.ukrf-nav-link:hover { background: var(--plum-wash); text-decoration: none; }
.ukrf-nav-link svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ukrf-nav-link .ukrf-nav-text { flex: 1; min-width: 0; }
.ukrf-nav-link.is-active { background: var(--plum-tint); color: var(--plum-dark); font-weight: bold; }
.ukrf-nav-link .ext { width: 12px; height: 12px; opacity: 0.55; }

.ukrf-subnav { margin: 2px 0 6px 20px; border-left: 2px solid var(--line); padding-left: 8px; }
.ukrf-subnav .ukrf-nav-link { padding: 7px 10px; font-size: 13px; }

.ukrf-nav-badge {
  font-size: 11px; font-weight: bold; min-width: 22px; text-align: center;
  padding: 1px 7px; border-radius: 999px;
  background: var(--danger-bg); color: var(--danger);
}
.ukrf-nav-badge.warn { background: var(--warn-bg); color: var(--warn); }

.ukrf-main { padding: 28px 32px 48px; min-width: 0; max-width: 1240px; }

.ukrf-breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ukrf-breadcrumb a { color: var(--muted); }

.ukrf-page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.ukrf-page-title { font-size: 26px; color: var(--plum-dark); letter-spacing: -0.02em; line-height: 1.15; }
.ukrf-page-intro { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.ukrf-page-actions { display: flex; gap: 8px; align-items: center; }

.ukrf-footer {
  margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}

/* ---------- 4. Components ---------- */
.ukrf-btn {
  display: inline-block; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-fg);
  font-weight: bold; font-size: 13px; cursor: pointer;
}
.ukrf-btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); text-decoration: none; }
.ukrf-btn.ghost { background: var(--white); color: var(--plum); border-color: var(--line-strong); }
.ukrf-btn.ghost:hover { background: var(--plum-wash); border-color: var(--plum-light); }

/* Grid helpers */
.ukrf-grid { display: grid; gap: 20px; margin-bottom: 20px; align-items: stretch; }
.ukrf-grid > .ukrf-card { display: flex; flex-direction: column; }
.ukrf-grid > .ukrf-card > .ukrf-card-body { flex: 1; }
.ukrf-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ukrf-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ukrf-grid .span-all { grid-column: 1 / -1; }

/* Cards */
.ukrf-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.ukrf-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--plum-wash);
}
.ukrf-card-header h2 { font-size: 15px; color: var(--plum-dark); }
.ukrf-card-body { padding: 18px; }
.ukrf-card-foot { padding: 11px 18px; border-top: 1px solid var(--line); background: var(--plum-wash); font-size: 13px; }

.ukrf-badge {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.ukrf-badge-live { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.ukrf-badge-stale { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }

/* Area tile: the whole tile opens the report (the "Open report" link is
   stretched over it), while the big number and each line sit above that
   and open the people behind them. */
.ukrf-tile {
  position: relative; display: block; color: inherit; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; transition: box-shadow 0.15s, transform 0.15s;
}
.ukrf-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.ukrf-tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ukrf-tile h3 { font-size: 14px; color: var(--plum-dark); }
.ukrf-tile-value { font-size: 30px; font-weight: bold; color: var(--plum-dark); line-height: 1.1; margin: 8px 0 2px; }
a.ukrf-tile-vlink { position: relative; z-index: 2; display: inline-block; color: var(--plum-dark); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
a.ukrf-tile-vlink:hover { color: var(--plum); text-decoration-color: var(--plum); }
.ukrf-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
.ukrf-tile-lines { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 13px; }
.ukrf-tile-lines li { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-soft); }
.ukrf-tile-lines strong { color: var(--ink); }
a.ukrf-tile-line { position: relative; z-index: 2; display: flex; flex: 1 1 auto; justify-content: space-between; color: var(--ink-soft); border-radius: 4px; margin: 0 -4px; padding: 0 4px; }
a.ukrf-tile-line:hover { background: var(--plum-wash); color: var(--plum-dark); text-decoration: none; }
a.ukrf-tile-line:hover strong { color: var(--plum); text-decoration: underline; }
.ukrf-tile-go { display: block; margin-top: 12px; font-size: 13px; font-weight: bold; color: var(--plum); }
.ukrf-stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.ukrf-tile-go:hover { text-decoration: underline; }

/* Counts that open a people list */
a.ukrf-count-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a.ukrf-count-link:hover { color: var(--plum); text-decoration-color: var(--plum); }
a.ukrf-badge-link { text-decoration: none; }
a.ukrf-badge-link:hover { background: var(--plum-tint); color: var(--plum-dark); text-decoration: none; }
a.ukrf-mini { display: block; color: inherit; transition: box-shadow 0.15s; }
a.ukrf-mini:hover { text-decoration: none; box-shadow: var(--shadow-hover); }
a.ukrf-kpi:hover .ukrf-kpi-label { color: var(--plum); }

/* People list page */
.ukrf-list-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.ukrf-list-count strong { font-size: 28px; color: var(--plum-dark); margin-right: 6px; }
.ukrf-list-count span { color: var(--muted); font-size: 14px; }
.ukrf-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ukrf-search input[type="search"] {
  font: inherit; font-size: 14px; padding: 8px 12px; min-width: 240px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
}
.ukrf-search input[type="search"]:focus { outline: 2px solid var(--plum-light); outline-offset: 1px; }
a.ukrf-sort { color: inherit; text-decoration: none; }
a.ukrf-sort:hover { color: var(--plum); text-decoration: underline; }
a.ukrf-sort.is-active { color: var(--plum-dark); }
.ukrf-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
button.ukrf-btn { font-family: inherit; }

/* KPI strip */
.ukrf-kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
a.ukrf-kpi, div.ukrf-kpi {
  display: block; color: inherit; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  border-top: 3px solid var(--plum-light);
}
a.ukrf-kpi:hover { text-decoration: none; box-shadow: var(--shadow-hover); }
.ukrf-kpi.warn { border-top-color: var(--warn); }
.ukrf-kpi.bad { border-top-color: var(--danger); }
.ukrf-kpi.good { border-top-color: var(--ok); }
.ukrf-kpi-value { font-size: 28px; font-weight: bold; color: var(--plum-dark); line-height: 1.1; }
.ukrf-kpi.warn .ukrf-kpi-value { color: var(--warn); }
.ukrf-kpi.bad .ukrf-kpi-value { color: var(--danger); }
.ukrf-kpi.good .ukrf-kpi-value { color: var(--ok); }
.ukrf-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-top: 4px; }
.ukrf-kpi-note { font-size: 11px; margin-top: 6px; color: var(--muted); }

/* Needs attention */
.ukrf-attention { margin-bottom: 20px; }
.ukrf-attention-list { list-style: none; margin: 0; padding: 0; }
.ukrf-attention-list li { border-bottom: 1px solid var(--line); }
.ukrf-attention-list li:last-child { border-bottom: none; }
.ukrf-attention-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; color: inherit;
}
a.ukrf-attention-item:hover { background: var(--plum-wash); text-decoration: none; }
.ukrf-attention-count {
  min-width: 46px; text-align: center; font-weight: bold; font-size: 15px;
  padding: 4px 10px; border-radius: 999px;
}
.ukrf-attention-count.bad { background: var(--danger-bg); color: var(--danger); }
.ukrf-attention-count.warn { background: var(--warn-bg); color: var(--warn); }
.ukrf-attention-text { flex: 1; min-width: 0; }
.ukrf-attention-text strong { display: block; color: var(--ink); }
.ukrf-attention-text span { font-size: 12px; color: var(--muted); }
.ukrf-attention-go { flex: none; width: 8px; height: 8px; margin: 0 8px 0 4px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.18s ease, border-color 0.15s ease; }
a.ukrf-attention-item:hover .ukrf-attention-go { border-color: var(--plum); transform: translateX(3px) rotate(45deg); }
.ukrf-all-clear { padding: 18px; color: var(--ok); font-weight: bold; }

/* Tables */
table.ukrf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ukrf-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--muted); border-bottom: 1px solid var(--line-strong); padding: 7px 8px;
}
table.ukrf-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.ukrf-table tr:last-child td { border-bottom: none; }
table.ukrf-table th.num { text-align: right; }
.ukrf-table-wrap { overflow-x: auto; }

/* Bars */
.ukrf-bar { height: 8px; background: var(--plum-tint); border-radius: 4px; overflow: hidden; min-width: 60px; }
.ukrf-bar span { display: block; height: 100%; background: var(--plum); border-radius: 4px; }
.ukrf-bar.warn span { background: var(--warn); }
.ukrf-bar.bad span { background: var(--danger); }
.ukrf-bar.good span { background: var(--ok); }
.ukrf-bar-list { list-style: none; margin: 14px 0 0; padding: 0; }
.ukrf-bar-row { display: grid; grid-template-columns: 150px 1fr 56px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.ukrf-bar-row.muted-row { color: var(--muted); }
.ukrf-bar-count { text-align: right; font-weight: bold; font-variant-numeric: tabular-nums; }

/* Pills and status */
.ukrf-pill, .ukrf-status {
  display: inline-block; font-size: 11px; font-weight: bold; padding: 2px 9px; border-radius: 999px;
}
.ukrf-pill.good, .ukrf-status-ok { background: var(--ok-bg); color: var(--ok); }
.ukrf-pill.warn, .ukrf-status-due { background: var(--warn-bg); color: var(--warn); }
.ukrf-pill.bad, .ukrf-status-overdue { background: var(--danger-bg); color: var(--danger); }
.ukrf-pill.info { background: var(--info-bg); color: var(--info); }
.ukrf-pill.plain { background: var(--plum-tint); color: var(--plum-dark); }

/* Headline stat with sparkline */
.ukrf-stat-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ukrf-stat-hero-value { font-size: 40px; font-weight: bold; color: var(--plum-dark); line-height: 1; }
.ukrf-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin: 4px 0 6px; }
.ukrf-stat-hero-spark { width: 140px; flex: none; }
.ukrf-sparkline { width: 100%; height: 36px; display: block; }
.ukrf-spark-area { fill: var(--plum-tint); stroke: none; }
.ukrf-spark-line { stroke: var(--plum); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ukrf-trend { font-size: 12px; }
.ukrf-trend-up { color: var(--ok); }
.ukrf-trend-down { color: var(--danger); }
.ukrf-trend-flat { color: var(--muted); }
.ukrf-trendrow { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 12px; }
.ukrf-trendrow .ukrf-sparkline { width: 110px; height: 28px; }

/* Simple label/value list (backlog, queues) */
.ukrf-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ukrf-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ukrf-list li:last-child { border-bottom: none; }
.ukrf-count {
  background: var(--btn-bg); color: var(--btn-fg); font-weight: bold; font-size: 12px;
  min-width: 28px; text-align: center; border-radius: 999px; padding: 2px 9px;
}
.ukrf-count.sample { background: var(--plum-tint); color: var(--plum-dark); }

/* Section headings inside cards */
.ukrf-h3 {
  margin: 20px 0 8px; font-size: 12px; color: var(--plum-dark);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.ukrf-h3:first-child { margin-top: 0; }

.ukrf-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }
.ukrf-banner {
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 13px;
}
.ukrf-banner.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }

details.ukrf-details { margin-top: 14px; }
details.ukrf-details > summary { cursor: pointer; color: var(--plum); font-size: 13px; font-weight: bold; }
details.ukrf-details > *:not(summary) { margin-top: 10px; }

/* Small mini-stat tiles inside a card */
.ukrf-mini-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ukrf-mini { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--plum-wash); border: 1px solid var(--line); }
.ukrf-mini-value { font-size: 22px; font-weight: bold; color: var(--plum-dark); line-height: 1.1; }
.ukrf-mini-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 3px; }
.ukrf-mini.warn { background: var(--warn-bg); border-color: var(--warn-line-2); }
.ukrf-mini.warn .ukrf-mini-value { color: var(--warn); }
.ukrf-mini.bad { background: var(--danger-bg); border-color: var(--danger-line); }
.ukrf-mini.bad .ukrf-mini-value { color: var(--danger); }
.ukrf-mini.good { background: var(--ok-bg); border-color: var(--ok-line-2); }
.ukrf-mini.good .ukrf-mini-value { color: var(--ok); }

/* ---------- 5. Responsive ---------- */
@media (max-width: 1100px) {
  .ukrf-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .ukrf-header { padding: 0 14px; height: 56px; }
  .ukrf-user .ukrf-user-email, .ukrf-user strong { display: none; }
  .ukrf-brand img { height: 32px; }
  .ukrf-brand-title { font-size: 15px; }
  .ukrf-brand-title span { display: none; }
  .ukrf-header-right { gap: 10px; }
  .ukrf-sync { padding: 6px 9px; }
  .ukrf-sync > span:last-child { display: none; }
  .ukrf-nav-group.is-shortcuts { display: none; }
  .ukrf-shell { display: block; }
  .ukrf-sidebar {
    position: static; height: auto; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--line); padding: 8px 10px;
  }
  .ukrf-nav-group-label { display: none; }
  .ukrf-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .ukrf-nav > li { flex: none; }
  .ukrf-nav-group { display: contents; }
  .ukrf-subnav { display: none; }
  .ukrf-nav-link { white-space: nowrap; padding: 8px 12px; }
  .ukrf-main { padding: 18px 14px 36px; }
  .ukrf-page-title { font-size: 22px; }
  .ukrf-grid.cols-2, .ukrf-grid.cols-3 { grid-template-columns: 1fr; }
  .ukrf-bar-row { grid-template-columns: 110px 1fr 44px; }
  .ukrf-stat-hero-spark { width: 100px; }
}

/* Mobile sub navigation: shown as a second row of pills on report pages */
.ukrf-mobile-sub { display: none; }
@media (max-width: 900px) {
  .ukrf-mobile-sub { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; background: var(--white); border-bottom: 1px solid var(--line); }
  .ukrf-mobile-sub a {
    flex: none; font-size: 13px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--ink-soft); background: var(--white);
  }
  .ukrf-mobile-sub a.is-active { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
  .ukrf-mobile-sub a:hover { text-decoration: none; }
}

/* ---------- 6. Print ---------- */
@media print {
  .ukrf-header, .ukrf-sidebar, .ukrf-mobile-sub, .ukrf-page-actions, .ukrf-footer .no-print { display: none !important; }
  .ukrf-shell { display: block; }
  html, body { background: #fff; font-size: 12px; }
  .ukrf-main { padding: 0; max-width: none; }
  .ukrf-card, .ukrf-tile, .ukrf-kpi { box-shadow: none; break-inside: avoid; }
  .ukrf-grid.cols-2, .ukrf-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  :root:root {
    --bg: #fff; --white: #fff; --ink: #2B2230; --ink-soft: #4A3F4F; --muted: #6A5E67;
    --line: #E8DFE5; --line-strong: #D8CAD3; --plum: #6D4263; --plum-dark: #4E2F47;
    --plum-tint: #F3EAF0; --plum-wash: #FAF6F9; --ok: #2F7A4F; --ok-bg: #E4F1E9;
    --warn: #A86A0E; --warn-bg: #FBF0DB; --danger: #A3384A; --danger-bg: #F8E1E5;
    --info: #3F5F8F; --info-bg: #E5ECF6; --btn-bg: #6D4263; --btn-fg: #fff;
    --shadow: none; --shadow-hover: none;
  }
  .ukrf-theme-btn { display: none !important; }
  details.ukrf-details > summary { display: none; }
  details.ukrf-details > *:not(summary) { display: block; }
}

/* Rebuild panel on the Reports summary */
.ukrf-rebuild { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; margin-top: 4px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 13px; color: var(--ink-soft); }
.ukrf-rebuild form { margin: 0; }

/* ---------- 7. v7: feel, accessibility preferences, mobile ---------- */
.ukrf-kpi-value, .ukrf-tile-value, .ukrf-stat-hero-value, .ukrf-mini-value { letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Response: press feedback is instant (80ms in), release springs back. */
.ukrf-btn, a.ukrf-kpi, .ukrf-tile, a.ukrf-mini, .ukrf-nav-link, .ukrf-mobile-sub a, a.ukrf-attention-item, .ukrf-theme-btn {
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ukrf-btn:active, .ukrf-theme-btn:active { transform: scale(0.96); transition-duration: 80ms; }
a.ukrf-kpi:active, a.ukrf-mini:active { transform: scale(0.98); transition-duration: 80ms; }
.ukrf-tile:active { transform: scale(0.99); transition-duration: 80ms; }

/* Affordance: a linked KPI shows a small chevron, so it is clear it opens something. */
a.ukrf-kpi { position: relative; }
a.ukrf-kpi::after {
  content: ""; position: absolute; top: 16px; right: 14px; width: 7px; height: 7px;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
  transform: rotate(45deg); opacity: 0.45; transition: transform 0.18s ease, opacity 0.15s ease, border-color 0.15s ease;
}
a.ukrf-kpi:hover::after { opacity: 1; border-color: var(--plum); transform: translateX(2px) rotate(45deg); }
a.ukrf-kpi:hover { border-color: var(--line-strong); }
.ukrf-kpi-note:empty { display: none; }

/* Rows: highlight the row under the pointer so it is easy to follow across a wide table. */
table.ukrf-table tbody tr:hover td { background: var(--plum-wash); }
.ukrf-card-body.ukrf-table-wrap table.ukrf-table td:first-child, .ukrf-card-body.ukrf-table-wrap table.ukrf-table th:first-child { padding-left: 4px; }

/* Collapsible dictionary and similar technical blocks */
details.ukrf-fold { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
details.ukrf-fold > summary { cursor: pointer; padding: 14px 18px; font-weight: bold; color: var(--plum-dark); font-size: 15px; list-style-position: inside; }
details.ukrf-fold[open] > summary { border-bottom: 1px solid var(--line); background: var(--plum-wash); border-radius: var(--radius) var(--radius) 0 0; }
details.ukrf-fold > .ukrf-fold-body { padding: 18px; }

/* Data health check rows */
.ukrf-check { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ukrf-check:last-child { border-bottom: none; }
.ukrf-check-text { min-width: 0; }
.ukrf-check-text strong { display: block; color: var(--ink); font-size: 14px; }
.ukrf-check-text span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); max-width: 70ch; }
a.ukrf-check { color: inherit; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: var(--radius-sm); }
a.ukrf-check:hover { background: var(--plum-wash); text-decoration: none; }
.ukrf-check-go { display: flex; align-items: center; gap: 10px; flex: none; }
.ukrf-check-go i { width: 8px; height: 8px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); }
a.ukrf-check:hover .ukrf-check-go i { border-color: var(--plum); }

/* Theme toggle (header) */
.ukrf-theme-btn {
  width: 36px; height: 36px; border-radius: 50%; padding: 0; cursor: pointer;
  display: inline-grid; place-items: center; font-family: inherit;
  border: 1px solid var(--line); background: var(--plum-wash); color: var(--ink-soft);
}
.ukrf-theme-btn:hover { border-color: var(--plum-light); color: var(--plum); }
.ukrf-theme-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ukrf-theme-btn .ic { display: none; }
html[data-theme="light"] .ukrf-theme-btn .ic-light { display: block; }
html[data-theme="dark"] .ukrf-theme-btn .ic-dark { display: block; }
html:not([data-theme="light"]):not([data-theme="dark"]) .ukrf-theme-btn .ic-auto { display: block; }
.ukrf-signout { white-space: nowrap; }

/* Smooth theme change (not on first paint) */
html.ukrf-theme-anim, html.ukrf-theme-anim * { transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important; }

/* Mobile sort control for lists (headings are hidden on small screens) */
.ukrf-sort-mobile { display: none; }

/* Mobile: tap targets of at least 44px, lists as cards */
@media (max-width: 900px) {
  .ukrf-nav-link, .ukrf-mobile-sub a { min-height: 44px; display: inline-flex; align-items: center; }
  .ukrf-nav-link { display: flex; }
  .ukrf-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .ukrf-theme-btn { width: 44px; height: 44px; }
  .ukrf-signout { display: inline-block; padding: 12px 4px; }
  .ukrf-search { width: 100%; }
  .ukrf-search input[type="search"] { flex: 1; min-width: 0; min-height: 44px; font-size: 16px; }
}
@media (max-width: 640px) {
  table.ukrf-table-cards thead { position: absolute; left: -9999px; }
  table.ukrf-table-cards, table.ukrf-table-cards tbody, table.ukrf-table-cards tr, table.ukrf-table-cards td { display: block; width: 100%; }
  table.ukrf-table-cards tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.ukrf-table-cards tr:last-child { border-bottom: none; }
  table.ukrf-table-cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; border: none; padding: 3px 0; text-align: right; white-space: normal; }
  table.ukrf-table-cards td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; text-align: left; }
  table.ukrf-table-cards td:first-child { display: block; text-align: left; font-size: 15px; font-weight: bold; padding-bottom: 4px; }
  table.ukrf-table-cards td:first-child::before { display: none; }
  table.ukrf-table-cards tbody tr:hover td { background: transparent; }
  .ukrf-sort-mobile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
  .ukrf-sort-mobile label { flex-basis: 100%; }
  .ukrf-sort-mobile select { flex: 1 1 130px; min-width: 0; }
  .ukrf-sort-mobile select { font: inherit; font-size: 16px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--white); color: var(--ink); }
}

/* Reduced motion: no slides, springs or travel; keep colour changes. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .ukrf-tile:hover, a.ukrf-kpi:hover, .ukrf-btn:active, a.ukrf-kpi:active, .ukrf-tile:active, a.ukrf-mini:active { transform: none; }
}
/* Reduced transparency: a solid header instead of frosted glass. */
@media (prefers-reduced-transparency: reduce) {
  .ukrf-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--white); }
}
/* Increased contrast: stronger edges. */
@media (prefers-contrast: more) {
  .ukrf-card, a.ukrf-kpi, div.ukrf-kpi, .ukrf-tile, .ukrf-mini, .ukrf-rebuild, details.ukrf-fold { border-color: var(--ink-soft); }
  table.ukrf-table td { border-bottom-color: var(--line-strong); }
  .ukrf-muted, .muted { color: var(--ink-soft); }
}

@media (max-width: 900px) {
  .ukrf-brand { flex: 1 1 auto; }
  .ukrf-brand-title { overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
  .ukrf-header-right { flex: none; }
}
@media (max-width: 480px) {
  .ukrf-brand-title { display: none; }
}

/* ---------- 8. Users and access (v8) ---------- */
.ukrf-user-role { display: inline-block; margin-top: 2px; font-size: 11px; letter-spacing: 0.02em; color: var(--plum-dark); background: var(--plum-wash); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

.ukrf-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ukrf-field > span { font-size: 12px; color: var(--muted); }
.ukrf-field input[type="text"], .ukrf-field input[type="email"], .ukrf-field input[type="date"], .ukrf-field input[type="search"], .ukrf-field select, .ukrf-input {
  font: inherit; font-size: 14px; min-height: 38px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--white); color: var(--ink); max-width: 100%;
}
.ukrf-field input:focus, .ukrf-field select:focus, .ukrf-input:focus { outline: 2px solid var(--plum-light); outline-offset: 1px; }
.ukrf-form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ukrf-form-row .ukrf-field { flex: 1 1 180px; }

.ukrf-people { list-style: none; margin: 0; padding: 0; }
.ukrf-person { border-top: 1px solid var(--line); }
.ukrf-person:first-child { border-top: none; }
.ukrf-person > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 20px;
  gap: 12px; align-items: center; padding: 12px 16px; min-height: 52px;
}
.ukrf-person > summary::-webkit-details-marker { display: none; }
.ukrf-person > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; justify-self: end; }
.ukrf-person[open] > summary::after { transform: rotate(-135deg); }
.ukrf-person > summary:hover { background: var(--plum-wash); }
.ukrf-person-name { font-weight: bold; color: var(--ink); overflow-wrap: anywhere; }
.ukrf-person-name small { display: block; font-weight: normal; font-size: 12px; color: var(--muted); }
.ukrf-person-meta { font-size: 13px; color: var(--muted); }
.ukrf-person.is-left .ukrf-person-name { color: var(--muted); }
.ukrf-person-body { padding: 4px 16px 18px; background: var(--plum-wash); }
.ukrf-area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.ukrf-area-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--white); min-height: 44px; cursor: pointer; }
.ukrf-area-opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--plum); flex: none; }
.ukrf-area-opt strong { display: block; font-size: 14px; }
.ukrf-area-opt span { display: block; font-size: 12px; color: var(--muted); }
.ukrf-area-opt.is-tweak { border-color: var(--plum-light); }
.ukrf-area-opt.is-locked { opacity: .6; cursor: not-allowed; }
.ukrf-actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ukrf-btn.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.ukrf-btn.danger:hover { background: var(--danger-bg); filter: brightness(0.96); }
.ukrf-flash { margin-bottom: 18px; }

.ukrf-addlist { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.ukrf-addlist li { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); }
.ukrf-addlist li:first-child { border-top: none; }
.ukrf-addlist form { display: flex; gap: 8px; align-items: center; }
.ukrf-addlist select { font: inherit; font-size: 13px; min-height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--white); color: var(--ink); padding: 0 8px; }
.ukrf-log { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; max-height: 320px; overflow: auto; color: var(--ink-soft); }
table.ukrf-matrix td, table.ukrf-matrix th { text-align: center; }
table.ukrf-matrix td:first-child, table.ukrf-matrix th:first-child { text-align: left; }
.ukrf-tick { color: var(--ok); font-weight: bold; }
.ukrf-dash { color: var(--muted); }

@media (max-width: 760px) {
  .ukrf-person > summary { grid-template-columns: minmax(0, 1fr) 20px; }
  .ukrf-person > summary .ukrf-person-meta:nth-of-type(n+1) { grid-column: 1; }
  .ukrf-person > summary::after { grid-column: 2; grid-row: 1; }
  .ukrf-field input, .ukrf-field select { font-size: 16px; min-height: 44px; }
  .ukrf-area-opt { min-height: 52px; }
}

/* ==========================================================================
   9. v9: brand layer (13 Oct 2026)
   Everything below uses the tokens in section 1, so dark mode needs no extra
   work. Imagery lives in /assets/img/ and is decoration only: titles are
   always live text, and no picture sits behind a chart or a table.
   ========================================================================== */

/* Type: Lato, tighter at display sizes and slightly open at small sizes (Apple type guidance) */
h1, h2, h3 { font-weight: 700; }
.ukrf-page-title { font-size: 28px; letter-spacing: -0.025em; line-height: 1.12; color: var(--hero-ink); }
.ukrf-card-header h2 { font-size: 15.5px; letter-spacing: -0.005em; }
.ukrf-kpi-label, .ukrf-tile-label, .ukrf-badge, .ukrf-nav-group-label { letter-spacing: 0.06em; }
table.ukrf-table { font-size: 13.5px; }
button, input, select, textarea { font-family: inherit; }
.ukrf-user-role { letter-spacing: 0.04em; }

/* Softer, rounder cards and a rose edge on KPIs */
.ukrf-card, .ukrf-tile, a.ukrf-kpi, div.ukrf-kpi { border-radius: var(--radius); }
a.ukrf-kpi, div.ukrf-kpi { border-top-color: var(--rose); }
.ukrf-kpi.warn { border-top-color: var(--warn); }
.ukrf-kpi.bad { border-top-color: var(--danger); }
.ukrf-kpi.good { border-top-color: var(--teal); }
.ukrf-kpi.good .ukrf-kpi-value { color: var(--teal-text); }
.ukrf-card-header, .ukrf-card-foot { background: var(--rose-tint); }

/* ---- Image header with a pebble title panel ---- */
.ukrf-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center;
  min-height: 176px; margin-bottom: 24px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background-color: var(--rose-tint);
  background-size: cover; background-position: right center; background-repeat: no-repeat;
  box-shadow: var(--shadow);
}
.ukrf-hero.is-overview { background-image: url(/assets/img/overview-header.webp); }
.ukrf-hero.is-report { background-image: url(/assets/img/report-header.webp); }
.ukrf-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-veil); }
.ukrf-hero-panel {
  position: relative; margin: 14px; padding: 22px 34px 22px 28px;
  max-width: min(64%, 660px);
  background: var(--hero-panel);
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  border-radius: 26px 72px 56px 26px / 26px 60px 44px 26px;
  box-shadow: 0 1px 2px rgba(43, 34, 48, 0.06), 0 8px 24px rgba(43, 34, 48, 0.08);
}
.ukrf-hero .ukrf-breadcrumb { margin-bottom: 4px; }
.ukrf-hero .ukrf-page-intro { margin-top: 6px; color: var(--ink-soft); }
.ukrf-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ukrf-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--plum); margin-bottom: 6px; }

/* ---- Sign-in page ---- */
.ukrf-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px; }
.ukrf-login {
  width: 100%; max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  min-height: 560px; border-radius: 24px; overflow: hidden;
  background: var(--login-card); border: 1px solid var(--line); box-shadow: 0 12px 44px rgba(78, 47, 71, 0.14);
}
.ukrf-login-art {
  position: relative; isolation: isolate; display: flex; align-items: flex-end; padding: 30px;
  background: var(--rose-tint) url(/assets/img/login-hero.webp) 64% center / cover no-repeat;
}
.ukrf-login-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-veil); }
.ukrf-login-pebble {
  max-width: 440px; padding: 28px 34px 30px; color: #FFFFFF; background: var(--art-panel);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 40px 64px 40px 28px / 36px 56px 40px 28px;
}
.ukrf-login-pebble .ukrf-eyebrow { color: #E9D6E3; }
.ukrf-login-pebble h2 { font-size: 30px; line-height: 1.12; letter-spacing: -0.02em; color: #FFFFFF; }
.ukrf-login-pebble p { margin: 12px 0 0; color: #F1E6EE; font-size: 15px; }
.ukrf-login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px 40px; }
.ukrf-login-panel img.ukrf-login-logo { width: 150px; height: auto; margin: 0 0 26px; display: block; background: var(--logo-plate); padding: var(--logo-pad); border-radius: 12px; box-sizing: content-box; align-self: flex-start; }
.ukrf-login-panel h1 { font-size: 28px; letter-spacing: -0.025em; color: var(--plum-dark); }
.ukrf-login-sub { margin: 8px 0 26px; color: var(--muted); font-size: 15px; }
.ukrf-login-note { background: var(--rose-tint); border-left: 4px solid var(--plum); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 20px; font-size: 14px; line-height: 1.45; }
.ukrf-login-note strong { display: block; color: var(--plum-dark); margin-bottom: 2px; }
.ukrf-ms-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; align-self: stretch;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; font-size: 15px;
  padding: 14px 20px; border-radius: 10px; text-decoration: none; transition: background 0.15s ease, transform 0.1s ease;
}
.ukrf-ms-btn:hover, .ukrf-ms-btn:focus-visible { background: var(--btn-bg-hover); text-decoration: none; }
.ukrf-ms-btn:active { transform: scale(0.98); }
.ukrf-ms-mark { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ukrf-ms-mark i { display: block; }
.ukrf-ms-mark i:nth-child(1) { background: #F25022; } .ukrf-ms-mark i:nth-child(2) { background: #7FBA00; }
.ukrf-ms-mark i:nth-child(3) { background: #00A4EF; } .ukrf-ms-mark i:nth-child(4) { background: #FFB900; }
.ukrf-login-fine { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Screen reader only text */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Charts ---- */
/* Ranked and common-scale bars: one zero baseline, direct number labels beside them */
.ukrf-bar { height: 10px; background: var(--chart-track); border-radius: 999px; }
.ukrf-bar span { background: var(--chart-base); border-radius: 999px; min-width: 2px; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.ukrf-bar.good span { background: var(--chart-join); }
.ukrf-bar.bad span { background: var(--chart-lapse); }

/* Time bands and stage counts: separate tiles, never stacked into one total */
.ukrf-horizon { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.ukrf-bucket {
  display: block; padding: 16px 16px 14px; color: inherit; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
a.ukrf-bucket { transition: box-shadow 0.15s ease, transform 0.15s ease; }
a.ukrf-bucket:hover { text-decoration: none; box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.ukrf-bucket small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ukrf-bucket strong { display: block; margin: 6px 0 4px; font-size: 32px; line-height: 1.05; letter-spacing: -0.02em; color: var(--plum-dark); font-variant-numeric: tabular-nums; }
.ukrf-bucket span { display: block; font-size: 12.5px; color: var(--ink-soft); }
.ukrf-bucket.is-overdue { background: var(--danger-bg); border-color: var(--danger-line); }
.ukrf-bucket.is-overdue strong { color: var(--danger); }
.ukrf-bucket.is-zero strong { color: var(--muted); }

/* Joined against lapsed: lapsed grows left, joined grows right, same scale */
.ukrf-diverge { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 180px; height: 22px; align-items: center; }
.ukrf-diverge .neg { display: flex; justify-content: flex-end; border-right: 2px solid var(--line-strong); height: 100%; align-items: center; }
.ukrf-diverge .pos { display: flex; justify-content: flex-start; height: 100%; align-items: center; }
.ukrf-diverge i { display: block; height: 12px; min-width: 2px; }
.ukrf-diverge .neg i { background: var(--chart-lapse); border-radius: 999px 0 0 999px; }
.ukrf-diverge .pos i { background: var(--chart-join); border-radius: 0 999px 999px 0; }
.ukrf-net-hero { display: flex; flex-wrap: wrap; gap: 28px; align-items: baseline; margin: 0 0 16px; }
.ukrf-net-hero div { min-width: 120px; }
.ukrf-net-hero strong { display: block; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ukrf-net-hero strong.up { color: var(--teal-text); }
.ukrf-net-hero strong.down { color: var(--danger); }
.ukrf-net-hero span { font-size: 12px; color: var(--muted); }
.ukrf-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.ukrf-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.ukrf-legend .l i { background: var(--chart-lapse); } .ukrf-legend .j i { background: var(--chart-join); }
.ukrf-queue-note { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); background: var(--rose-tint); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .ukrf-login { grid-template-columns: 1fr; min-height: 0; }
  .ukrf-login-art { min-height: 300px; padding: 18px; order: -1; }
  .ukrf-login-pebble { padding: 16px 22px 18px; max-width: 78%; border-radius: 28px 44px 28px 20px / 24px 40px 28px 20px; }
  .ukrf-login-pebble h2 { font-size: 22px; }
  .ukrf-login-pebble p { display: none; }
  .ukrf-login-panel { padding: 30px 24px 34px; }
}
@media (max-width: 760px) {
  .ukrf-hero { min-height: 140px; border-radius: var(--radius); background-position: 70% center; }
  .ukrf-hero-panel { max-width: calc(100% - 20px); margin: 10px; padding: 16px 20px; border-radius: 20px 48px 36px 20px / 20px 40px 30px 20px; }
  .ukrf-page-title { font-size: 24px; }
}

/* ---- Preferences and print ---- */
@media (prefers-reduced-transparency: reduce) {
  .ukrf-hero-panel, .ukrf-login-pebble { -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root { --hero-panel: #FFFFFF; --art-panel: #6E4363; }
}
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --hero-panel: #221829; --art-panel: #3A2236; }
}
@media (prefers-contrast: more) {
  .ukrf-hero-panel { background: var(--white); border: 1px solid var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .ukrf-bar span, a.ukrf-bucket, .ukrf-ms-btn { transition: none; }
}
@media print {
  .ukrf-hero { background: none !important; min-height: 0; border: none; box-shadow: none; }
  .ukrf-hero::before { display: none; }
  .ukrf-hero-panel { margin: 0 0 12px; padding: 0; background: none; box-shadow: none; max-width: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ukrf-hero-actions { display: none; }
}
