/* Branded staff dashboard. Clean and clinical, deliberately not the Django admin. */

:root {
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e2e6ea;
  --brand: #2b6cb0;
  --brand-dark: #244f82;
  --bg: #f4f6f8;
  --card: #ffffff;
  --good: #227a4b;
  --good-bg: #e3f5ea;
  --warn: #8a5a00;
  --warn-bg: #fdf1d6;
  --grey-bg: #eef1f4;
  --error: #b42318;
  --error-bg: #fde8e6;

  /* Comparison accents: green = improved, red = worse, blue = single value */
  --fill-good: #1d9e75;
  --fill-bad: #e0603a;
  --fill-neutral: #2b6cb0;

  --shadow-sm: 0 1px 2px rgba(16, 33, 52, 0.05);
  --shadow-md: 0 6px 18px rgba(16, 33, 52, 0.08);
  --shadow-lg: 0 14px 34px rgba(16, 33, 52, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(1200px 400px at 100% -10%, #eaf2fb 0%, rgba(234, 242, 251, 0) 60%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

/* Top bar */
.topbar { background: var(--brand); color: #fff; }
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand span { font-weight: 400; opacity: 0.85; }
.nav { display: flex; gap: 6px; flex: 1; }
.nav a {
  color: #eaf1f8; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 0.95rem;
}
.nav a:hover { background: rgba(255,255,255,0.12); }
.nav a.active { background: rgba(255,255,255,0.2); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.who { color: #eaf1f8; font-size: 0.9rem; }
.logout-form { margin: 0; }
.linkbtn { background: none; border: none; color: #fff; cursor: pointer; font-size: 0.9rem; text-decoration: underline; padding: 0; }

/* Layout */
.container { max-width: 1040px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
h2 { font-size: 1.15rem; margin: 0 0 14px; }
.muted { color: var(--muted); }
.crumb { margin: 0 0 8px; }
.crumb a { text-decoration: none; }

.cols { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 800px) { .cols { grid-template-columns: 320px 1fr; align-items: start; } }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); transition: transform 180ms ease, box-shadow 180ms ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-num {
  font-size: 2.1rem; font-weight: 700; line-height: 1.1;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--muted); font-size: 0.9rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }

/* Detail list */
.detail { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.detail dt { color: var(--muted); }
/* Long email addresses used to run past the edge of the narrow contact card. */
.detail dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.detail dd select { max-width: 100%; }

/* Archive and delete, kept at the foot of the patient page. */
.manage-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; margin-top: 20px; padding: 16px 20px; border: 1px solid var(--line);
  border-radius: 14px; background: #fbfcfd;
}
.manage-strip strong { display: block; color: var(--navy); font-size: 0.88rem; }
.manage-strip small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.74rem; }
.manage-actions { display: flex; align-items: center; gap: 10px; }
.manage-actions form { margin: 0; }
.btn.danger { color: var(--error); border-color: #e7b9b4; }
.btn.danger:hover { color: #fff; background: var(--error); border-color: var(--error); }
.assessments-empty {
  min-height: 150px; display: grid; place-content: center; justify-items: center; gap: 6px;
  padding: 26px; color: var(--muted); text-align: center;
}
.assessments-empty > span {
  width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 2px;
  border-radius: 50%; color: var(--brand); background: var(--brand-pale);
}
.assessments-empty svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.assessments-empty strong { color: var(--navy); font-size: 0.9rem; }
.assessments-empty small { font-size: 0.75rem; }

/* Passkeys */
.passkey-signin { margin-bottom: 6px; }
.passkey-signin .btn { display: flex; align-items: center; justify-content: center; gap: 9px; }
.passkey-signin svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.passkey-error { min-height: 15px; margin: 7px 0 0; color: var(--error); font-size: 0.76rem; font-weight: 650; }
.passkey-or { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; color: var(--muted); font-size: 0.74rem; }
.passkey-or::before, .passkey-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-note { margin-top: 12px; font-size: 0.76rem; }
.inline-form { margin: 0; }

/* Pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.pill.done { background: var(--good-bg); color: var(--good); }
.pill.open { background: var(--warn-bg); color: var(--warn); }
.pill.expired { background: var(--grey-bg); color: var(--muted); }
.pill.archived { background: var(--grey-bg); color: var(--muted); }

/* Reassessment status pill (colour + icon + text) */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; white-space: nowrap; line-height: 1.3;
}
.status-pill .status-ico { display: inline-flex; }
.status-pill svg { width: 14px; height: 14px; display: block; }
.tone-good { background: var(--good-bg); color: var(--good); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--error-bg); color: var(--error); }
.tone-neutral { background: #e6f0fa; color: var(--brand-dark); }
.tone-muted { background: var(--grey-bg); color: var(--muted); }

/* Larger status banner (patient page / report) */
.status-banner {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-left-width: 5px;
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.status-banner .status-ico svg { width: 26px; height: 26px; }
.status-banner.tone-good { border-left-color: var(--good); }
.status-banner.tone-warn { border-left-color: var(--warn); }
.status-banner.tone-bad { border-left-color: var(--error); }
.status-banner.tone-neutral { border-left-color: var(--brand); }
.status-banner.tone-muted { border-left-color: var(--muted); }
.status-banner .banner-label { font-weight: 700; font-size: 1.05rem; }
.status-banner .banner-sub { color: var(--muted); font-size: 0.88rem; }
.status-banner .banner-ico.tone-good { color: var(--good); }
.status-banner .banner-ico.tone-warn { color: var(--warn); }
.status-banner .banner-ico.tone-bad { color: var(--error); }
.status-banner .banner-ico.tone-neutral { color: var(--brand); }
.status-banner .banner-ico.tone-muted { color: var(--muted); }

/* Reassessment figure row */
.reassess-figures { display: flex; flex-wrap: wrap; gap: 22px; }
.reassess-figures .fig { min-width: 90px; }
.reassess-figures .fig-num { font-size: 1.5rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.reassess-figures .fig-num.up { color: var(--good); }
.reassess-figures .fig-num.down { color: var(--error); }
.reassess-figures .fig-label { color: var(--muted); font-size: 0.82rem; }

/* Copy link row */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.82rem; color: var(--muted); background: #fbfcfd; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: #fff; }
.btn.danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Search row */
.search-row { display: flex; gap: 8px; margin-bottom: 20px; }
.search-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }

select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.95rem; }

/* Messages */
.messages { margin-bottom: 18px; }
.msg { padding: 11px 14px; border-radius: 8px; margin-bottom: 10px; font-size: 0.95rem; }
.msg.success { background: var(--good-bg); color: var(--good); }
.msg.warning { background: var(--warn-bg); color: var(--warn); }
.msg.error { background: var(--error-bg); color: var(--error); }
.msg.info { background: #e6f0fa; color: var(--brand-dark); }

/* Cliniko type-ahead */
.cs-box { position: relative; }
#cs-input { width: 100%; padding: 12px 14px; font-size: 1.05rem; border: 1px solid var(--line); border-radius: 8px; }
#cs-drop {
  position: absolute; left: 0; right: 0; z-index: 20; background: #fff;
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12); max-height: 360px; overflow-y: auto;
}
#cs-drop:empty { display: none; }
.cs-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.cs-item:first-child { border-top: none; }
.cs-item .cs-info { flex: 1; min-width: 0; }
.cs-item .cs-name { font-weight: 600; }
.cs-item .cs-meta { font-size: 0.85rem; color: var(--muted); }
.cs-item form { margin: 0; }
.cs-added { font-size: 0.85rem; color: var(--muted); }
.cs-status { padding: 10px 2px; color: var(--muted); font-size: 0.9rem; }
.cs-status.error { color: var(--error); }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); }
.login-brand { font-size: 1.35rem; margin: 0; }
.login-brand span { font-weight: 400; color: var(--muted); }
.login-card label { display: block; margin: 14px 0 4px; font-size: 0.9rem; font-weight: 600; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }
.login-card .btn { margin-top: 20px; }

/* Head actions (report + issue buttons) */
.head-actions { display: flex; align-items: center; gap: 10px; }

/* Progress report */
.notice-strip { background: var(--grey-bg); color: var(--muted); font-size: 0.85rem; padding: 8px 12px; border-radius: 8px; margin-bottom: 18px; }
.report h2 .hint, .report h2 .of { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.report h2 .hint { margin-left: 6px; }

/* Reveal-on-scroll (only once JS has tagged the report .js) */
[data-reveal] { opacity: 1; }
.report.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease, transform 500ms cubic-bezier(.2,.7,.2,1); }
.report.js [data-reveal].in { opacity: 1; transform: none; }

/* Summary: three animated wellness rings */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 640px) { .summary-grid { grid-template-columns: 1fr; } }
.summary-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.summary-label { color: var(--muted); font-size: 0.9rem; font-weight: 600; }

.ring { position: relative; width: 116px; height: 116px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--grey-bg); stroke-width: 10; }
.ring-value {
  fill: none; stroke: var(--fill-neutral); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1100ms cubic-bezier(.2,.7,.2,1);
}
.ring.up .ring-value { stroke: var(--fill-good); }
.ring.down .ring-value { stroke: var(--fill-bad); }
.ring.empty .ring-value { stroke: var(--grey-bg); }
.ring-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.summary-now { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.ring.up .summary-now { color: var(--fill-good); }
.ring.down .summary-now { color: var(--fill-bad); }
.ring-center .pct { font-size: 0.95rem; font-weight: 700; color: var(--muted); margin-left: 1px; }

.delta-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.82rem; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  opacity: 1; transform: none;
}
.report.js .delta-chip { opacity: 0; transform: scale(0.8); transition: opacity 260ms ease, transform 300ms cubic-bezier(.34,1.56,.64,1); }
.report.js .delta-chip.pop { opacity: 1; transform: scale(1); }
.delta-chip.good { background: var(--good-bg); color: var(--good); }
.delta-chip.bad { background: var(--error-bg); color: var(--error); }
.delta-chip .delta-from { opacity: 0.75; font-weight: 600; margin-left: 3px; }
.summary-sub { color: var(--muted); font-size: 0.8rem; }

.chart-wrap { position: relative; height: 260px; }
.chart-wrap.tall { height: 420px; }

/* Comparison bars */
.metric-row { margin: 4px 0; padding: 9px 10px; border-radius: 10px; transition: background 160ms ease; }
.metric-row:hover { background: #f6f9fc; }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.metric-label { font-weight: 600; }

.scalebar { position: relative; height: 18px; background: var(--grey-bg); border-radius: 9px; overflow: hidden; }
.scalebar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9px; transition: width 1000ms cubic-bezier(.2,.7,.2,1); }
.scalebar-fill.good { background: linear-gradient(90deg, #27b98c, var(--fill-good)); }
.scalebar-fill.bad { background: linear-gradient(90deg, #ef8560, var(--fill-bad)); }
.scalebar-fill.neutral { background: linear-gradient(90deg, #4a8fd4, var(--fill-neutral)); }
.scalebar-mark { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--ink); opacity: 0.55; border-radius: 2px; box-shadow: 0 0 0 1.5px #fff; z-index: 2; }

.anchors { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

.change-badge { font-size: 0.9rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.change-badge .from { color: var(--muted); }
.change-badge .now { color: var(--ink); font-weight: 700; }
.change-badge .delta {
  display: inline-block; margin-left: 6px; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.02em; opacity: 1; transform: none;
}
.report.js .change-badge .delta { opacity: 0; transform: scale(0.8); transition: opacity 240ms ease, transform 280ms cubic-bezier(.34,1.56,.64,1); }
.report.js .change-badge .delta.pop { opacity: 1; transform: scale(1); }
.change-badge .delta.good { background: var(--good-bg); color: var(--good); }
.change-badge .delta.bad { background: var(--error-bg); color: var(--error); }

.quote { font-style: italic; color: var(--ink); border-left: 3px solid var(--brand); padding-left: 12px; margin: 8px 0; }
.overall { display: flex; align-items: center; gap: 16px; }
.overall .big { font-size: 2.4rem; font-weight: 800; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.overall .big.goal { color: var(--good); }
.overall .of { color: var(--muted); font-size: 0.85rem; margin-left: 4px; }
.overall .arrow { font-size: 1.6rem; color: var(--muted); }

/* Respect reduced motion: show final state, no movement */
@media (prefers-reduced-motion: reduce) {
  .report.js [data-reveal],
  .report.js .delta-chip,
  .report.js .change-badge .delta,
  .scalebar-fill, .ring-value, .summary-card, .stat { transition: none !important; }
}

/* Print: hand the report to the patient */
@media print {
  .topbar, .no-print, .messages { display: none !important; }
  body { background: #fff; background-image: none; }
  .container { max-width: none; padding: 0; }
  .card, .summary-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .report.js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .report .delta-chip, .report .change-badge .delta { opacity: 1 !important; transform: none !important; }
  .scalebar-fill, .ring-value { transition: none !important; }
  .metric-row:hover { background: none; }
  a[href]:after { content: ""; }
}

/* Clinic dashboard shell and operational modules */
:root {
  --navy: #102a43;
  --navy-soft: #183b5b;
  --brand: #2f6fa3;
  --brand-dark: #21547d;
  --brand-pale: #eaf2f8;
  --green: #3f7d67;
  --green-pale: #e7f2ed;
  --warm: #fbfaf7;
  --sidebar: #f8fafc;
  --canvas: #f3f6f8;
  --ink: #172b3a;
  --muted: #657786;
  --line: #dce4e9;
  --card: #ffffff;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 19px;
}

html { scroll-behavior: smooth; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(47, 111, 163, 0.34);
  outline-offset: 2px;
}
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px;
  background: #fff; border-radius: 8px; transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.dashboard-body { background: var(--canvas); background-image: none; min-height: 100vh; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 100; width: 252px; display: flex;
  flex-direction: column; padding: 20px 14px 14px; background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 3px 8px 21px; color: var(--navy); }
.sidebar-brand > span:last-child, .mobile-header > span { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-brand strong { font-size: 0.96rem; letter-spacing: -0.01em; }
.sidebar-brand small, .mobile-header small { margin-top: 3px; color: var(--muted); font-size: 0.72rem; }
.brand-mark, .login-emblem { display: inline-flex; flex: none; }
.brand-mark { width: 37px; height: 37px; }
.brand-mark img, .login-emblem img { display: block; width: 100%; height: 100%; }
/* Scroll the nav itself, so a short window can never push the log-out button
   below the fold. Without this the user block is simply squeezed off-screen. */
.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto; }
.side-nav a {
  min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 9px 11px;
  border-radius: 9px; color: #4a6274; text-decoration: none; font-size: 0.91rem; font-weight: 600;
  transition: color 160ms ease, background 160ms ease;
}
.side-nav a:hover { color: var(--navy); background: #edf2f5; }
.side-nav a.active { color: var(--brand-dark); background: #e5eef5; }
.side-nav .nav-count {
  min-width: 22px; height: 22px; display: inline-grid; place-items: center; margin-left: auto;
  padding: 0 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn);
  font-size: 0.68rem; font-variant-numeric: tabular-nums;
}
.side-nav svg, .icon-button svg, .switch-user-button svg, .privacy-strip svg, .tool-icon svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-section { display: flex; flex-direction: column; gap: 3px; }
.nav-section + .nav-section { margin-top: 13px; }
.side-nav .nav-section-label {
  padding: 0 11px 2px; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
}
.sidebar-user {
  flex-shrink: 0;
  display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center;
  gap: 9px; padding: 13px 8px 3px; border-top: 1px solid var(--line);
}
.user-avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-pale); color: var(--green); font-weight: 800;
}
.user-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.84rem; }
.user-copy small { color: var(--muted); font-size: 0.72rem; }
.user-passkeys { margin-top: 2px; color: var(--brand-dark); font-size: 0.72rem; font-weight: 700; text-decoration: none; }
.user-passkeys:hover { text-decoration: underline; }
.sidebar-user form { grid-column: 1 / -1; margin: 2px 0 0; }
.switch-user-button {
  width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  color: var(--navy); font: inherit; font-size: 0.76rem; font-weight: 750; cursor: pointer;
}
.switch-user-button:hover { border-color: #9fb3c1; background: #edf2f5; }
.icon-button {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0;
  border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer;
}
.icon-button:hover { background: #e9eff3; color: var(--navy); }
.workspace { min-height: 100vh; margin-left: 252px; }
.workspace .container { max-width: 1420px; padding: 38px clamp(22px, 3.2vw, 52px) 72px; }
.mobile-header { display: none; }
.sidebar-backdrop { display: none; }

.eyebrow {
  margin: 0 0 5px; color: var(--brand-dark); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.today-head, .page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 25px;
}
.today-head h1, .page-head h1 { margin: 0; color: var(--navy); font-size: clamp(1.72rem, 2.3vw, 2.25rem); letter-spacing: -0.035em; line-height: 1.13; }
.today-head .muted, .page-head-copy .muted { margin: 7px 0 0; max-width: 690px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 15px; }
.section-head h2 { margin: 0; color: var(--navy); font-size: 1.08rem; }
.section-head a, .text-button {
  border: 0; padding: 4px 0; background: none; color: var(--brand-dark);
  text-decoration: none; font-size: 0.84rem; font-weight: 700; cursor: pointer;
}
.card {
  border-color: var(--line); border-radius: var(--radius-lg); padding: 22px;
  box-shadow: 0 1px 2px rgba(16, 42, 67, 0.035), 0 7px 22px rgba(16, 42, 67, 0.04);
}
.btn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: var(--radius-sm); transition: background 160ms ease, border 160ms ease;
}
.btn.primary { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.primary:hover { background: var(--navy); border-color: var(--navy); }
.btn.ghost:hover { background: var(--brand-pale); border-color: #cadbe7; }
.btn.small { min-height: 36px; }

.launcher-card { position: relative; overflow: visible; z-index: 8; }
.home-launcher { margin-bottom: 17px; padding: 25px; background: #fff; border-color: #d5e1e9; }
.patient-launcher { position: relative; }
.launcher-input-wrap {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center;
  gap: 10px; min-height: 54px; padding: 0 14px; border: 1px solid #bfcfd9;
  border-radius: 12px; background: #fff; transition: border 160ms ease, box-shadow 160ms ease;
}
.launcher-input-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(47, 111, 163, 0.11); }
.launcher-input-wrap svg { width: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.launcher-input-wrap input { min-width: 0; width: 100%; padding: 14px 0; border: 0; outline: 0; color: var(--navy); background: transparent; font-size: 1rem; }
.launcher-input-wrap kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #f8fafb; font: 0.72rem/1.5 inherit; }
.launcher-results {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 50;
  max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; box-shadow: 0 18px 40px rgba(16, 42, 67, 0.15);
}
.launcher-results:empty { display: none; }
.launcher-result { padding: 15px; border-bottom: 1px solid var(--line); }
.launcher-result:last-child { border-bottom: 0; }
.launcher-identity { display: flex; flex-direction: column; gap: 2px; margin-bottom: 11px; }
.launcher-identity strong { color: var(--navy); }
.launcher-identity span, .launcher-status { color: var(--muted); font-size: 0.82rem; }
.launcher-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.launcher-actions form { margin: 0; }
.launcher-action {
  min-height: 36px; display: inline-flex; align-items: center; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy);
  text-decoration: none; font-size: 0.79rem; font-weight: 700; cursor: pointer;
}
.launcher-action:hover { border-color: #b4c9d7; background: #f4f8fa; }
.launcher-action.primary { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.launcher-status { min-height: 18px; margin: 7px 2px 0; }
.launcher-status.error { color: var(--error); }
.inline-notice { margin-bottom: 12px; padding: 9px 11px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 0.84rem; }

.snapshot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.snapshot-card {
  min-height: 124px; display: flex; flex-direction: column; padding: 19px 20px;
  border: 1px solid var(--line); border-radius: 15px; background: #fff;
}
.snapshot-card span { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.snapshot-card strong { margin: 7px 0 5px; color: var(--navy); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.snapshot-card small { margin-top: auto; color: var(--muted); font-size: 0.72rem; }
.snapshot-card.attention { border-color: #e6cda0; background: #fffcf6; }
.snapshot-meta {
  min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 8px 3px 13px; color: var(--muted); font-size: 0.74rem;
}
.snapshot-meta form { margin: 0 0 0 auto; }
.snapshot-meta .stale, .snapshot-meta .error { color: var(--warn); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dashboard-panel { margin: 0; min-height: 300px; }
.compact-list { display: flex; flex-direction: column; }
.compact-row {
  min-height: 58px; display: flex; align-items: center; gap: 11px; padding: 10px 0;
  border-top: 1px solid #edf1f3; color: inherit; text-decoration: none;
}
.compact-row:first-child { border-top: 0; }
.compact-row.linked:hover .row-copy strong { color: var(--brand-dark); }
.compact-row form { margin: 0; }
.row-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.row-copy strong { overflow: hidden; color: var(--navy); font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.row-copy span { color: var(--muted); font-size: 0.75rem; }
.task-check {
  width: 21px; height: 21px; padding: 0; border: 1.5px solid #aebfc9; border-radius: 6px;
  background: #fff; cursor: pointer;
}
.task-check:hover { border-color: var(--green); background: var(--green-pale); }
.task-check.completed { display: inline-block; border-color: var(--green); background: var(--green); position: relative; }
.task-check.completed::after { content: ""; position: absolute; width: 8px; height: 4px; left: 5px; top: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.priority-dot, .shopping-marker { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #a9b6be; }
.priority-dot.high, .shopping-marker.soon { background: #c88c32; }
.priority-dot.urgent, .shopping-marker.urgent { background: var(--error); }
.priority-dot.low { background: #94a9b7; }
.date-tile { width: 38px; height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px; background: var(--brand-pale); color: var(--brand-dark); line-height: 1; }
.date-tile strong { font-size: 1rem; }.date-tile small { margin-top: 3px; font-size: 0.58rem; text-transform: uppercase; }
.attention-line { margin: -5px 0 7px; color: var(--error); font-size: 0.78rem; font-weight: 700; }
.alert-symbol { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--error-bg); color: var(--error); font-weight: 800; }
.empty-state { display: flex; flex-direction: column; justify-content: center; padding: 25px 0; text-align: center; }
.empty-state strong { color: var(--navy); font-size: 0.88rem; }
.empty-state span { color: var(--muted); font-size: 0.78rem; }
.empty-state.large { min-height: 180px; }
.panel-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.76rem; }
.quick-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 16px; }
.quick-tools a { display: flex; flex-direction: column; min-height: 86px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--navy); text-decoration: none; }
.quick-tools a:hover { border-color: #b9cdd9; box-shadow: var(--shadow-sm); }
.quick-tools strong { font-size: 0.86rem; }.quick-tools span { margin-top: 4px; color: var(--muted); font-size: 0.73rem; }

.metric-strip { display: flex; gap: 10px; margin-bottom: 16px; }
.metric-strip > div { min-width: 120px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.metric-strip strong { display: block; color: var(--navy); font-size: 1.35rem; }.metric-strip span { color: var(--muted); font-size: 0.75rem; }
.metric-strip .attention strong { color: var(--error); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 10px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: #edf2f5; }
.segmented a { padding: 6px 11px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 0.79rem; font-weight: 700; }
.segmented a.active { color: var(--navy); background: #fff; box-shadow: var(--shadow-sm); }
.inline-search input, .field-control {
  width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #cbd7df;
  border-radius: 9px; color: var(--ink); background: #fff;
}
.inline-search input { width: min(270px, 100%); }
.task-item { display: flex; align-items: flex-start; gap: 13px; padding: 16px 2px; border-top: 1px solid var(--line); }
.task-item:first-child { border-top: 0; }.task-item.overdue { border-left: 3px solid #d47761; padding-left: 12px; }
.task-item > form { padding-top: 2px; }.task-copy { min-width: 0; flex: 1; }
.task-title { display: flex; align-items: center; gap: 8px; }.task-title strong { color: var(--navy); }
.task-copy p { margin: 5px 0; color: #465d6c; font-size: 0.87rem; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 15px; color: var(--muted); font-size: 0.73rem; }
.priority-label { padding: 2px 7px; border-radius: 999px; background: #eef2f4; color: var(--muted); font-size: 0.66rem; font-weight: 800; text-transform: uppercase; }
.priority-label.high { color: #8a5a00; background: var(--warn-bg); }.priority-label.urgent { color: var(--error); background: var(--error-bg); }
.history-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 0.83rem; }
.history-list > div:first-child { border-top: 0; }.history-list span { color: var(--muted); text-align: right; }

.form-card { max-width: 720px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.form-field > label { display: block; margin-bottom: 5px; color: var(--navy); font-size: 0.82rem; font-weight: 700; }
.form-field textarea.field-control { resize: vertical; }
.form-field small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.72rem; }
.field-error { display: block; margin-top: 4px; color: var(--error); font-size: 0.75rem; }
.form-field ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 5px 0 0; padding: 0; list-style: none; }
.form-field ul label { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.78rem; }
.form-actions { display: flex; gap: 9px; padding-top: 5px; }
.roster-page-head { margin-bottom: 14px; }
.roster-save-summary {
  min-width: 148px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: #fff; text-align: center; font-size: 0.75rem; font-weight: 700;
}
.roster-save-summary.saving { color: var(--brand-dark); background: var(--brand-pale); }
.roster-save-summary.saved { color: var(--green); background: var(--green-pale); }
.roster-save-summary.live { color: var(--green); border-color: #b8d7c9; background: var(--green-pale); }
.roster-save-summary.error { color: var(--error); border-color: #edc1bb; background: var(--error-bg); }
/* Roster section tabs: a quiet underline bar under the title, with the
   page's actions and save state on the right. The week stepper lives in
   the page head. */
.roster-page-head { align-items: flex-start; margin-bottom: 6px; }
.roster-subnav {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 18px;
  margin: 0 0 20px; border-bottom: 1px solid var(--line);
}
.roster-tabs { display: flex; gap: 2px; margin-bottom: -1px; }
.roster-tabs a {
  position: relative; min-height: 44px; display: inline-flex; align-items: center; padding: 10px 14px;
  border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none;
  font-size: 0.84rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
}
.roster-tabs a:hover { color: var(--navy); }
.roster-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 6px; }
.roster-tabs a.active { color: var(--navy); border-bottom-color: var(--brand); }
.roster-subnav-side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 8px; }
.roster-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.roster-toolbar-actions form { margin: 0; }
.roster-week-stepper {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm);
}
.roster-step {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%;
  color: var(--brand-dark); transition: background 150ms ease, color 150ms ease;
}
.roster-step:hover { background: var(--brand-pale); }
.roster-step:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.roster-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.roster-week-label { min-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 6px; text-align: center; }
.roster-week-label strong { color: var(--navy); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roster-week-label .status-chip { padding: 2px 8px; font-size: 0.62rem; }
.hours-flag-inline { color: var(--warn); font-weight: 700; }
@media (max-width: 640px) {
  .roster-page-head { flex-direction: column; align-items: stretch; }
  .roster-week-stepper { justify-content: space-between; }
  .roster-week-label { flex: 1; }
  .roster-tabs { width: 100%; overflow-x: auto; }
}
.status-chip { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #edf1f3; color: var(--muted); font-size: 0.7rem; font-weight: 800; }
.status-chip.good, .status-chip.purchased { background: var(--green-pale); color: var(--green); }
.status-chip.needed { background: var(--warn-bg); color: var(--warn); }.status-chip.ordered { background: var(--brand-pale); color: var(--brand-dark); }
.roster-calendar-empty-note {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 10px; padding: 10px 13px; border: 1px solid #d7e2e9;
  border-radius: 10px; color: var(--muted); background: #f9fbfc; font-size: 0.77rem;
}
.roster-calendar-empty-note a { color: var(--brand-dark); font-weight: 700; }
.roster-plan-wrap {
  overflow-x: auto; padding: 3px 3px 10px; scrollbar-gutter: stable;
}
.roster-plan {
  min-width: 950px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px;
}
.roster-day-card {
  min-width: 0; min-height: 390px; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid #d4dfe6; border-radius: 15px; background: #fff;
  box-shadow: 0 4px 16px rgba(16, 42, 67, 0.07);
}
.roster-day-card.today {
  border-color: #6d9fc1; box-shadow: 0 0 0 2px rgba(47, 111, 163, 0.12), 0 6px 20px rgba(16, 42, 67, 0.1);
}
.roster-day-head {
  min-height: 77px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 15px 14px 13px; border-bottom: 1px solid #e2e9ed; background: #f6f8fa;
}
.roster-day-card.today .roster-day-head { background: #eaf4fa; }
.roster-day-head div { min-width: 0; display: flex; flex-direction: column; }
.roster-day-head div > span {
  color: #667b89; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
}
.roster-day-head strong {
  margin-top: 3px; color: var(--navy); font-size: 1rem; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.roster-day-head small {
  padding: 4px 7px; border-radius: 999px; color: #225c83; background: #d6eaf6;
  font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
}
.roster-day-shifts { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 11px; }
.roster-plan-shift {
  width: 100%; min-height: 78px; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 11px; border: 1px solid var(--roster-shift-border); border-radius: 11px;
  color: var(--roster-shift-ink); background: var(--roster-shift-bg); text-align: left;
  box-shadow: 0 2px 6px rgba(16, 42, 67, 0.07); font: inherit;
}
button.roster-plan-shift { cursor: pointer; transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
button.roster-plan-shift:hover {
  transform: translateY(-1px); border-color: var(--roster-shift-ink); box-shadow: 0 5px 12px rgba(16, 42, 67, 0.12);
}
button.roster-plan-shift:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.35); outline-offset: 2px; }
.roster-plan-person { min-width: 0; display: flex; align-items: center; gap: 7px; }
.roster-plan-person strong {
  min-width: 0; overflow: hidden; font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap;
}
.roster-plan-avatar {
  width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--roster-shift-border) 72%, white);
  border-radius: 8px; background: rgba(255, 255, 255, 0.55); font-size: 0.67rem; font-weight: 800;
}
.roster-plan-time {
  color: var(--roster-shift-ink); font-size: 0.68rem; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.35;
}
.roster-plan-shift > small { color: var(--roster-shift-ink); font-size: 0.58rem; font-weight: 700; opacity: 0.75; }
.roster-day-empty {
  flex: 1; min-height: 150px; display: grid; place-content: center; justify-items: center; gap: 7px;
  color: #8a9aa5; text-align: center;
}
.roster-day-empty > span {
  width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #dce4e9;
  border-radius: 50%; background: #f7f9fa; font-size: 1rem;
}
.roster-day-empty small { font-size: 0.66rem; font-weight: 700; }
.roster-day-card footer {
  padding: 9px 11px; border-top: 1px solid #edf1f3; color: #7a8d99; background: #fbfcfd;
  font-size: 0.62rem; font-weight: 700; text-align: center;
}
.roster-colour-0 { --roster-shift-bg: #e4f0f8; --roster-shift-border: #8eb8d1; --roster-shift-ink: #173f5b; }
.roster-colour-1 { --roster-shift-bg: #e4f1ea; --roster-shift-border: #93bea9; --roster-shift-ink: #245541; }
.roster-colour-2 { --roster-shift-bg: #f7ecd4; --roster-shift-border: #d4b574; --roster-shift-ink: #65450e; }
.roster-colour-3 { --roster-shift-bg: #ede7f5; --roster-shift-border: #b7a3d0; --roster-shift-ink: #4e3967; }
.roster-colour-4 { --roster-shift-bg: #f6e6e6; --roster-shift-border: #d2a0a0; --roster-shift-ink: #6d3636; }
.roster-colour-5 { --roster-shift-bg: #dff0f0; --roster-shift-border: #8dbfc0; --roster-shift-ink: #175456; }
/* Work from home: the person's colour, drawn with faint stripes in a darker
   tint of it and a dashed border. The "WFH" tag is the real signal. */
.roster-plan-shift.remote {
  border-style: dashed; border-width: 1.5px;
  background: repeating-linear-gradient(
    135deg,
    var(--roster-shift-bg) 0 7px,
    color-mix(in srgb, var(--roster-shift-border) 26%, var(--roster-shift-bg)) 7px 14px
  );
}
button.roster-plan-shift.remote:hover { border-color: var(--roster-shift-ink); }
.roster-plan-shift.remote .roster-plan-person { flex-wrap: wrap; row-gap: 5px; }
.roster-wfh-tag {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px;
  border: 1px solid var(--roster-shift-border, #9fb3c2); border-radius: 999px;
  color: var(--roster-shift-ink, var(--navy)); background: rgba(255, 255, 255, 0.85);
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1.2; vertical-align: middle;
}
.roster-wfh-tag svg {
  width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.roster-day-wfh-link { margin-left: 6px; color: var(--brand-dark); font-weight: 800; text-decoration: none; }
.roster-day-wfh-link:hover { text-decoration: underline; }
.roster-day-wfh-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.manager-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.manager-actions form { margin: 0; }
.roster-manager-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff;
}
.roster-manager-bar .manager-actions { flex: 0 0 auto; margin: 0; }
.roster-instructions { min-width: 0; display: flex; flex-direction: column; }
.roster-instructions strong { color: var(--navy); font-size: 0.8rem; }
.roster-instructions span { margin-top: 2px; color: var(--muted); font-size: 0.73rem; }
.roster-instructions code {
  padding: 1px 5px; border: 1px solid #d4dfe6; border-radius: 5px;
  color: var(--navy); background: #f7fafb; font-family: inherit; font-size: 0.72rem;
  font-weight: 700; line-height: 1.4;
}
.roster-table-wrap {
  overflow-x: auto; border: 1px solid #d4dee5; border-radius: 14px; background: #fff;
  box-shadow: var(--shadow-sm); scrollbar-gutter: stable;
}
.roster-week-grid {
  width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0;
  table-layout: fixed; background: #fff;
}
.roster-week-grid th, .roster-week-grid td { border-right: 1px solid #e4eaee; border-bottom: 1px solid #e4eaee; }
.roster-week-grid tr:last-child th, .roster-week-grid tr:last-child td { border-bottom: 0; }
.roster-week-grid th:last-child, .roster-week-grid td:last-child { border-right: 0; }
.roster-week-grid thead th {
  position: sticky; top: 0; z-index: 3; height: 57px; padding: 8px 9px;
  color: var(--muted); background: #f7f9fa; text-align: left;
}
.roster-week-grid thead th:not(:first-child) { text-align: center; }
.roster-week-grid thead th span { display: block; font-size: 0.67rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.roster-week-grid thead th strong { display: block; margin-top: 2px; color: var(--navy); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.roster-week-grid thead th.today { background: #edf5fa; }
.roster-staff-heading, .roster-staff { width: 162px; }
.roster-week-grid .roster-staff-heading { left: 0; z-index: 5; padding-left: 14px; }
.roster-staff {
  position: sticky; left: 0; z-index: 2; padding: 12px 11px; background: #fbfcfd; text-align: left;
}
.roster-staff > span:last-child { min-width: 0; display: inline-flex; width: calc(100% - 39px); flex-direction: column; vertical-align: middle; }
.roster-staff strong { overflow: hidden; color: var(--navy); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.roster-staff small { margin-top: 2px; color: var(--muted); font-size: 0.64rem; }
.roster-avatar {
  width: 31px; height: 31px; display: inline-grid; place-items: center; margin-right: 6px;
  border-radius: 50%; color: var(--brand-dark); background: var(--brand-pale);
  vertical-align: middle; font-size: 0.72rem; font-weight: 800;
}
.roster-cell { height: 105px; padding: 7px; vertical-align: top; background: #fff; }
.roster-cell.today { background: #fbfdff; box-shadow: inset 0 2px 0 rgba(47, 111, 163, 0.4); }
.roster-shifts { display: flex; flex-direction: column; gap: 5px; }
.roster-shift-pill {
  min-height: 30px; display: flex; align-items: center; justify-content: space-between; gap: 5px;
  padding: 5px 7px; border: 1px solid #bfd4e1; border-radius: 7px;
  color: var(--navy); background: var(--brand-pale); text-decoration: none;
  font-size: 0.7rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
  transition: border-color 150ms ease, background 150ms ease;
}
.roster-shift-pill:hover { border-color: var(--brand); background: #e2eef6; }
.roster-shift-pill.read-only { cursor: default; }
.roster-shift-pill.read-only:hover { border-color: #bfd4e1; background: var(--brand-pale); }
.roster-shift-pill small {
  flex: 0 0 auto; padding: 2px 4px; border-radius: 4px;
  color: var(--green); background: var(--green-pale); font-size: 0.58rem;
}
.roster-shift-pill.remote { flex-wrap: wrap; justify-content: flex-start; border-style: dashed; background: #f4f8fb; }
.roster-shift-pill.remote > span:first-child { flex: 1 0 100%; }
.roster-quick-entry { display: grid; grid-template-columns: minmax(0, 1fr) 27px 30px; gap: 3px; margin-top: 6px; }
.roster-quick-entry input {
  min-width: 0; width: 100%; height: 31px; padding: 5px 3px; border: 1px dashed #bdcbd4;
  border-radius: 7px; color: var(--navy); background: #fff; font-size: 0.72rem;
  font-variant-numeric: tabular-nums; transition: border 150ms ease, box-shadow 150ms ease;
}
.roster-quick-entry input:hover { border-color: #8fa8b8; }
.roster-quick-entry input:focus { border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 111, 163, 0.1); outline: 0; }
.roster-quick-entry input[aria-invalid="true"] { border-style: solid; border-color: var(--error); background: #fffafa; }
.roster-quick-entry input:disabled { opacity: 0.65; cursor: wait; }
.roster-quick-entry button {
  width: 27px; height: 31px; padding: 0; border: 1px solid #cbd7df; border-radius: 7px;
  color: var(--brand-dark); background: #fff; cursor: pointer; font-size: 1rem; line-height: 1;
}
.roster-quick-entry button:hover { border-color: var(--brand); background: var(--brand-pale); }
.roster-quick-entry .roster-wfh-add { width: 30px; font-size: 0.52rem; font-weight: 800; }
.roster-cell-status { min-height: 15px; margin-top: 3px; color: var(--muted); font-size: 0.62rem; line-height: 1.25; }
.roster-cell-status.saving { color: var(--brand-dark); }
.roster-cell-status.saved { color: var(--green); }
.roster-cell-status.error { color: var(--error); font-weight: 650; }
.roster-off { display: block; padding: 11px 2px; color: #98a6b0; text-align: center; font-size: 0.7rem; }
.roster-dialog {
  width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 17px;
  color: var(--ink); background: transparent; box-shadow: var(--shadow-lg);
}
.roster-dialog::backdrop { background: rgba(16, 42, 67, 0.46); }
.roster-dialog-card { padding: 22px; border-radius: 17px; background: #fff; }
.roster-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.roster-dialog-head h2 { margin: 0; color: var(--navy); }
.roster-dialog-head .muted { margin: 4px 0 0; font-size: 0.78rem; }
.roster-time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
/* In clinic / Work from home switch at the top of the shift dialog. */
.roster-location-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 0 16px; padding: 3px;
  border: 0; border-radius: 10px; background: #edf2f5;
}
.roster-location-switch label { position: relative; display: block; cursor: pointer; }
.roster-location-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.roster-location-switch span {
  min-height: 44px; display: grid; place-items: center; padding: 6px 10px; border-radius: 8px;
  color: var(--muted); font-size: 0.82rem; font-weight: 700; text-align: center;
}
.roster-location-switch input:checked + span { color: var(--navy); background: #fff; box-shadow: var(--shadow-sm); }
.roster-location-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.roster-dialog textarea { resize: vertical; }
.roster-dialog-error { min-height: 20px; margin: 9px 0 0; color: var(--error); font-size: 0.76rem; font-weight: 650; }
.roster-dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.roster-dialog-actions .btn.danger { margin-left: auto; }
.roster-dialog-actions [hidden] { display: none; }
.roster-suggestions { margin-bottom: 15px; padding: 11px; border: 1px solid #e5cf9e; border-radius: 9px; background: var(--warn-bg); }
.roster-suggestions > strong { display: block; color: var(--warn); font-size: 0.76rem; }
.roster-suggestions > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.roster-undo {
  position: fixed; right: 24px; bottom: 24px; z-index: 300; display: flex; align-items: center;
  gap: 14px; padding: 11px 14px; border-radius: 10px; color: #fff; background: var(--navy);
  box-shadow: var(--shadow-lg); font-size: 0.8rem;
}
.roster-undo[hidden] { display: none; }
.roster-undo button { border: 0; color: #fff; background: transparent; text-decoration: underline; font-weight: 800; cursor: pointer; }
.template-row { min-height: 66px; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto 40px; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.template-row:first-child { border-top: 0; }.template-row.inactive { opacity: 0.58; }
.template-row > div { display: flex; flex-direction: column; }.template-row strong { color: var(--navy); font-size: 0.82rem; }
.template-row span { color: var(--muted); font-size: 0.72rem; }

.shopping-page-head { margin-bottom: 20px; }
.shopping-board { width: min(900px, 100%); margin: 0 auto; }
.shopping-add-card {
  display: grid; grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.3fr); align-items: center;
  gap: 24px; margin-bottom: 15px; padding: 20px; border: 1px solid #cbdde8; border-radius: 16px;
  background: linear-gradient(135deg, #edf6fa 0%, #f8fbfc 65%, #fff 100%);
  box-shadow: 0 6px 22px rgba(16, 42, 67, 0.08);
}
.shopping-add-copy { display: flex; align-items: center; gap: 12px; }
.shopping-add-copy > div { min-width: 0; display: flex; flex-direction: column; }
.shopping-add-copy strong { color: var(--navy); font-size: 0.93rem; }
.shopping-add-copy small { margin-top: 3px; color: var(--muted); font-size: 0.7rem; }
.shopping-add-icon {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
  border-radius: 11px; color: #fff; background: var(--brand); box-shadow: 0 4px 10px rgba(47, 111, 163, 0.22);
}
.shopping-add-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.shopping-quick-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.shopping-quick-add .field-control {
  min-height: 48px; padding: 10px 14px; border-color: #b8cedc; border-radius: 11px;
  box-shadow: 0 1px 2px rgba(16, 42, 67, 0.04); font-size: 0.88rem;
}
.shopping-quick-add .field-control:focus { border-color: var(--brand); outline: 3px solid rgba(47, 111, 163, 0.15); }
.shopping-quick-add .btn { min-width: 82px; min-height: 48px; }
.shopping-add-error { grid-column: 2; min-height: 16px; margin: -16px 2px 0; color: var(--error); font-size: 0.7rem; font-weight: 700; }
.shopping-list-card, .shopping-history-card {
  overflow: hidden; border: 1px solid #d6e0e6; border-radius: 16px; background: #fff;
  box-shadow: 0 5px 18px rgba(16, 42, 67, 0.07);
}
.shopping-history-card { margin-top: 15px; }
.shopping-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 78px; padding: 16px 20px; border-bottom: 1px solid #e1e8ec; background: #f9fbfc;
}
.shopping-list-head h2 { margin-top: 2px; color: var(--navy); font-size: 1.08rem; }
.shopping-count {
  padding: 5px 9px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-pale);
  font-size: 0.68rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.shopping-items { min-height: 108px; }
.shopping-item {
  min-height: 76px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 38px;
  align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid #edf1f3;
  background: #fff; transition: background 150ms ease, transform 180ms ease, opacity 180ms ease;
}
.shopping-item:first-child { border-top: 0; }
.shopping-item:hover { background: #fbfdfe; }
.shopping-item.is-new { transform: translateY(-5px); opacity: 0; }
.shopping-item form { margin: 0; }
.shopping-check-button, .shopping-remove-button {
  display: grid; place-items: center; border: 0; background: transparent; cursor: pointer;
}
.shopping-check-button {
  width: 34px; height: 34px; border: 1.5px solid #a8bbc7; border-radius: 50%; color: transparent;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.shopping-check-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.3; }
.shopping-check-button:hover { transform: scale(1.05); border-color: var(--green); color: #fff; background: var(--green); }
.shopping-check-button:focus-visible, .shopping-remove-button:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.26); outline-offset: 2px; }
.shopping-copy { min-width: 0; display: flex; flex-direction: column; }
.shopping-copy strong { overflow: hidden; color: var(--navy); font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.shopping-copy small { margin-top: 4px; color: #718490; font-size: 0.67rem; }
.shopping-ordered { padding: 4px 8px; border-radius: 999px; color: #7c5b1c; background: #f8eed8; font-size: 0.62rem; font-weight: 800; }
.shopping-remove-button { width: 34px; height: 34px; border-radius: 9px; color: #8a9aa5; }
.shopping-remove-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.shopping-remove-button:hover { color: var(--error); background: var(--error-bg); }
.shopping-empty {
  min-height: 210px; display: grid; place-content: center; justify-items: center; gap: 7px;
  padding: 30px; color: var(--muted); text-align: center;
}
.shopping-empty > span {
  width: 45px; height: 45px; display: grid; place-items: center; margin-bottom: 3px;
  border-radius: 50%; color: var(--green); background: var(--green-pale);
}
.shopping-empty svg { width: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.shopping-empty strong { color: var(--navy); font-size: 0.9rem; }
.shopping-empty small { font-size: 0.72rem; }
.shopping-history-list article {
  min-height: 65px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center;
  gap: 11px; padding: 11px 18px; border-top: 1px solid #edf1f3;
}
.shopping-history-list article:first-child { border-top: 0; }
.shopping-history-list article > span {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  color: var(--green); background: var(--green-pale);
}
.shopping-history-list svg { width: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.shopping-history-list article > div { min-width: 0; display: flex; flex-direction: column; }
.shopping-history-list strong { overflow: hidden; color: var(--navy); font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.shopping-history-list small { margin-top: 3px; color: var(--muted); font-size: 0.65rem; }
.shopping-history-list form { margin: 0; }
.shopping-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 300; display: flex; align-items: center;
  gap: 15px; max-width: 420px; padding: 12px 15px; border-radius: 11px; color: #fff;
  background: var(--navy); box-shadow: var(--shadow-lg); font-size: 0.78rem; font-weight: 650;
}
.shopping-toast[hidden] { display: none; }
.shopping-toast button { border: 0; color: #fff; background: transparent; text-decoration: underline; font-weight: 800; cursor: pointer; }
.shopping-dashboard-check { width: 13px; height: 13px; flex: 0 0 13px; border: 1.5px solid #9fb2be; border-radius: 50%; }

/* Live clinic numbers at the top of Analytics, read from the cached Cliniko
   snapshot rather than a live API call. */
.analytics-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.analytics-band.four { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.analytics-card {
  display: flex; flex-direction: column; padding: 18px 20px; border: 1px solid #d6e0e6;
  border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(16, 42, 67, 0.07);
}
.analytics-card header { margin-bottom: 14px; }
.analytics-card h2 { margin-top: 2px; color: var(--navy); font-size: 1.02rem; }
.analytics-card .clinic-tile-num { font-size: 2.1rem; }
.analytics-card .clinic-tile-num.warn { color: #8a5a12; }
.note-copy { margin: 6px 0 0; font-size: 0.76rem; }
.split-list { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 0; padding: 0; list-style: none; }
.split-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-top: 1px solid #eef2f5; font-size: 0.82rem;
}
.split-list li:first-child { border-top: 0; }
.split-list span { min-width: 0; overflow: hidden; color: #5d7180; text-overflow: ellipsis; white-space: nowrap; }
.split-list strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.rate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rate-row > div { display: flex; flex-direction: column; gap: 2px; }
.rate-num { color: var(--navy); font-size: 1.6rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rate-label { color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.rate-note { color: #718490; font-size: 0.7rem; }
.reasons-head { margin: 16px 0 0; }
.hour-strip { display: flex; align-items: flex-end; gap: 5px; height: 128px; margin-top: 4px; }
.hour-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.hour-bar {
  width: 100%; min-height: 3px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--brand) 0%, #6ea6ce 100%);
}
.hour-label { color: var(--muted); font-size: 0.62rem; font-variant-numeric: tabular-nums; }
.analytics-band.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.trend-strip { display: flex; align-items: flex-end; gap: 7px; height: 150px; margin-top: 4px; }
.trend-value { color: var(--navy); font-size: 0.64rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hour-bar.money-bar { background: linear-gradient(180deg, var(--green) 0%, #79b791 100%); }
.compare-card { grid-column: 1 / -1; }
.compare-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.compare-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.compare-pill {
  padding: 7px 13px; border: 1px solid #cfdbe3; border-radius: 999px; color: #5d7180;
  background: #f2f6f8; font: inherit; font-size: 0.76rem; font-weight: 700; cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.compare-pill[aria-pressed="true"] { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-pale); }
.compare-pill:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.26); outline-offset: 2px; }
.compare-scroll { overflow-x: auto; margin-top: 6px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.compare-table th, .compare-table td { padding: 9px 14px; border-top: 1px solid #eef2f5; text-align: right; white-space: nowrap; }
.compare-table thead th { border-top: 0; color: var(--navy); font-size: 0.8rem; }
.compare-table tbody th { color: #5d7180; font-weight: 650; text-align: left; }
.compare-table td { color: var(--navy); font-variant-numeric: tabular-nums; font-weight: 650; }
.compare-table [hidden] { display: none; }
/* Per-practitioner breakdown. Deliberately neutral: no ranking colours and no
   leader markers, since this is a shared view of objective numbers. */
.staff-table { margin-top: 4px; }
.staff-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.staff-table th.sortable:hover { color: var(--brand-dark); }
.staff-table th.sortable:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.26); outline-offset: -3px; }
.staff-table th.sortable::after { content: ""; display: inline-block; width: 9px; margin-left: 5px; opacity: 0.35; }
.staff-table th[aria-sort="ascending"]::after { content: "\2191"; opacity: 1; }
.staff-table th[aria-sort="descending"]::after { content: "\2193"; opacity: 1; }
.staff-table .staff-name-col { text-align: left; }
.staff-table tbody td { position: relative; }
/* The bar sits behind the number as a reading aid for relative volume. */
.cell-bar {
  position: absolute; left: 6px; right: auto; top: 50%; transform: translateY(-50%);
  height: 22px; max-width: calc(100% - 12px); border-radius: 5px;
  background: rgba(47, 111, 163, 0.13); pointer-events: none;
}
.cell-value { position: relative; }
.staff-expand {
  display: inline-flex; align-items: center; gap: 7px; padding: 2px 0; border: 0;
  background: transparent; color: var(--navy); font: inherit; font-weight: 650; cursor: pointer;
}
.staff-expand svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease; }
.staff-expand:hover { color: var(--brand-dark); }
.staff-row.is-open .staff-expand svg { transform: rotate(180deg); }
.staff-row.is-open { background: #f7fafc; }
.staff-trend > td { padding: 4px 14px 18px; background: #f7fafc; }
.staff-trend[hidden] { display: none; }
.staff-trend-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.staff-trend-inner .trend-strip { height: 96px; }
.period-card { grid-column: 1 / -1; }
.period-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px; margin: 4px 0 16px;
}
.period-tiles > div { display: flex; flex-direction: column; gap: 2px; }
.period-card .compare-table thead th:first-child { text-align: left; }
.clinic-stamp {
  padding: 5px 10px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-pale);
  font-size: 0.68rem; font-weight: 800; white-space: nowrap;
}
.clinic-stamp.stale { color: #8a5a12; background: #fbeed8; }
.clinic-empty { margin: 0; }
.clinic-tile {
  display: flex; flex-direction: column; gap: 3px; padding: 18px 20px; border: 1px solid #d6e0e6;
  border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(16, 42, 67, 0.07);
}
.clinic-tile.wide .clinic-tile-num { font-size: 2.4rem; }
.clinic-tile-num { color: var(--navy); font-size: 1.75rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.clinic-tile-num.up { color: var(--green); }
.clinic-tile-num.down { color: var(--error); }
.clinic-tile-label { order: -1; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.clinic-tile-note { margin-top: 2px; color: #718490; font-size: 0.7rem; font-weight: 650; }
.clinic-tile.accent .clinic-tile-num { color: var(--green); }
.clinic-tile.money .clinic-tile-num { color: var(--brand-dark); }
.clinic-footnote { margin: 14px 0 0; color: var(--muted); font-size: 0.7rem; line-height: 1.55; }
.clinic-footnote strong { color: #5d7180; }

/* Analytics revamp (ANALYTICS_V2_ENABLED, staff/analytics.html). Everything
   is scoped under .av2 so it cannot reach the original page or the rest of
   the dashboard. Design: docs/analytics-revamp-mockup.html. */
.av2 { --ghost: #9aa8b3; --grid: #edf1f4; --av2-grey: #eef1f4; }
.av2 h2 { margin: 0; color: var(--navy); font-size: 1.08rem; }
.av2-head { margin-bottom: 10px; }
.av2-card {
  min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: #fff; box-shadow: 0 1px 2px rgba(16, 42, 67, 0.035), 0 7px 22px rgba(16, 42, 67, 0.04);
}
.av2-section { margin-bottom: 14px; }
.av2-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.av2-card-head p { margin: 3px 0 0; font-size: 0.82rem; }
.av2-small { margin: 0 0 8px; font-size: 0.8rem; }
.av2-subhead { margin: 0 0 2px; color: var(--navy); font-size: 0.95rem; }

/* One sticky row of filters above everything they scope. */
.av2-filters {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 -4px 4px; padding: 10px 4px 14px; background: var(--canvas);
}
.av2-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.av2-seg a, .av2-seg button {
  display: inline-flex; align-items: center; min-height: 36px; padding: 7px 12px; border: 0; border-radius: 8px;
  color: var(--muted); background: transparent; font: inherit; font-size: 0.84rem; font-weight: 650;
  text-decoration: none; cursor: pointer;
}
.av2-seg a:hover, .av2-seg button:hover { color: var(--navy); background: var(--av2-grey); }
.av2-seg a.active, .av2-seg button.active { color: #fff; background: var(--navy); }
.av2-seg a:focus-visible, .av2-seg button:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.3); outline-offset: 1px; }
.av2-select {
  min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px;
  color: var(--navy); background: #fff; font: inherit; font-size: 0.84rem; font-weight: 650;
}
.av2-select.mini { width: 100%; min-height: 34px; padding: 5px 8px; border-radius: 8px; font-size: 0.78rem; }

/* Tiles */
.av2-band { display: grid; gap: 14px; margin-bottom: 14px; }
.av2-band.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.av2-band.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.av2-band.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.av2-band.split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.av2-tile { display: flex; flex-direction: column; gap: 2px; }
.av2-label { color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.av2-num { color: var(--navy); font-size: 1.85rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.av2-tile.wide .av2-num { font-size: 2.4rem; }
.av2-note { color: #718490; font-size: 0.74rem; font-weight: 650; }
.av2-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 750; }
.av2-delta.up { color: var(--good); }
.av2-delta.down { color: var(--error); }
.av2-delta svg { width: 11px; height: 11px; }
.av2-split { display: grid; gap: 4px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 0.84rem; }
.av2-split li { display: flex; justify-content: space-between; gap: 12px; }
.av2-split span { color: #5d7180; }
.av2-split strong { color: var(--navy); font-variant-numeric: tabular-nums; }

/* Trends: stacked line charts sharing one crosshair */
.av2-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.av2-legend { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 0.78rem; }
.av2-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.av2-key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--brand); }
.av2-key.ghost { border-top: 2px dashed var(--ghost); }
.av2-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; color: #fff; background: var(--navy); font-size: 0.78rem; font-weight: 750; }
.av2-chip:empty { display: none; }
.av2-trend { position: relative; padding: 10px 0 4px; border-top: 1px solid var(--line); }
.av2-trend:first-child { border-top: 0; }
.av2-trend-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.av2-trend-name { min-width: 150px; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.av2-trend-value { color: var(--navy); font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.av2-trend-compare { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.av2-trend svg { display: block; width: 100%; overflow: visible; }
.av2-trend svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }

/* Patient journey funnel */
.av2-funnel { display: flex; flex-direction: column; gap: 4px; }
.av2-frow { display: grid; grid-template-columns: 190px minmax(0, 1fr) 92px; gap: 12px; align-items: center; padding: 5px 6px; border-radius: 8px; }
.av2-frow:hover, .av2-frow:focus-visible { background: var(--av2-grey); outline: none; }
.av2-flabel { color: var(--navy); font-size: 0.86rem; font-weight: 650; line-height: 1.25; }
.av2-flabel small { display: block; color: var(--muted); font-size: 0.74rem; font-weight: 500; }
.av2-ftrack { height: 22px; overflow: hidden; border-radius: 4px; background: var(--av2-grey); }
.av2-fbar { height: 100%; border-radius: 0 4px 4px 0; background: var(--brand); }
.av2-fnum { text-align: right; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.av2-fnum strong { color: var(--navy); font-size: 0.95rem; }
.av2-drop { margin: -2px 0 2px; padding: 0 6px 0 calc(190px + 18px); color: var(--muted); font-size: 0.74rem; }
.av2-drop.worst { color: var(--warn); font-weight: 700; }
.av2-callout { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--warn); background: var(--warn-bg); font-size: 0.82rem; }

/* Raw and cohort PVA, side by side in boxes of the same shape */
.av2-pva-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.av2-pva { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.av2-pva .av2-num { font-size: 2rem; }
.av2-pva p { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.av2-tag { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.av2-tag.raw { color: var(--muted); background: var(--av2-grey); }
.av2-tag.cohort { color: var(--brand-dark); background: var(--brand-pale); }

/* Cohort heatmap: one blue sequential ramp, light to dark */
.av2-heat-wrap { overflow-x: auto; }
.av2-heat { width: 100%; min-width: 400px; table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.av2-heat th { padding: 2px 4px; color: var(--muted); font-weight: 700; text-align: center; white-space: nowrap; }
.av2-heat th.row { width: 66px; color: var(--navy); text-align: left; }
.av2-heat th.row small { color: var(--muted); font-weight: 500; }
.av2-heat td { height: 30px; border-radius: 4px; color: #172b3a; font-weight: 700; text-align: center; cursor: default; }
.av2-heat td.dark { color: #fff; }
.av2-heat td:hover, .av2-heat td:focus-visible { outline: 2px solid var(--navy); outline-offset: -1px; }
.av2-heat td.empty { background: repeating-linear-gradient(135deg, #f4f6f8 0 4px, #fff 4px 8px); }
.av2-heat .heat-0 { background: #eaf2f8; } .av2-heat .heat-1 { background: #cde2fb; }
.av2-heat .heat-2 { background: #b7d3f6; } .av2-heat .heat-3 { background: #9ec5f4; }
.av2-heat .heat-4 { background: #86b6ef; } .av2-heat .heat-5 { background: #6da7ec; }
.av2-heat .heat-6 { background: #5598e7; } .av2-heat .heat-7 { background: #3987e5; }
.av2-heat .heat-8 { background: #2a78d6; } .av2-heat .heat-9 { background: #256abf; }
.av2-heat .heat-10 { background: #1c5cab; } .av2-heat .heat-11 { background: #184f95; }
.av2-heat .heat-12 { background: #104281; } .av2-heat .heat-13 { background: #0d366b; }
.av2-ramp-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 0.74rem; }
.av2-ramp-key i { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #eaf2f8, #9ec5f4, #3987e5, #1c5cab, #0d366b); }
.av2-ramp-empty { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.av2-ramp-empty b { display: inline-block; width: 14px; height: 10px; border-radius: 2px; background: repeating-linear-gradient(135deg, #e6ebef 0 3px, #fff 3px 6px); }

/* Attendance */
.av2-attendance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.av2-attendance .av2-card-head { margin-bottom: 12px; }
.av2-att-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.av2-reasons-head { margin: 4px 0 10px; }
.av2-reasons { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 0.84rem; }
.av2-reasons li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 28px; gap: 10px; align-items: center; }
.av2-reasons .bar { height: 8px; overflow: hidden; border-radius: 4px; background: var(--av2-grey); }
.av2-reasons .bar i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--ghost); }
.av2-reasons strong { color: var(--navy); text-align: right; font-variant-numeric: tabular-nums; }

/* By practitioner. Rows link to the practitioner filter. */
.av2-table-wrap { overflow-x: auto; }
.av2-prac { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.av2-prac th { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-align: right; text-transform: uppercase; white-space: nowrap; }
.av2-prac td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; }
.av2-prac th:first-child, .av2-prac td:first-child { text-align: left; }
.av2-prac tbody tr { cursor: pointer; }
.av2-prac tbody tr:hover { background: var(--brand-pale); }
.av2-prac tbody tr.selected { background: var(--brand-pale); box-shadow: inset 3px 0 0 var(--brand); }
.av2-prac td.name a { color: var(--navy); font-weight: 700; text-decoration: none; }
.av2-spark { display: block; margin-left: auto; }
.av2-spark path { fill: none; stroke: var(--brand); stroke-width: 1.75; stroke-linejoin: round; }

/* Shared tooltip for the funnel and heatmap */
.av2-tip { position: fixed; z-index: 20; max-width: 260px; padding: 7px 10px; border-radius: 8px; color: #fff; background: var(--navy); box-shadow: 0 6px 18px rgba(16, 33, 52, 0.25); font-size: 0.78rem; line-height: 1.35; pointer-events: none; }
.av2-tip strong { font-size: 0.9rem; }
.av2-tip .sub { color: #b8c7d3; }

@media (max-width: 900px) {
  .av2-band.four, .av2-band.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .av2-band.split, .av2-attendance { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* Stacked on a phone, the filters would cover a third of the screen. */
  .av2-filters { position: static; }
  .av2-band.two, .av2-band.three, .av2-band.four, .av2-pva-pair, .av2-att-nums { grid-template-columns: 1fr; }
  .av2-frow { grid-template-columns: 1fr 70px; }
  .av2-ftrack { grid-column: 1 / 3; grid-row: 2; }
  .av2-drop { padding-left: 6px; }
  .av2-trend-name { min-width: 0; }
}

/* Tasks. Deliberately reuses the shopping board shell so the two screens feel
   like the same tool; only the row internals differ. */
.task-rows { min-height: 108px; }
.task-row { border-top: 1px solid #edf1f3; background: #fff; transition: background 150ms ease; }
.task-row:first-child { border-top: 0; }
.task-row:hover { background: #fbfdfe; }
.task-row.is-open { background: #f7fafc; }
.task-row-main {
  min-height: 76px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 38px 38px;
  align-items: center; gap: 12px; padding: 12px 18px;
}
.task-row form { margin: 0; }
.task-check-button {
  width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid #a8bbc7;
  border-radius: 50%; color: transparent; background: transparent; cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.task-check-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.3; }
.task-check-button:hover { transform: scale(1.05); border-color: var(--green); color: #fff; background: var(--green); }
.task-check-button:focus-visible, .task-details-toggle:focus-visible, .task-note-toggle:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.26); outline-offset: 2px; }
.task-row-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
/* Looks like plain text until you click it, so renaming needs no edit button. */
.task-title-input {
  width: 100%; padding: 3px 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 7px;
  color: var(--navy); background: transparent; font: inherit; font-size: 0.88rem; font-weight: 650;
}
.task-title-input:hover { border-color: #dbe4ea; }
.task-title-input:focus { border-color: var(--brand); background: #fff; outline: 3px solid rgba(47, 111, 163, 0.14); }
.task-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.task-chip {
  padding: 3px 8px; border-radius: 999px; color: #5d7180; background: #eef3f6;
  font-size: 0.66rem; font-weight: 700;
}
.task-chip.overdue { color: var(--error); background: var(--error-bg); }
.task-chip.repeat { color: var(--brand-dark); background: var(--brand-pale); }
.task-chip.priority-high { color: #8a5a12; background: #fbeed8; }
.task-chip.priority-urgent { color: var(--error); background: var(--error-bg); }
.task-chip.priority-low { color: #67798a; background: #eef1f4; }
.task-row.is-overdue .task-title-input { color: var(--error); }
.task-details-toggle, .task-note-toggle {
  width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px;
  color: #8a9aa5; background: transparent; cursor: pointer; transition: color 150ms ease, background 150ms ease;
}
.task-details-toggle svg, .task-note-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: transform 180ms ease; }
.task-details-toggle:hover, .task-note-toggle:hover { color: var(--navy); background: #e9eff3; }
.task-row.is-open .task-details-toggle svg { transform: rotate(180deg); }
.task-details { padding: 2px 18px 18px 70px; border-top: 1px dashed #e4ebef; }
.task-details[hidden] { display: none; }
.task-details-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 14px; margin-top: 14px;
}
.task-field { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.task-field.wide { margin-top: 12px; }
.task-field label { color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.task-field .field-control { min-height: 38px; padding: 7px 10px; border-radius: 9px; font-size: 0.82rem; }
.task-field textarea.field-control { min-height: 62px; }
.task-weekdays { margin: 12px 0 0; padding: 0; border: 0; }
.task-weekdays legend { padding: 0; color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
/* Django renders CheckboxSelectMultiple as a wrapper div of div > label > input,
   so target that rather than a list. */
.task-weekdays > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.task-weekdays > div > div { margin: 0; }
.task-weekdays label {
  display: flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid #cfdbe3;
  border-radius: 999px; color: var(--navy); background: #fff; font-size: 0.76rem; font-weight: 650;
  cursor: pointer; transition: border-color 140ms ease, background 140ms ease;
}
.task-weekdays label:hover { border-color: var(--brand); background: var(--brand-pale); }
.task-weekdays input { width: auto; min-height: 0; margin: 0; accent-color: var(--brand); }
.task-weekdays:has(input:checked) label:has(input:checked) { border-color: var(--brand); background: var(--brand-pale); }
.task-details-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; }
.task-details-error { margin: 0; margin-right: auto; color: var(--error); font-size: 0.7rem; font-weight: 700; }
@media (max-width: 620px) {
  .task-details { padding-left: 18px; }
  .task-row-main { grid-template-columns: 36px minmax(0, 1fr) 32px 32px; gap: 9px; padding: 11px 13px; }
}

/* Quick status notes ("didn't answer") on task rows, both pages. */
span.task-note-line {
  overflow: hidden; color: var(--muted); font-size: 0.74rem;
  text-overflow: ellipsis; white-space: nowrap;
}
.task-note-toggle[aria-expanded="true"] { color: var(--brand-dark); background: var(--brand-pale); }
.quick-note-panel { padding: 2px 18px 16px 70px; border-top: 1px dashed #e4ebef; }
.quick-note-panel[hidden] { display: none; }
.quick-note-panel form { display: flex; gap: 8px; margin: 0; }
.quick-note-panel .field-control { flex: 1; min-height: 38px; padding: 7px 10px; border-radius: 9px; font-size: 0.82rem; }
.quick-note-error { margin: 6px 0 0; color: var(--error); font-size: 0.7rem; font-weight: 700; }
.quick-note-error:empty { display: none; }
/* Dashboard panel: the revealed form drops to its own full-width line. */
.tasks-panel .compact-row { flex-wrap: wrap; }
.tasks-panel .task-note-toggle { width: 27px; height: 27px; border-radius: 7px; }
.tasks-panel .task-note-toggle svg { width: 15px; }
.tasks-panel .quick-note-panel { flex: 1 1 100%; padding: 0 0 6px 32px; border-top: 0; }
@media (max-width: 620px) {
  .quick-note-panel { padding-left: 18px; }
}

.privacy-strip { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid #d5e2e8; border-radius: 13px; background: #f7fafb; }
.privacy-strip > svg { flex: 0 0 auto; color: var(--green); }.privacy-strip > div { display: flex; flex-direction: column; }
.privacy-strip strong { color: var(--navy); font-size: 0.83rem; }.privacy-strip span { color: var(--muted); font-size: 0.75rem; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.tool-card { min-height: 250px; display: flex; flex-direction: column; margin: 0; }
.tool-icon { width: 43px; height: 43px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 11px; }
.tool-icon.blue { background: var(--brand-pale); color: var(--brand-dark); }.tool-icon.navy { background: #e8edf2; color: var(--navy); }
.tool-icon.green { background: var(--green-pale); color: var(--green); }.tool-icon.warm { background: #f7edda; color: #8a641e; }
.tool-card h2 { color: var(--navy); }.tool-card p { margin: 6px 0 18px; color: var(--muted); font-size: 0.84rem; }
.tool-actions { display: flex; align-items: center; gap: 12px; margin-top: auto; }.tool-actions > a:not(.btn) { color: var(--brand-dark); font-size: 0.75rem; font-weight: 700; }
.tool-grid + .privacy-strip { margin-top: 16px; }

/* GP report queue. Dense by design for the clinic's desktop workflow. */
.report-queue-head { margin-bottom: 18px; }
.report-queue-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px;
}
.queue-summary {
  min-height: 76px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px;
  background: #fff; color: var(--ink); text-decoration: none;
}
.queue-summary span { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.queue-summary strong { color: var(--navy); font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.queue-summary:hover, .queue-summary.active { border-color: #abc2d1; box-shadow: var(--shadow-sm); }
.queue-summary.needs-fax.active { background: #fffbf2; border-color: #dfc487; }
.queue-summary.ready.active { background: #f3f8fc; border-color: #b9cfdf; }
.queue-summary.failed.active { background: #fff6f5; border-color: #e6b4ae; }
.queue-summary.sent.active { background: #f3faf6; border-color: #b7d8c7; }
.report-queue-card { padding: 0; overflow: hidden; }
.report-queue-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 17px 19px; border-bottom: 1px solid var(--line);
}
.report-table-wrap { overflow-x: auto; }
.report-table { min-width: 1180px; }
/* The per-patient page has few columns; the queue's 1180px floor overflows
   its card, so this variant fits the card and keeps row buttons visible. */
.report-table.fit { width: 100%; min-width: 560px; }
.report-table .btn { white-space: nowrap; }
.report-table th, .report-table td { padding: 13px 11px; vertical-align: top; }
.report-table th:first-child, .report-table td:first-child { padding-left: 19px; }
.report-table th:last-child, .report-table td:last-child { padding-right: 19px; }
.report-table tbody tr { background: #fff; }
.report-table tbody tr:hover { background: #fbfcfd; }
.report-table td > strong, .report-table td > small { display: block; }
.report-table td > strong { color: var(--navy); font-size: 0.82rem; }
.report-table td > small { max-width: 235px; margin-top: 3px; color: var(--muted); font-size: 0.7rem; line-height: 1.35; }
.report-patient { display: block; color: var(--navy); font-size: 0.86rem; font-weight: 800; text-decoration: none; }
.report-patient:hover { color: var(--brand-dark); text-decoration: underline; }
.report-row.needs-fax td:first-child { box-shadow: inset 3px 0 0 #cf9634; }
.report-row.failed td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.report-row.sending td:first-child { box-shadow: inset 3px 0 0 var(--error); }
.report-row.ready td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.report-row.sent td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.status-chip.report-type { margin-bottom: 4px; background: #eef2f4; color: #536979; }
.status-chip.report-needs-fax, .status-chip.report-needs-fax-number { background: var(--warn-bg); color: var(--warn); }
.status-chip.report-ready, .status-chip.report-ready-to-fax { background: var(--brand-pale); color: var(--brand-dark); }
.status-chip.report-failed, .status-chip.report-fax-failed, .status-chip.report-sending { background: var(--error-bg); color: var(--error); }
.status-chip.report-sent { background: var(--green-pale); color: var(--green); }
.fax-cell { min-width: 150px; }
.report-actions { min-width: 185px; text-align: right !important; }
.report-actions form { display: flex; justify-content: flex-end; gap: 6px; margin: 0 0 7px; }
.queue-fax-input {
  width: 112px; min-height: 36px; padding: 6px 8px; border: 1px solid #c4d1d9;
  border-radius: 8px; color: var(--ink); font-size: 0.78rem;
}
.queue-detail-link { color: var(--brand-dark); font-size: 0.74rem; font-weight: 700; text-decoration: none; }
.queue-detail-link:hover { text-decoration: underline; }
.queue-delete-link { color: var(--error); font-size: 0.74rem; font-weight: 700; text-decoration: none; }
.queue-delete-link:hover { text-decoration: underline; }
.queue-pagination {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  padding: 15px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem;
}
.queue-pagination a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.queue-footnote { margin: -8px 2px 0; color: var(--muted); font-size: 0.72rem; }
.report-detail-layout { display: grid; grid-template-columns: minmax(400px, 0.8fr) minmax(520px, 1.2fr); gap: 17px; align-items: start; }
.report-action-card h2 { margin-bottom: 0; }
.report-action-card p { margin: 8px 0; font-size: 0.84rem; }
.detail-action-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 12px; }
.detail-action-form label { display: block; margin-bottom: 5px; color: var(--navy); font-size: 0.8rem; font-weight: 700; }
.detail-action-form small { display: block; margin-top: 5px; color: var(--muted); font-size: 0.7rem; }
.action-error { padding: 9px 11px; border-radius: 8px; background: var(--error-bg); color: var(--error); }
.uncertain-fax-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.uncertain-fax-actions form { margin: 0; }
/* Likely matches on the report page: the same rows as the Cliniko search
   results, laid out in the page rather than floating under an input. */
.suggestion-list { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.suggestion-list .launcher-identity .reason { color: var(--brand-dark); font-size: 0.78rem; }
.report-detail-list { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 9px 13px; margin: 0; font-size: 0.82rem; }
.report-detail-list dt { color: var(--muted); }
.report-detail-list dd { margin: 0; color: var(--navy); }
/* Original attachments on a report page, one list per section. Not the
   two-column .report-detail-list grid, which squeezed list items into the
   92px label column. */
.report-file-group { margin: 12px 0 4px; font-size: 0.82rem; }
.report-file-list { margin: 0 0 8px; padding-left: 18px; font-size: 0.82rem; color: var(--navy); }
.report-file-list li { margin: 3px 0; }
.report-preview-card { margin: 0; }
.report-preview-card iframe { width: 100%; height: 790px; border: 1px solid var(--line); border-radius: 10px; background: #f3f4f5; }
.queue-mini-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 8px; }
.queue-mini-summary a {
  display: flex; flex-direction: column; padding: 9px 10px; border-radius: 9px;
  background: #f4f7f9; color: var(--navy); text-decoration: none;
}
.queue-mini-summary strong { font-size: 1.15rem; line-height: 1; }
.queue-mini-summary span { margin-top: 4px; color: var(--muted); font-size: 0.66rem; font-weight: 700; }
.queue-mini-summary a.attention { background: var(--error-bg); }
.queue-mini-summary a.attention strong { color: var(--error); }
.report-mini-status { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.report-mini-status.needs-fax { background: #cf9634; }
.report-mini-status.ready { background: var(--brand); }
.report-mini-status.failed { background: var(--error); }
.report-mini-status.sent { background: var(--green); }
.authority-confirmation {
  display: flex; align-items: flex-start; gap: 9px; margin: 14px 0;
  padding: 12px 14px; border: 1px solid #d7b25b; border-radius: 10px;
  background: var(--warn-bg); color: var(--navy); font-weight: 700;
}
.authority-confirmation input { margin-top: 3px; }
.gp-report-panel .panel-foot a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }

.account-row { min-height: 66px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.account-row:first-child { border-top: 0; }.account-copy { display: flex; flex-direction: column; min-width: 0; }
.account-copy strong { color: var(--navy); }.account-copy span { color: var(--muted); font-size: 0.74rem; }
.account-actions { display: flex; gap: 12px; align-items: center; }.account-actions a, .link-button { color: var(--brand-dark); font-size: 0.76rem; font-weight: 700; }
.link-button { appearance: none; border: 0; background: none; padding: 0; text-decoration: underline; cursor: pointer; }
.admin-link { font-size: 0.78rem; }

.login-page { padding: 24px; background: var(--canvas); background-image: radial-gradient(circle at top, #e6eef4, transparent 46%); }
.login-card { width: min(410px, 100%); padding: 38px; border-radius: 20px; box-shadow: 0 20px 55px rgba(16, 42, 67, 0.11); }
.login-card.mfa-setup-card { width: min(470px, 100%); }
.login-card.activation-card { width: min(640px, 100%); }
.mfa-qr { display: block; width: 220px; height: 220px; margin: 1rem auto; }
.mfa-secret { display: block; overflow-wrap: anywhere; margin: .65rem 0 1rem; }
.activation-card hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.activation-link-row { display: flex; gap: 10px; align-items: center; }
.activation-link-row input { flex: 1; min-width: 0; }
.login-emblem { width: 46px; height: 46px; margin-bottom: 22px; }
.login-card .eyebrow { margin-bottom: 6px; }.login-card h1 { margin: 0; color: var(--navy); font-size: 1.72rem; letter-spacing: -0.03em; }
.login-card .muted { margin: 7px 0 18px; }.login-card input { min-height: 47px; border-color: #c6d4dc; }
.login-fallback { margin: 18px 0 0; text-align: center; font-size: 0.78rem; }

@media (max-width: 1080px) {
  .snapshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-detail-layout { grid-template-columns: 1fr; }
  .roster-manager-bar { align-items: flex-start; flex-direction: column; }
  .roster-manager-bar .manager-actions { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-102%); transition: transform 200ms ease; box-shadow: 16px 0 40px rgba(16, 42, 67, 0.16); }
  .nav-open .sidebar { transform: none; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 90; display: block; visibility: hidden; background: rgba(16, 42, 67, 0.35); opacity: 0; transition: opacity 200ms ease, visibility 200ms; }
  .nav-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .workspace { margin-left: 0; }
  .mobile-header { height: 60px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-header strong { color: var(--navy); font-size: 0.88rem; }
  /* Push log out to the right edge so it is reachable without opening the nav. */
  .mobile-logout { margin: 0 0 0 auto; }
  .workspace .container { padding: 24px 18px 60px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .today-head, .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .today-head > .btn, .page-head > .btn { align-self: flex-start; }
  .snapshot-grid, .tool-grid, .quick-tools { grid-template-columns: 1fr; }
  .snapshot-card { min-height: 105px; }
  .launcher-input-wrap kbd { display: none; }
  .launcher-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .launcher-action { justify-content: center; text-align: center; }
  .toolbar { align-items: stretch; flex-direction: column; }.inline-search input { width: 100%; }
  .task-item { flex-wrap: wrap; }.task-item > .text-button { margin-left: 34px; }
  .history-list > div { flex-direction: column; gap: 2px; }.history-list span { text-align: left; }
  .shopping-add-card { grid-template-columns: 1fr; gap: 13px; }
  .shopping-add-error { grid-column: 1; margin: -6px 2px 0; }
  .shopping-item { grid-template-columns: 38px minmax(0, 1fr) 36px; padding: 11px 13px; }
  .shopping-ordered { grid-column: 2; width: fit-content; }
  .login-card { padding: 28px 23px; }
  .account-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .account-actions { grid-column: 2 / -1; }
  /* On a phone the label goes under the name, not beside it, so a long name has the full width. */
  .clinic-chiro-row .status-chip { grid-column: 2 / -1; justify-self: start; }
  .template-row { grid-template-columns: 1fr auto; }
  .report-queue-summary { grid-template-columns: repeat(2, 1fr); }
  .report-queue-toolbar { align-items: stretch; flex-direction: column; }
  .report-queue-toolbar .segmented { overflow-x: auto; }
  .detail-action-form { grid-template-columns: 1fr; }
  .roster-save-summary { align-self: flex-start; }
  .roster-dialog-actions { align-items: stretch; flex-direction: column; }
  .roster-dialog-actions .btn.danger { margin-left: 0; }
}
/* Letters and certificates */
.letter-layout { display: grid; grid-template-columns: minmax(380px, 0.9fr) minmax(460px, 1.1fr); gap: 17px; align-items: start; }
.letter-preview-card { margin: 0; position: sticky; top: 16px; }
.letter-preview { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 10px; background: #f3f4f5; }
.letter-preview-card .text-button { display: inline-block; margin-top: 9px; }
.letter-type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.letter-type {
  display: flex; flex-direction: column; gap: 5px; padding: 16px 17px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--navy); text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.letter-type:hover { border-color: #abc2d1; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.letter-type.active { border-color: var(--brand); background: var(--brand-pale); box-shadow: var(--shadow-sm); }
.letter-type strong { font-size: 0.95rem; }
.letter-type span { color: var(--muted); font-size: 0.76rem; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .letter-type { transition: none; } .letter-type:hover { transform: none; } }
.picklist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.picklist .btn { font-size: 0.72rem; }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; }
.checkbox-field > label { order: 2; margin-bottom: 0; font-weight: 600; }
.checkbox-field input[type="checkbox"] { order: 1; margin-top: 2px; }
.checkbox-field small { order: 3; flex-basis: 100%; margin-left: 25px; }
.signature-preview { display: block; max-width: 240px; max-height: 90px; margin: 6px 0 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.ai-draft-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.ai-draft-row .field-error { display: inline; }

/* Certificate of Capacity form: section headings, radio rows, phrase banks */
.form-section-heading {
  margin: 16px 0 10px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--navy); font-size: 0.92rem; font-weight: 800;
}
.form-field[data-widget="radio"] > div { display: flex; flex-wrap: wrap; gap: 7px; }
.form-field[data-widget="radio"] > div > div { display: contents; }
/* Option labels only: the field's own heading label must not become a chip. */
.form-field[data-widget="radio"] > div label {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.78rem; font-weight: 600; color: var(--navy); cursor: pointer;
  background: #fff;
}
.form-field[data-widget="radio"] > div label:has(input:checked) {
  border-color: var(--brand); background: var(--brand-pale); color: var(--brand-dark);
}
/* Capacity assessment grids: activities down the side, options as columns,
   like the printed form. A blank row means not assessed. */
.capacity-grid { border-collapse: collapse; width: 100%; margin-top: 2px; }
.capacity-grid thead th {
  padding: 2px 6px 5px; font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  text-align: center;
}
.capacity-grid thead th:first-child { text-align: left; }
.capacity-grid tbody tr { border-top: 1px solid var(--line); }
.capacity-grid tbody tr:nth-child(even) { background: #fafbfc; }
.capacity-grid tbody th {
  padding: 7px 6px; text-align: left; font-size: 0.8rem; font-weight: 600;
  color: var(--navy);
}
.capacity-grid td { padding: 3px 6px; text-align: center; }
.grid-cell { display: inline-flex; padding: 5px 12px; margin: 0; cursor: pointer; }
.grid-cell input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.grid-clear {
  border: 0; background: none; padding: 2px 7px; border-radius: 6px;
  color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer;
  visibility: hidden;
}
.grid-clear:hover { color: #b42318; background: #fdeeec; }
.capacity-grid tr.has-answer .grid-clear { visibility: visible; }
.phrase-region-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fafbfc;
}
.phrase-region-bar label { font-size: 0.78rem; font-weight: 700; color: var(--navy); margin: 0; }
.phrase-region-bar select { width: auto; }
.phrase-bank {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px;
}
.phrase-eyebrow {
  font-size: 0.64rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); margin-right: 2px;
}
.phrase-pill {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 0.75rem; line-height: 1.35; color: var(--navy);
  text-align: left; cursor: pointer;
}
.phrase-pill:hover { border-color: var(--brand); }
.phrase-pill.on {
  background: var(--brand-pale); border-color: var(--brand);
  color: var(--brand-dark); font-weight: 600;
}
.phrase-pill.on::before { content: "\2713\00a0"; }
.phrase-more {
  border: 1px dashed var(--line); background: none; border-radius: 999px;
  padding: 5px 12px; font-size: 0.72rem; color: var(--muted); cursor: pointer;
}
.phrase-more:hover { color: var(--brand-dark); border-color: var(--brand); }
.phrase-empty { font-size: 0.75rem; margin: 0; }
.char-counter { margin-top: 3px; text-align: right; font-size: 0.7rem; color: var(--muted); }
.char-counter.near { color: #b25e09; }
.char-counter.over { color: #b42318; font-weight: 700; }
.span-helper { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.span-helper .btn { font-size: 0.72rem; }
.email-preview {
  margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: #fafbfc; font: inherit; font-size: 0.86rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; color: var(--navy);
}
.status-chip.report-draft, .status-chip.report-pending { background: #eef2f4; color: #536979; }
.status-chip.report-issued, .status-chip.report-uploading { background: var(--brand-pale); color: var(--brand-dark); }
.status-chip.report-uploaded { background: var(--green-pale); color: var(--green); }
.status-chip.report-superseded { background: var(--warn-bg); color: var(--warn); }
.report-row.draft td:first-child { box-shadow: inset 3px 0 0 #9fb2bf; }
.report-row.issued td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.report-row.superseded td:first-child { box-shadow: inset 3px 0 0 #cf9634; }
.report-row.superseded { opacity: 0.72; }
@media (max-width: 1100px) {
  .letter-layout { grid-template-columns: 1fr; }
  .letter-preview-card { position: static; }
  .letter-preview { height: 560px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar, .sidebar-backdrop, .side-nav a, .btn, .roster-view-tabs a, .roster-plan-shift, .roster-shift-pill, .roster-quick-entry input, .shopping-item, .shopping-check-button { transition: none !important; }
}
@media print {
  .sidebar, .mobile-header, .quick-tools, .sidebar-backdrop { display: none !important; }
  .workspace { margin-left: 0; }
}

/* --- Suggestions ---------------------------------------------------------- */
.suggestion-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.suggestion-add-form textarea {
  width: 100%; min-height: 58px; padding: 10px 14px; border: 1px solid #b8cedc; border-radius: 11px;
  box-shadow: 0 1px 2px rgba(16, 42, 67, 0.04); font: inherit; font-size: 0.88rem; resize: vertical;
}
.suggestion-add-form textarea:focus { border-color: var(--brand); outline: 3px solid rgba(47, 111, 163, 0.15); }
.suggestion-add-form .btn { min-width: 82px; min-height: 48px; }
.suggestion-rows { display: flex; flex-direction: column; }
.suggestion-row { padding: 14px 19px; border-top: 1px solid #e4ebef; }
.suggestion-row:first-child { border-top: 0; }
.suggestion-row p { margin: 0 0 8px; color: var(--navy); font-size: 0.86rem; line-height: 1.5; }
.suggestion-row.sorted p { color: var(--muted); }
.suggestion-row footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.suggestion-row footer small { color: var(--muted); font-size: 0.7rem; }

/* --- Letters queue -------------------------------------------------------- */
.letter-table { min-width: 960px; }
.form-actions { align-items: center; }
.form-actions-delete { margin-left: auto; }
.btn.danger-ghost { color: var(--error); border-color: #e7b9b4; background: #fff; }
.btn.danger-ghost:hover { color: #fff; background: var(--error); border-color: var(--error); }

/* --- Insurance questionnaires --- */
.q-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.q-card-head h2 { margin: 0; }
.q-chip {
  display: inline-block; margin: 2px 4px 2px 0; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--line); background: #f4f7f9;
  color: var(--muted); font-size: 0.74rem; font-weight: 700; white-space: nowrap;
}
.q-chip.done { color: #14532d; background: #e8f6ee; border-color: #bfe3cd; }
.q-pick-list { display: flex; flex-direction: column; gap: 10px; }
.q-pick { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.q-pick:has(input:checked) { border-color: var(--brand); background: #f2f7fb; }
.q-pick input { margin-top: 3px; }
.q-pick strong { display: block; color: var(--navy); font-size: 0.9rem; }
.q-pick small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.74rem; }
.q-headline { margin: 4px 0 2px; font-size: 1.05rem; }
.q-band {
  margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: #eef2f4; color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
}
.q-change { font-weight: 600; }
.q-change.improved { color: #14532d; }
.q-change.worsened { color: var(--error); }
.q-change.unchanged { color: var(--muted); }
.om-switch { margin-bottom: 14px; }

/* Bring ups: the follow-up call list. One toolbar row of dropdowns keeps
   the filters calm; actions expand in place on the row, targets sized for
   a thumb on an iPad between patients. */
.bring-up-filters { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.bring-up-filters select, .filter-field select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line, #d5dbe3); border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
.bring-up-actions { margin-top: 8px; }
.bring-up-actions summary { display: inline-flex; cursor: pointer; list-style: none; }
.bring-up-actions summary::-webkit-details-marker { display: none; }
.bring-up-actions form { margin-top: 10px; display: grid; gap: 10px; min-width: 280px; }
.bring-up-actions input[name="note"] { padding: 10px 12px; border: 1px solid var(--line, #d5dbe3); border-radius: 8px; width: 100%; font: inherit; }
.bring-up-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bring-up-buttons .btn { min-height: 44px; }
.bring-up-table td { vertical-align: top; }
.bring-up-table .muted { font-size: 0.85rem; }
.bring-up-home-row { text-decoration: none; color: inherit; }
.bring-up-home-row:hover strong:first-child { text-decoration: underline; }

/* Roster availability: muted answer line at the top of each Edit-hours
   cell, and the manager's answer table on the Availability section. */
.roster-cell-avail { display: block; margin: -2px 0 5px; color: var(--green); font-size: 0.62rem; font-weight: 700; }
.roster-cell-avail.off { color: #98a6b0; }
.roster-cell.roster-cell-unavailable { background: #f6f7f8; }
.roster-cell.roster-cell-unavailable .roster-quick-entry input { background: #fbfbfb; }
.roster-availability-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; font-size: 0.78rem; }
.roster-availability-grid { min-width: 900px; }
.roster-avail-cell { padding: 12px 9px; text-align: center; font-size: 0.76rem; font-weight: 700; color: var(--navy); vertical-align: middle; font-variant-numeric: tabular-nums; }
.roster-avail-cell.yes { background: var(--green-pale); color: var(--green); }
.roster-avail-cell.no { color: #98a6b0; }
.roster-avail-cell.today { box-shadow: inset 0 2px 0 rgba(47, 111, 163, 0.4); }

/* Draft with AI dialog: the same card as the shift dialog plus a result
   block that replaces the inputs once the draft has landed. */
.roster-generate-replace { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 4px; font-size: 0.82rem; color: var(--navy); cursor: pointer; }
.roster-generate-replace input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.roster-generate-replace[hidden] { display: none; }
.roster-generate-result { padding: 12px 14px; border: 1px solid #b8d7c9; border-radius: 10px; background: var(--green-pale); }
.roster-generate-result p { margin: 0; color: var(--green); font-size: 0.84rem; font-weight: 700; }
.roster-generate-result ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.76rem; }
.roster-generate-result ul:empty { display: none; }

/* Clock in/out card on the CA's Today page and the Hours table. */
.clock-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 22px; margin-bottom: 18px; border-color: #bfd4e1; }
.clock-card.on { border-color: #93bea9; background: #f4faf7; }
.clock-card-copy h2 { margin: 2px 0 0; color: var(--navy); font-size: 1.15rem; }
.clock-card-copy .muted { margin: 4px 0 0; font-size: 0.8rem; }
.clock-status { margin: 8px 0 0; color: var(--green); font-size: 0.86rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock-card-form { margin: 0; }
.clock-button { min-width: 180px; min-height: 56px; font-size: 1.05rem; }
.clock-card-link { grid-column: 1 / -1; justify-self: start; color: var(--brand-dark); font-size: 0.78rem; font-weight: 700; }
.clock-now-line { color: var(--green); }
.roster-hours-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.roster-hours-table th, .roster-hours-table td { padding: 13px 14px; border-bottom: 1px solid #e4eaee; text-align: left; vertical-align: top; }
.roster-hours-table thead th { color: var(--muted); background: #f7f9fa; font-size: 0.67rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.roster-hours-table tbody th { width: 200px; font-weight: 400; }
.roster-hours-table tbody th > span:last-child { display: inline-flex; flex-direction: column; vertical-align: middle; }
.roster-hours-table tbody th strong { color: var(--navy); font-size: 0.82rem; }
.roster-hours-table tr:last-child th, .roster-hours-table tr:last-child td { border-bottom: 0; }
.hours-figure { color: var(--navy); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hours-figure strong { font-size: 0.95rem; }
.hours-diff { margin-left: 6px; font-size: 0.74rem; }
.hours-flag { margin-top: 2px; color: var(--warn); font-size: 0.64rem; font-weight: 700; }
.hours-days { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--muted); font-size: 0.72rem; font-weight: 600; white-space: normal; }
.hours-day { display: inline-flex; align-items: baseline; gap: 4px; }
.hours-day a { color: var(--brand-dark); text-decoration: none; border-bottom: 1px dotted currentColor; }
.hours-day.flagged a, .hours-day.flagged { color: var(--warn); }
.hours-day.open { color: var(--green); }
.hours-day small { font-size: 0.6rem; font-weight: 700; opacity: 0.8; }
.hours-note { margin-top: 10px; font-size: 0.74rem; }
@media (max-width: 640px) {
  .clock-card { grid-template-columns: 1fr; }
  .clock-button { width: 100%; }
}
.roster-emailed-note { font-size: 0.72rem; white-space: nowrap; }
.roster-people-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; align-items: start; }
.roster-people-grid .account-row.past { opacity: 0.6; }
@media (max-width: 900px) { .roster-people-grid { grid-template-columns: 1fr; } }

/* Bring ups v2: the call list (docs/bring-ups-v2-brief.md section 6). Every
   class here starts with bu-, because the mockup's own names (.row-copy,
   .who, .pill) already mean something else in this file. Everything that
   can be tapped is at least 44px high, for use on an iPad between
   patients. */
.bu-head { align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.bu-search {
  display: flex; align-items: center; gap: 8px; min-height: 46px; width: 280px; padding: 0 13px;
  border: 1px solid #bfcfd9; border-radius: 12px; background: #fff; color: var(--muted);
}
.bu-search[hidden] { display: none; }
.bu-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(47, 111, 163, 0.11); }
.bu-search svg, .bu-row .btn svg, .bu-pill svg {
  width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round;
}
/* 1rem, not smaller: iPad Safari zooms the page when a focused input is
   under 16px. */
.bu-search input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 1rem; color: var(--navy); background: transparent; }

.bu-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bu-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bu-chip {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 15px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--muted); font-size: 0.85rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.bu-chip:hover { border-color: #cadbe7; background: var(--brand-pale); }
.bu-chip b, .bu-seg-link b { margin-left: 7px; color: var(--navy); font-weight: 750; font-variant-numeric: tabular-nums; }
.bu-chip.is-on { border-color: var(--brand-dark); background: var(--brand-dark); color: #fff; }
.bu-chip.is-on b { color: #fff; }
.bu-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #e6ecf0; }
.bu-seg-link {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 8px;
  color: var(--muted); font-size: 0.85rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.bu-seg-link.is-on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(16, 42, 67, 0.08); }

/* Sticks to the top of the list, so Undo stays in reach after acting on a
   row far down the page. */
.bu-status {
  position: sticky; top: 0; z-index: 20; min-height: 52px; display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; padding: 4px 0; color: var(--muted); background: var(--canvas); font-size: 0.85rem;
}
.bu-status form { margin: 0; }
.bu-status .bu-undo { min-height: 44px; padding: 4px 16px; font-size: 0.85rem; }
.bu-status.is-error [data-bu-status-text] { color: var(--error); }

.bu-list { padding: 6px 22px 10px; }
.bu-sec[hidden] { display: none; }
.bu-sec-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; padding: 16px 0 8px; font-size: 0.85rem; }
.bu-sec-head h2 { margin: 0; font-size: 0.9rem; }
.bu-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: currentColor; }
.bu-tone-new .bu-dot, .bu-tone-new h2 { color: var(--error); }
.bu-tone-dropped .bu-dot, .bu-tone-dropped h2 { color: var(--warn); }
.bu-tone-due .bu-dot { color: var(--brand); }
.bu-tone-due h2 { color: var(--brand-dark); }

.bu-row { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #edf1f3; }
.bu-row[hidden] { display: none; }
/* The anchor of a no-JS redirect: keep the row clear of the status line. */
.bu-row:target { scroll-margin-top: 64px; }
.bu-copy { flex: 1; min-width: 0; }
.bu-top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.bu-name { color: var(--navy); font-size: 1rem; font-weight: 700; text-decoration: none; }
.bu-name:hover { color: var(--brand-dark); text-decoration: underline; }
.bu-who { padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.bu-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; white-space: nowrap; line-height: 1.4;
}
.bu-pill svg { width: 12px; height: 12px; }
.bu-story { margin-top: 2px; color: #33485a; font-size: 0.9rem; }
.bu-facts, .bu-attempt { color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }

.bu-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.bu-buttons { display: flex; gap: 7px; margin: 0; }
.bu-row .btn { gap: 6px; padding: 9px 14px; font-size: 0.88rem; touch-action: manipulation; }
/* Not on the row itself: opacity there would make the menu see-through. */
.bu-row.is-busy .bu-copy, .bu-row.is-busy .bu-buttons { opacity: 0.6; }
/* The flag button is an ordinary .btn, as wide as "Unflag" so the row's
   other buttons line up from row to row. Pressed, it turns blue, so a
   flagged row's button reads as on. */
.bu-flag-form { margin: 0; }
.bu-flag { min-width: 5.5em; }
.bu-flag[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-pale); color: var(--brand-dark); }
/* A short bar in the list's margin, so the flagged rows at the top of a
   section read as a group. It sits outside the row, so nothing moves. */
.bu-row.is-flagged::before {
  content: ""; position: absolute; top: 12px; bottom: 12px; left: -12px; width: 3px;
  border-radius: 3px; background: var(--brand);
}

/* The menu opens over the list and never pushes the row open. It works
   as a plain details element; the script only closes it on a click
   elsewhere and flips it upward near the bottom of the screen. */
.bu-more { position: relative; }
.bu-more > summary { list-style: none; cursor: pointer; }
.bu-more > summary::-webkit-details-marker { display: none; }
.bu-more[open] > summary { background: var(--brand-pale); border-color: #cadbe7; }
/* The house focus ring names button, a and input. A summary is none of them. */
.bu-more > summary:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.34); outline-offset: 2px; }
.bu-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 18px 40px rgba(16, 42, 67, 0.15);
}
.bu-more.is-up .bu-menu { top: auto; bottom: calc(100% + 6px); }
.bu-menu form { margin: 0; }
.bu-menu-item {
  display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px;
  background: none; color: var(--navy); font-size: 0.88rem; text-align: left; cursor: pointer;
  touch-action: manipulation;
}
.bu-menu-item:hover { background: var(--brand-pale); }
.bu-menu-item:disabled { opacity: 0.5; cursor: not-allowed; }
.bu-menu-rule { height: 1px; margin: 5px 4px; background: var(--line); }
.bu-note {
  width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 1rem;
}
.bu-note-save { margin-top: 4px; color: var(--brand-dark); font-weight: 700; }
.bu-error { margin: 5px 4px 2px; color: var(--error); font-size: 0.8rem; }
.bu-error[hidden] { display: none; }
.bu-empty { margin: 0; padding: 30px 0; text-align: center; }
.bu-empty[hidden] { display: none; }

/* The home card's count. */
.bu-count {
  min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--brand-dark); color: #fff;
  font-size: 0.78rem; font-weight: 750; text-align: center; font-variant-numeric: tabular-nums;
}

/* Rows stack below 1140px, not the mockup's 760px: the sidebar takes 252px,
   so a landscape iPad leaves the list about 700px, and the four buttons
   alone need about 390px. */
@media (max-width: 1140px) {
  .bu-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .bu-actions { flex-wrap: wrap; }
  .bu-buttons { flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .bu-head { align-items: stretch; }
  .bu-search { width: 100%; }
  .bu-list { padding: 4px 16px 8px; }
  /* On a phone the buttons wrap and the menu button can sit at either
     edge, so the menu hangs from the row and not from the button. */
  .bu-more { position: static; }
  .bu-menu { left: 0; right: auto; top: calc(100% - 8px); width: min(260px, 100%); }
  .bu-more.is-up .bu-menu { bottom: calc(100% - 8px); }
}
@media (max-width: 860px) {
  /* The mobile header scrolls with the page, so the status line can sit at the very top. */
  .bu-status { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bu-row .btn, .bu-chip, .bu-seg-link { transition: none; }
}
@media print {
  .bu-actions, .bu-status, .bu-search, .bu-toolbar { display: none !important; }
}

/* X-ray referral (referrals app): same field order as the old tool's form. */
/* Display rules below would otherwise beat the hidden attribute the page script toggles. */
.xray-referral [hidden] { display: none !important; }
.xray-referral .xray-step { margin-bottom: 14px; }
.xray-referral .xray-step h2 { margin: 0 0 12px; color: var(--navy); font-size: 1.05rem; }
.xray-referral h3 { margin: 0 0 6px; color: var(--navy); font-size: 0.9rem; }
.xray-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 28px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; font-size: 0.9rem; line-height: 1.35; cursor: pointer; }
.check-row input { margin-top: 3px; flex: none; }
.xray-single { margin-top: 24px; }
.xray-yes-no { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.xray-question { margin: 0 0 12px; padding: 0; border: 0; }
.xray-question legend { margin-bottom: 4px; padding: 0; font-size: 0.92rem; }
.xray-subhead { margin: 10px 0 4px; font-size: 0.85rem; font-weight: 700; color: var(--navy); }
.xray-urgent-when, .xray-date { max-width: 260px; margin: 8px 0 12px; }
.xray-required { color: var(--error); font-size: 0.85rem; font-weight: 600; }
.xray-sex-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; }
.xray-sex-pick .xray-required { flex-basis: 100%; }
.xray-patient-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 24px; margin: 0 0 12px; }
.xray-patient-grid dt { color: var(--muted); font-size: 0.78rem; }
.xray-patient-grid dd { margin: 2px 0 0; font-weight: 600; }
.xray-results { display: flex; flex-direction: column; gap: 6px; }
.xray-result { display: block; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.xray-result:hover, .xray-result:focus-visible { border-color: var(--brand); background: var(--brand-pale); }
.xray-unavailable { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.82rem; }
.xray-done h2 { color: var(--good); }
.xray-referral .form-actions { flex-wrap: wrap; }
/* Indication labels run "Pain/Neuro/Instability/..." with no spaces, so let them break on a phone. */
.xray-grid > * { min-width: 0; }
.check-row { overflow-wrap: anywhere; }

/* GP letter (correspondence app): the GP tool's form, step by step. */
/* Display rules below would otherwise beat the hidden attribute the page script toggles. */
.gp-letter [hidden] { display: none !important; }
.gp-letter .gp-step { margin-bottom: 14px; }
.gp-letter .gp-step h2 { margin: 0 0 12px; color: var(--navy); font-size: 1.05rem; }
.gp-letter h3 { margin: 0 0 6px; color: var(--navy); font-size: 0.9rem; }
.gp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; }
.gp-grid > * { min-width: 0; }
.gp-inline { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 8px; }
.gp-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; margin: 4px 0 10px; }
.gp-hint { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--brand-pale); color: var(--brand-dark); font-size: 0.72rem; font-weight: 700; }
.gp-label { margin: 10px 0 4px; color: var(--navy); font-size: 0.82rem; font-weight: 700; }
.gp-warn { padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 0.84rem; }
.gp-results { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.gp-result { display: block; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.gp-result:hover, .gp-result:focus-visible { border-color: var(--brand); background: var(--brand-pale); }
.gp-result.selected { border-color: var(--brand); background: var(--brand-pale); box-shadow: inset 3px 0 0 var(--brand); }
.gp-case-meta { display: block; margin-top: 2px; font-size: 0.82rem; }
.gp-badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #eef1f4; color: var(--navy); font-size: 0.72rem; font-weight: 700; }
.gp-patient-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 24px; margin: 0 0 12px; }
.gp-patient-grid dt { color: var(--muted); font-size: 0.78rem; }
.gp-patient-grid dd { margin: 2px 0 0; font-weight: 600; }
.gp-template-box { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfd; }
.gp-subhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.gp-option-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 7px; margin-top: 8px; }
.gp-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-align: left; font: inherit; font-size: 0.88rem; cursor: pointer; }
.gp-option:hover { border-color: var(--brand); }
.gp-option.active { border-color: var(--brand); background: var(--brand-pale); font-weight: 600; }
.gp-option-flag { display: none; color: var(--brand-dark); font-size: 0.72rem; font-weight: 700; }
.gp-option.active .gp-option-flag { display: inline; }
.gp-template-note { margin: 10px 0 0; font-size: 0.86rem; }
.gp-template-note strong { color: var(--error); }
.gp-draft textarea { background: #fbfdff; }
.gp-linkish { margin-left: 6px; padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: 0.78rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
.gp-required { margin: 14px 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.gp-required.is-invalid { border-color: var(--error); background: var(--error-bg); }
.gp-required-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 5px; }
.gp-required-head label { color: var(--navy); font-size: 0.82rem; font-weight: 700; }
.gp-required-text { color: var(--error); }
.gp-notes { margin-top: 6px; }
.gp-exam { margin-bottom: 8px; }
.gp-pair { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.gp-chip-field { margin: 0 0 10px; padding: 0; border: 0; }
.gp-chip-field legend { margin-bottom: 4px; padding: 0; color: var(--navy); font-size: 0.82rem; font-weight: 700; }
.gp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.gp-chip { min-height: 32px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 0.82rem; cursor: pointer; }
.gp-chip:hover { border-color: var(--brand); }
.gp-chip.active { border-color: var(--brand-dark); background: var(--brand-dark); color: #fff; }
.gp-chip.positive.active { border-color: var(--error); background: var(--error); }
.gp-recorded { margin-left: 6px; font-size: 0.68rem; font-weight: 700; opacity: 0.85; }
.gp-diagnosis { margin: 6px 0 8px; }
.gp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.gp-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--brand-pale); color: var(--navy); font-size: 0.8rem; }
.gp-tag button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; color: var(--muted); font: inherit; font-size: 0.75rem; cursor: pointer; }
.gp-dx-results { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; margin-top: -4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.gp-dx-results button { padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; font: inherit; font-size: 0.85rem; cursor: pointer; }
.gp-dx-results button:hover, .gp-dx-results button:focus-visible { background: var(--brand-pale); }
.gp-dx-results p { margin: 8px 10px; }
.gp-exam-section { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.gp-exam-section summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 12px; color: var(--navy); font-weight: 700; cursor: pointer; }
.gp-exam-section summary small { color: var(--muted); font-weight: 400; }
.gp-exam-body { padding: 0 12px 12px; }
.gp-rom-help { margin: 0 0 8px; font-size: 0.85rem; }
.gp-section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.gp-rom-panel { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.gp-rom-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gp-rom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 18px; }
.gp-rom-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 4px 8px; }
.gp-rom-row label { font-size: 0.85rem; }
.gp-rom-exact { grid-column: 2; display: flex; align-items: center; gap: 6px; }
.gp-rom-exact input { max-width: 110px; }
.gp-exam-grid { display: flex; flex-direction: column; gap: 6px; }
.gp-exam-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.gp-exam-label { font-size: 0.88rem; }
.gp-inline-note { display: block; margin: 4px 0 4px; }
.gp-deficit-adder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gp-deficit-adder select { min-width: 120px; }
.gp-unavailable { margin: 4px 0 10px; padding-left: 18px; color: var(--muted); font-size: 0.82rem; }
.gp-actions { flex-wrap: wrap; margin: 12px 0 6px; }
.gp-status { margin: 8px 0 0; }
@media (max-width: 560px) {
  .gp-rom-row { grid-template-columns: 1fr; }
  .gp-rom-exact { grid-column: 1; }
}

/* Team screen and My account */
.team-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.check-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.check-item:first-child { border-top: 0; }
.check-mark { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 0.8rem; font-weight: 800; }
.check-item.done .check-mark { background: var(--green-pale); color: var(--green); }
.check-item.todo .check-mark { background: var(--warn-bg); color: var(--warn); }
.check-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-copy strong { color: var(--navy); font-size: 0.92rem; }
.check-status { font-size: 0.85rem; overflow-wrap: anywhere; }
.check-item.todo .check-status { color: var(--warn); }
.check-copy small { color: var(--muted); font-size: 0.76rem; }
.team-choice { display: flex; gap: 18px; align-items: center; border: 0; padding: 0; margin: 0; }
.team-choice legend { margin-bottom: 6px; color: var(--navy); font-weight: 700; font-size: 0.9rem; }
.team-statement { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; }
.signature-draw { position: relative; height: 200px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.signature-draw canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.status-chip.setup-done { background: var(--green-pale); color: var(--green); }
.status-chip.setup-todo { background: var(--warn-bg); color: var(--warn); }
.field-error[hidden] { display: none; }

/* --- Scorecard ------------------------------------------------------------
   Recreates docs/scorecard-design/Team_Goals_Workshop.pdf. The navy, amber,
   blue and pale blue are the PDF's own. Its pill text, grey target text and
   box outline were a little too light for WCAG AA, so those three are
   darkened slightly here (pill 5.8:1, target text 4.7:1 on the week tint,
   box outline 3.1:1). */
.scorecard {
  --sc-navy: #0e2a47;
  --sc-hero-start: #0b2038;
  --sc-hero-end: #154373;
  --sc-amber: #f2a93b;
  --sc-blue: #2563eb;
  --sc-blue-text: #1d4ed8;
  --sc-pale: #e6f0ff;
  --sc-muted: #5f708a;
  --sc-rule: #e3eaf3;
  --sc-box: #7d8ea6;
  --sc-tint: #f4f7fb;
  max-width: 1080px;
}
.sc-sheet {
  padding: 26px clamp(18px, 3vw, 34px) 20px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: #fff;
  box-shadow: 0 1px 2px rgba(16, 42, 67, 0.035), 0 7px 22px rgba(16, 42, 67, 0.04);
}
.sc-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 18px; }
.sc-head-title { display: flex; align-items: center; gap: 12px; }
.sc-head h1 { margin: 0; color: var(--sc-navy); font-size: clamp(1.6rem, 2.3vw, 2.1rem); letter-spacing: -0.035em; line-height: 1.13; }
.sc-crumb { margin: 0 0 4px; font-size: 0.84rem; }
.sc-print-mark { display: none; width: 38px; height: 38px; }
.sc-range {
  margin: 0 0 4px; color: var(--sc-blue); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; text-align: right;
}

.sc-hero {
  position: relative; overflow: hidden; margin-bottom: 26px; padding: 26px 30px 28px;
  border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(100deg, var(--sc-hero-start) 0%, #0d2844 52%, var(--sc-hero-end) 100%);
}
/* The soft blue circle on the right of the PDF's hero card. */
.sc-hero::after {
  content: ""; position: absolute; top: 50%; left: 72%; width: 37%; aspect-ratio: 1;
  border-radius: 50%; background: rgba(37, 99, 235, 0.25); transform: translateY(-56%);
  pointer-events: none;
}
.sc-hero > * { position: relative; z-index: 1; }
.sc-hero-eyebrow {
  margin: 0 0 8px; color: var(--sc-amber); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.sc-hero-title { margin: 0; font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.sc-hero-copy { margin: 10px 0 0; max-width: 560px; color: #dbe5f1; font-size: 0.95rem; }

.sc-note { margin: -8px 0 22px; padding: 11px 15px; border-radius: 11px; background: var(--sc-pale); color: var(--sc-navy); font-size: 0.86rem; }
.sc-note.is-review { background: #fdf3e1; box-shadow: inset 4px 0 0 var(--sc-amber); padding-left: 19px; }

.sc-section { margin-bottom: 26px; }
.sc-section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.sc-section-head h2 {
  margin: 0; color: var(--sc-blue); font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.sc-pill {
  padding: 4px 12px; border-radius: 999px; background: var(--sc-pale); color: var(--sc-blue-text);
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}

.sc-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
/* :where keeps this reset weaker than the cell rules below. */
.sc-table :where(th, td) { padding: 0; }
.sc-table thead th {
  padding: 0 4px 9px; color: var(--sc-muted); font-size: 0.76rem; font-weight: 700;
  text-align: center; vertical-align: bottom; border-bottom: 2px solid var(--sc-navy);
}
.sc-table thead .sc-goal-head { width: 36%; padding-left: 14px; text-align: left; }
.sc-table thead .sc-hit-head { width: 84px; padding-right: 2px; text-align: right; }
.sc-table.is-monthly thead .sc-goal-head { width: 52%; }
.sc-table .sc-dates th, .sc-table .sc-dates td { padding: 7px 4px 2px; border-bottom: 0; font-size: 0.7rem; font-weight: 500; }
.sc-row th, .sc-row td { border-bottom: 1px solid var(--sc-rule); }
.sc-goal { padding: 12px 10px 12px 14px; text-align: left; font-weight: normal; }
.sc-goal strong { display: block; color: var(--sc-navy); font-size: 0.92rem; font-weight: 700; }
.sc-goal small { display: block; margin-top: 2px; color: var(--sc-muted); font-size: 0.76rem; }
.sc-row.is-priority .sc-goal { border-left: 4px solid var(--sc-amber); padding-left: 16px; }
.sc-cell { padding: 8px 4px; text-align: center; vertical-align: middle; }
.sc-table .is-current { background: var(--sc-tint); }
.sc-boxes { display: inline-flex; gap: 10px; }
.sc-hit { padding: 8px 2px 8px 6px; color: var(--sc-navy); text-align: right; white-space: nowrap; }
.sc-hit strong { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.sc-hit small { display: block; color: var(--sc-muted); font-size: 0.7rem; }

.sc-box-form { display: inline-flex; margin: 0; }
.sc-box {
  position: relative; width: 26px; height: 26px; display: inline-grid; place-items: center;
  padding: 0; border: 1.5px solid var(--sc-box); border-radius: 7px; background: #fff; color: #fff;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.sc-box svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.6);
  transition: opacity 150ms ease, transform 150ms ease;
}
.sc-box.is-ticked { background: var(--sc-blue); border-color: var(--sc-blue); }
.sc-box.is-ticked svg { opacity: 1; transform: none; }
button.sc-box { cursor: pointer; }
button.sc-box:hover { border-color: var(--sc-blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13); }
button.sc-box:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 2px; }
.sc-box.is-locked { opacity: 0.4; }
.sc-box-form.is-saving .sc-box { opacity: 0.6; }

.sc-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px;
  padding-top: 14px; border-top: 1px solid var(--sc-rule); color: var(--sc-muted); font-size: 0.74rem;
}
.sc-past-link { margin: 14px 4px 0; font-size: 0.84rem; }
.sc-past-link a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.sc-past-link a:hover { text-decoration: underline; }
.sc-toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 50; max-width: calc(100vw - 32px);
  padding: 11px 16px; border-radius: 11px; background: var(--sc-navy); color: #fff;
  font-size: 0.86rem; box-shadow: var(--shadow-lg); transform: translateX(-50%);
}
.sc-toast[hidden] { display: none; }

.sc-empty { display: grid; justify-items: center; gap: 6px; max-width: 560px; padding: 40px 28px; text-align: center; }
.sc-empty > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-pale); color: var(--brand-dark); }
.sc-empty svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sc-empty strong { color: var(--navy); }
.sc-empty small { color: var(--muted); font-size: 0.82rem; }
.sc-past { display: flex; flex-direction: column; max-width: 640px; padding: 6px 0; }
.sc-past a { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--navy); text-decoration: none; }
.sc-past a:first-child { border-top: 0; }
.sc-past a:hover { background: var(--brand-pale); }
.sc-past small { color: var(--muted); }

/* On a phone each goal becomes a card: title and target, then its row of
   boxes with the week above each one. */
@media (max-width: 620px) {
  .sc-sheet { padding: 0; border: 0; background: none; box-shadow: none; }
  .sc-head { flex-direction: column; align-items: flex-start; }
  .sc-range { text-align: left; }
  .sc-hero { padding: 22px 20px 24px; }
  .sc-hero-copy { font-size: 0.9rem; }
  .sc-table, .sc-table tbody { display: block; }
  .sc-table thead { display: none; }
  .sc-row {
    display: grid; grid-template-columns: repeat(var(--sc-cols), minmax(0, 1fr)); gap: 10px 2px;
    margin-bottom: 10px; padding: 14px 10px 8px; border: 1px solid var(--line);
    border-radius: var(--radius); background: #fff;
  }
  .sc-row th, .sc-row td { border-bottom: 0; }
  .sc-goal { grid-column: 1 / -1; grid-row: 1; padding: 0 70px 0 4px; }
  .sc-row.is-priority { box-shadow: inset 4px 0 0 var(--sc-amber); }
  .sc-row.is-priority .sc-goal { padding-left: 8px; border-left: 0; }
  .sc-hit { grid-column: 1 / -1; grid-row: 1; justify-self: end; align-self: start; padding: 0 2px; }
  .sc-hit small { display: inline; }
  .sc-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 8px; border-radius: 9px; }
  .sc-cell::before {
    content: attr(data-label) "\A" attr(data-date); white-space: pre; color: var(--sc-muted);
    font-size: 0.66rem; font-weight: 700; line-height: 1.3; text-align: center;
  }
  .sc-table.is-monthly .sc-cell::before { content: attr(data-label); }
  .sc-box { width: 30px; height: 30px; }
  /* A bigger touch target than the box itself. */
  button.sc-box::before { content: ""; position: absolute; inset: -7px; }
  .sc-foot { padding: 14px 4px 0; }
}

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

/* Printed on one A4 page for the end-of-block review, in the PDF's layout. */
@page scorecard { size: A4 portrait; margin: 12mm; }
@media print {
  .scorecard { page: scorecard; max-width: none; }
  .dashboard-body:has(.scorecard) { background: #fff; }
  .workspace .container { max-width: none; padding: 0; }
  .messages, .skip-link, .sc-crumb, .sc-past-link, .sc-toast { display: none !important; }
  .sc-sheet { padding: 0; border: 0; box-shadow: none; }
  .sc-print-mark { display: block; }
  .sc-hero, .sc-pill, .sc-note, .sc-box.is-ticked {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .sc-head { margin-bottom: 14px; }
  .sc-hero { margin-bottom: 18px; padding: 20px 26px 22px; }
  .sc-section { margin-bottom: 16px; break-inside: avoid; }
  .sc-section-head { margin-bottom: 8px; }
  .sc-table thead .sc-goal-head { width: 40%; }
  .sc-table thead .sc-hit-head { width: 62px; }
  .sc-table .sc-dates :where(th, td) { font-size: 0.66rem; white-space: nowrap; }
  .sc-table .sc-goal { padding-top: 7px; padding-bottom: 7px; }
  .sc-goal strong { font-size: 0.86rem; }
  .sc-goal small { font-size: 0.72rem; }
  .sc-table .sc-cell, .sc-table .sc-hit { padding-top: 5px; padding-bottom: 5px; }
  .sc-table .is-current { background: none; }
  .sc-box, .sc-box svg { transition: none; }
  .sc-box.is-locked { opacity: 1; }
  .sc-box.is-ticked { background: var(--sc-blue); border-color: var(--sc-blue); }
}

/* Pay calculator (pay app). */
.pay [hidden] { display: none !important; }
.pay h2 { margin: 0 0 12px; color: var(--navy); font-size: 1.05rem; }
.pay h2 small { margin-left: 6px; font-size: 0.8rem; font-weight: 400; }
.pay .card { margin-bottom: 16px; }
.pay .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.pay-tabs-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.pay-tabs-row .pay-tabs { margin-bottom: 18px; }
.pay-code-link { margin: 6px 0 18px auto; font-size: 0.85rem; font-weight: 600; }
.pay-code-card .field-error { display: block; margin: -6px 0 10px; }
.pay-code-later { margin-top: 10px; }
.pay-tabs a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.pay-tabs a.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pay-status { align-self: flex-start; display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.pay-status.is-submitted { background: var(--warn-bg); color: var(--warn); }
.pay-status.is-queried { background: var(--error-bg); color: var(--error); }
.pay-status.is-paid { background: var(--good-bg); color: var(--good); }
.pay-source { margin: -8px 0 16px; font-size: 0.85rem; }
.pay-due { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border-left: 4px solid var(--brand); }
.pay-due p { margin: 0; }
.pay-drift { font-size: 0.85rem; }
.pay-drift-tag { display: block; color: var(--brand-dark); font-size: 0.75rem; font-weight: 600; }

/* The remittance advice, laid out like its PDF. */
.pay-doc { padding: 24px; }
.pay-doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.pay-doc-head p { margin: 2px 0 0; font-size: 0.85rem; }
.pay-doc-title { margin: 0 !important; font-size: 1.5rem !important; letter-spacing: -0.01em; }
.pay-doc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 0.82rem; }
.pay-abn-warning { margin: 0 0 14px; font-weight: 600; }
.pay-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.pay-parties section { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--grey-bg); font-size: 0.85rem; }
.pay-parties h3, .pay-doc-section { margin: 0 0 4px; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pay-parties strong { color: var(--navy); font-size: 1rem; }
.pay-doc-facts { display: grid; gap: 6px; margin: 0 0 16px; font-size: 0.88rem; }
.pay-doc-facts div { display: flex; gap: 14px; }
.pay-doc-facts dt { width: 70px; flex: none; color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pay-doc-facts dd { margin: 0; }
.pay-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pay-tiles div { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--brand-pale); }
.pay-tiles span { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pay-tiles strong { display: block; margin-top: 4px; color: var(--navy); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.pay-doc-section { margin-top: 4px; color: var(--navy); font-size: 0.8rem; }
.pay-lines th { color: var(--ink); font-size: 0.92rem; text-transform: none; letter-spacing: 0; font-weight: 700; }
.pay-lines th small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.pay-lines td.num { color: var(--ink); font-size: 0.95rem; font-weight: 700; vertical-align: top; }
.pay-lines .is-total th, .pay-lines .is-total td.num { color: var(--navy); font-size: 1rem; font-weight: 800; }
.pay-sums { margin-top: 6px; }
.pay-sums th, .pay-sums td { padding: 3px 0; border: 0; color: var(--muted); font-size: 0.85rem; font-weight: 400; text-align: right; text-transform: none; letter-spacing: 0; }
.pay-sums td.num { width: 120px; color: var(--ink); font-weight: 700; }
.pay-sums small { font-size: 0.78rem; }
.pay-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(380px, 100%); margin: 10px 0 16px auto; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--brand); color: #fff; }
.pay-total span { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pay-total strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.pay-note { margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; }

/* The payment breakdown: a block per section in columns, as on the PDF. */
.pay-breakdown { font-size: 0.86rem; }
.pay-breakdown thead th { white-space: nowrap; }
.pay-breakdown th.num, .pay-breakdown td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-breakdown tbody th { color: var(--ink); font-weight: 400; text-transform: none; letter-spacing: 0; text-align: left; }
.pay-breakdown tbody th small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.78rem; }
.pay-breakdown .pay-section-head th { padding-top: 14px; border-bottom: 0; color: var(--navy); font-size: 0.9rem; font-weight: 800; }
.pay-breakdown .pay-line th { padding-left: 14px; }
.pay-breakdown .pay-line td.num { color: var(--ink); }
.pay-breakdown .pay-section-total th, .pay-breakdown .pay-section-total td { background: var(--grey-bg); color: var(--navy); font-weight: 700; }
.pay-breakdown .pay-section-total th { padding-left: 14px; }
.pay-xray-fields { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pay-xray-fields legend { padding: 0 4px; color: var(--navy); font-size: 0.85rem; font-weight: 700; }
.pay-xray-fields > p { margin: 0 0 8px; font-size: 0.82rem; }
.pay-query { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--error-bg); }
.pay-query p { margin: 4px 0 0; }

.pay-visits table { font-size: 0.85rem; }
.pay-visits tfoot th { text-align: left; color: var(--muted); font-weight: 600; }
.pay-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; margin: 4px 0 18px; }
.pay-actions form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pay-inline-form { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.pay-inline-form > span, .pay-inline-form > label:first-of-type:not(:has(input)) { width: 100%; color: var(--navy); font-size: 0.82rem; font-weight: 700; }
.pay-inline-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.pay-inline-form textarea { width: min(420px, 100%); }
.pay-days input, .pay-xrays input { width: 70px; }
.pay-adjust input[name=amount] { width: 110px; }
.pay-nav { display: flex; justify-content: space-between; gap: 12px; }
.pay-preview-tag { display: block; color: var(--warn); font-size: 0.75rem; font-weight: 600; }
.pay-table-wrap { overflow-x: auto; }
.pay-row-actions { display: flex; gap: 10px; }
.pay-footnote { margin: 10px 0 0; font-size: 0.8rem; }
.pay-payee-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.pay-settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pay-example { position: sticky; top: 16px; }
.pay-sample { margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.pay-sample legend { padding: 0 4px; color: var(--muted); font-size: 0.8rem; }
.pay-shown p { margin: 0 0 10px; }
.pay-print-mark { display: none; }
@media (max-width: 760px) {
  .pay-doc { padding: 16px; }
  .pay-parties, .pay-payee-fields { grid-template-columns: 1fr; }
  .pay-doc-meta { align-items: flex-start; }
  .pay-total { width: 100%; }
  .pay-wide-only { display: none; }
  .pay-everyone thead { display: none; }
  .pay-everyone tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .pay-everyone tr:last-child { border-bottom: 0; }
  .pay-everyone td { padding: 0; border: 0; }
  .pay-everyone td:first-child { grid-column: 1 / -1; }
  .pay-everyone td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
  .pay-everyone td.num { text-align: left; }
  .pay-settings-grid { grid-template-columns: 1fr; }
  .pay-example { position: static; }
}

/* Printing gives the advice alone on one A4 page; Download PDF gives the
   same advice on the clinic letterhead. */
@page pay { size: A4 portrait; margin: 14mm; }
@media print {
  .pay-statement { page: pay; font-size: 0.8rem; }
  .dashboard-body:has(.pay-statement) { background: #fff; }
  .workspace .container:has(.pay-statement) { max-width: none; padding: 0; }
  .pay-statement .page-head, .pay-tabs, .pay-actions, .pay-visits, .pay-nav, .pay-past, .pay-due, .no-print, .messages, .skip-link { display: none !important; }
  .pay-doc { padding: 0; border: 0; box-shadow: none; }
  .pay-parties section, .pay-tiles div, .pay-total, .pay-status, .pay-abn-warning, .pay-preview { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pay-parties { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pay-statement .table th, .pay-statement .table td { padding: 5px 6px; }
  .pay-breakdown { font-size: 0.72rem; }
  .pay-breakdown .pay-section-total th, .pay-breakdown .pay-section-total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pay-print-mark { display: block; margin-top: 8px; color: var(--muted); font-size: 0.7rem; }
}

/* --- Team screen (Administration): one list, one panel per person -------- */
.team-head .head-actions { align-items: center; }
.team-quiet { color: var(--brand-dark); font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.team-quiet:hover { text-decoration: underline; }

.team-todo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 14px; padding: 10px 14px;
  background: var(--warn-bg); border: 1px solid #f1dca6; border-radius: 10px; color: #5c3d00; font-size: 0.82rem; }
.team-todo strong { margin-right: 4px; }
.team-todo a { padding: 2px 10px; border: 1px solid #ead19a; border-radius: 999px; background: #fffaf0; color: #5c3d00; text-decoration: none; }
.team-todo a:hover { background: #fff; }
.team-todo-more { display: contents; }
.team-todo-more summary { cursor: pointer; color: #5c3d00; font-weight: 600; list-style: none; padding: 2px 6px; }
.team-todo-more summary::-webkit-details-marker { display: none; }

.team-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.team-toolbar .field-control { width: auto; min-height: 36px; }
.team-search { flex: 1 1 220px; max-width: 320px; }
.team-seg { display: inline-flex; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.team-seg button { appearance: none; border: 0; border-right: 1px solid var(--line); background: none; padding: 7px 12px;
  color: var(--muted); font: inherit; font-size: 0.82rem; cursor: pointer; }
.team-seg button:last-child { border-right: 0; }
.team-seg button span { margin-left: 3px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.team-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.team-list { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.team-list table { width: 100%; border-collapse: collapse; }
.team-list th { padding: 9px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; color: var(--muted);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
.team-list td { padding: 9px 14px; border-bottom: 1px solid #edf1f4; vertical-align: middle; font-size: 0.84rem; }
.team-list tr:last-child td { border-bottom: 0; }
.team-list tbody tr { cursor: pointer; }
.team-list tbody tr:hover { background: #f7fafc; }
.team-list tbody tr.selected { background: var(--brand-pale); }
.team-list tbody tr.is-left { opacity: 0.6; }
.team-who { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.team-who .user-avatar { flex: none; width: 30px; height: 30px; font-size: 0.75rem; }
.team-who strong { display: block; color: var(--navy); font-weight: 600; }
.team-who small { display: block; color: var(--muted); font-size: 0.74rem; }
.team-places { line-height: 1.9; }
.team-place { display: inline-block; margin: 0 4px 0 0; padding: 0 7px; border-radius: 6px; background: var(--grey-bg);
  font-size: 0.74rem; line-height: 1.6; white-space: nowrap; }
.team-place b { font-weight: 600; font-variant-numeric: tabular-nums; }
.team-place.pending { background: var(--warn-bg); color: var(--warn); }
.team-role { color: var(--ink); }
.team-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.team-dot { width: 7px; height: 7px; border-radius: 50%; background: #b8c4cc; }
.team-dot.good { background: #2f9e64; }
.team-dot.warn { background: #d99a16; }
.team-chev { width: 24px; color: #a7b3bb; text-align: right; }
.team-empty { margin: 0; padding: 24px; text-align: center; }

/* The panel: fixed on the right on a laptop, the whole screen on a phone. */
.team-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(16, 42, 67, 0.18); }
.team-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; display: flex; flex-direction: column;
  width: min(480px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 30px rgba(16, 33, 52, 0.08); }
body.team-panel-open { overflow: hidden; }
.team-panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.team-panel-head .user-avatar { flex: none; width: 40px; height: 40px; }
.team-panel-title { flex: 1; min-width: 0; }
.team-panel-title h2 { margin: 0; color: var(--navy); font-size: 1.15rem; outline: none; }
.team-panel-title p { margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; }
.team-close, .team-menu summary { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  color: var(--muted); font-size: 1.3rem; line-height: 1; text-decoration: none; cursor: pointer; list-style: none; }
.team-menu summary::-webkit-details-marker { display: none; }
.team-close:hover, .team-menu summary:hover, .team-menu[open] summary { background: var(--grey-bg); }
.team-menu { position: relative; }
.team-menu-list { position: absolute; top: 40px; right: 0; z-index: 2; min-width: 230px; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 33, 52, 0.12); }
.team-menu-list a, .team-menu-list button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px;
  background: none; color: var(--ink); font: inherit; font-size: 0.84rem; text-align: left; text-decoration: none; cursor: pointer; }
.team-menu-list a:hover, .team-menu-list button:hover { background: var(--grey-bg); }
.team-menu-list button.danger { color: var(--error); }
.team-menu-list hr { margin: 4px 0; border: 0; border-top: 1px solid #edf1f4; }
.team-menu-note { margin: 0; padding: 6px 10px; color: var(--muted); font-size: 0.76rem; }
.team-panel-body { flex: 1; overflow-y: auto; padding: 4px 20px 24px; -webkit-overflow-scrolling: touch; }
.team-panel-body .messages { margin: 12px 0 0; }
.team-panel-foot { margin: 0; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; }

.team-sec { padding: 14px 0; border-bottom: 1px solid #edf1f4; }
.team-sec:last-child { border-bottom: 0; }
.team-sec h3 { margin: 0; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.team-sec p { margin: 6px 0 10px; font-size: 0.84rem; }
.team-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.team-setup summary { cursor: pointer; list-style: none; margin-bottom: 4px; }
.team-setup summary::-webkit-details-marker { display: none; }
.team-setup summary h3::after { content: " \25BE"; }
.team-setup .team-checklist { margin-top: 6px; }
.team-edit { appearance: none; border: 0; background: none; padding: 4px 0; color: var(--brand-dark); font: inherit;
  font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.team-facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 0.84rem; }
.team-facts dt { color: var(--muted); }
.team-facts dd { margin: 0; }
.team-prints, .team-hint { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; }
.team-prints b { color: var(--ink); font-weight: 600; }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-grid > div label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.76rem; }
.team-grid .wide { grid-column: 1 / -1; }
.team-grid small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.74rem; }
.team-actions { display: flex; gap: 8px; margin-top: 12px; }
.team-switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 8px 0;
  border-top: 1px solid #edf1f4; cursor: pointer; }
.team-switch strong { display: block; font-size: 0.84rem; font-weight: 600; }
.team-switch small { display: block; color: var(--muted); font-size: 0.74rem; }
.team-switch input[type="checkbox"] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 38px; height: 22px;
  min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 999px; background: #cfd8de; cursor: pointer; transition: background 0.15s; }
.team-switch input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.team-switch input[type="checkbox"]:checked { background: var(--good); }
.team-switch input[type="checkbox"]:checked::after { transform: translateX(16px); }
.team-switch input[type="checkbox"]:focus-visible { outline: 3px solid rgba(47, 111, 163, 0.3); outline-offset: 2px; }
.team-num-row { display: grid; grid-template-columns: 1fr 150px 32px; gap: 8px; align-items: center; margin-bottom: 6px; }
.team-num-row label { font-size: 0.86rem; }
.team-num-row .field-control.pending { border-style: dashed; }
.team-x { appearance: none; width: 32px; height: 32px; border: 0; border-radius: 7px; background: none; color: #a7b3bb;
  font-size: 1.1rem; cursor: pointer; }
.team-x:hover { background: var(--error-bg); color: var(--error); }
.team-add-row { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; margin-top: 12px; }
.team-sig { display: grid; place-items: center; height: 90px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fcfdfd; }
.team-sig img { max-width: 100%; max-height: 72px; }
.team-sig.none { border-style: dashed; color: var(--muted); font-size: 0.84rem; }
.team-sig-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.team-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.team-upload input[type="file"] { max-width: 220px; font-size: 0.78rem; }
.team-panel-body .card { margin: 14px 0 0; padding: 0; border: 0; box-shadow: none; background: none; }

@media (max-width: 760px) {
  .team-list thead { display: none; }
  .team-list tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 14px; border-bottom: 1px solid #edf1f4; }
  .team-list td { padding: 0; border: 0; }
  .team-list td.team-places { grid-column: 1 / -1; padding-left: 40px; }
  .team-list td:nth-child(3) { padding-left: 40px; }
  .team-list td.team-chev { display: none; }
  .team-search { max-width: none; }
  .team-panel { width: 100%; border-left: 0; }
  .team-grid, .team-add-row { grid-template-columns: 1fr; }
  .team-num-row { grid-template-columns: 1fr 120px 32px; }
}

/* --- Explore Pracora (one sidebar link, one page) and Powered by Pracora -- */
.nav-explore { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.powered-by { margin: 0 0 8px; padding: 0 10px; color: #8796a3; font-size: 0.7rem; letter-spacing: 0.02em; }
.explore-page { max-width: 980px; }
.explore-group { margin-top: 26px; }
.explore-group h2 { margin: 0 0 10px; color: var(--muted); font-size: 0.74rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; }
.explore-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); }
.explore-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start;
  padding: 14px 18px; border-top: 1px solid var(--line); }
.explore-row:first-child { border-top: 0; }
.explore-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--brand-pale); color: var(--navy); }
.explore-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.explore-copy h3 { margin: 0; color: var(--navy); font-size: 0.98rem; line-height: 1.3; }
.explore-copy p { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.explore-copy details { margin-top: 2px; }
.explore-copy summary { display: inline-block; padding: 4px 0; color: var(--brand-dark); font-size: 0.8rem;
  font-weight: 700; cursor: pointer; }
.explore-copy details p { max-width: 640px; margin: 2px 0 4px; color: var(--ink); }
.explore-have { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; color: var(--good);
  font-size: 0.86rem; font-weight: 700; }
.explore-have svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.explore-send { margin-top: 30px; }
.explore-send h2 { margin: 0 0 6px; color: var(--navy); font-size: 1.2rem; }
.explore-send > .muted { max-width: 620px; margin: 0 0 12px; }
.help-address { margin: 0; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.help-address a { color: var(--brand-dark); }
/* Help and contact (SUPPORT_EMAIL): one panel in three parts, then a link row. */
.help-page { max-width: 720px; display: flex; flex-direction: column; gap: 18px; }
.help-panel { padding: 0; overflow: hidden; }
.help-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 24px; }
.help-icon { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; }
.help-icon svg { width: 24px; height: 24px; }
.help-who { flex: 1 1 220px; min-width: 0; }
.help-who h2 { margin: 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.help-who .help-address { margin-top: 1px; font-size: 1.3rem; letter-spacing: -0.01em; }
.help-who .help-address a { color: var(--navy); text-decoration: none; }
.help-who .help-address a:hover { text-decoration: underline; }
.help-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.help-actions .btn { gap: 7px; font-weight: 700; text-decoration: none; }
.help-actions .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.help-actions [hidden] { display: none; }
.help-tell { padding: 20px 24px 22px; border-top: 1px solid var(--line); }
.help-tell h2 { margin: 0 0 10px; color: var(--navy); font-size: 0.95rem; }
.help-tell ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.help-tell li { display: flex; align-items: flex-start; gap: 10px; color: var(--ink); font-size: 0.94rem; }
.help-num { flex: 0 0 22px; height: 22px; margin-top: 1px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--brand-pale); color: var(--navy); font-size: 0.75rem; font-weight: 800; }
.help-privacy { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 24px;
  border-top: 1px solid var(--line); background: var(--canvas); color: var(--ink); font-size: 0.9rem; font-weight: 650; }
.help-privacy svg { flex: 0 0 19px; width: 19px; height: 19px; fill: none; stroke: var(--brand-dark); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.help-explore { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.help-explore:hover { border-color: var(--brand); }
.help-explore .explore-icon { flex: 0 0 40px; }
.help-explore-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.help-explore-copy strong { color: var(--navy); font-size: 0.98rem; line-height: 1.3; }
.help-explore-copy span { color: var(--muted); font-size: 0.88rem; }
.help-chevron { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: var(--brand-dark); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) {
  .explore-row { grid-template-columns: 40px minmax(0, 1fr); padding: 14px; }
  .explore-have { grid-column: 2; }
  .help-top { padding: 20px 18px; }
  .help-tell { padding: 18px 18px 20px; }
  .help-privacy { padding: 14px 18px; }
  .help-actions { flex-basis: 100%; }
}
@media (pointer: coarse) {
  .explore-copy summary { min-height: 44px; display: inline-flex; align-items: center; }
}

/* --- Touch screens (iPad, phone): finger-sized ticks on the referral ----- */
/* Only for coarse pointers, so a laptop's referral page is unchanged. */
@media (pointer: coarse) {
  .xray-referral .check-row { min-height: 40px; align-items: center; padding: 4px 0; gap: 12px; }
  .xray-referral .check-row input[type="checkbox"],
  .xray-referral .check-row input[type="radio"],
  .xray-referral input[data-authority],
  .team-statement input[type="checkbox"] { width: 22px; height: 22px; margin: 0; }
  .xray-referral .xray-result { min-height: 48px; }
}

/* ==========================================================================
   New look (NEW_LOOK_ENABLED). Slice one: the sign-in screens.

   Everything here is scoped under .auth-page, the <body> class of
   templates/staff/new_look/auth_base.html, so nothing above changes and a
   clinic with the switch off sees no difference.

   The --nl- values are the shared ones for the whole redesign. Later slices
   should use these rather than repeat a colour or a size.
   ========================================================================== */
:root {
  --nl-page: #FAFAF7;            /* page background */
  --nl-navy: #12304F;            /* headings and the primary button */
  --nl-navy-dark: #0c2238;       /* primary button, hover */
  --nl-ink: #172b3a;             /* body text and labels */
  --nl-muted: #5E6B78;           /* lead text and hints */
  --nl-link: #21547d;            /* links and the eyebrow */
  --nl-border: #c6d4dc;          /* inputs and outline buttons */
  --nl-rule: #dce4e9;            /* dividers */
  --nl-banner-bg: #EEF3F8;       /* information banner */
  --nl-error-bg: #fdecea;
  --nl-error-ink: #8a1f17;
  --nl-radius-control: 12px;     /* inputs and buttons */
  --nl-radius-message: 10px;
  --nl-control-height: 52px;     /* inputs */
  --nl-button-height: 53px;
  --nl-column: 380px;            /* the sign-in column */
  --nl-gutter: 24px;             /* side padding on a narrow screen */
}

/* Page: one centred column, no card. The footer is the last item in the
   column rather than fixed to the screen, so the iPad keyboard cannot push
   it over the form. 100dvh is the visible height in Safari; 100vh is the
   fallback for older browsers. */
.auth-page {
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; min-height: 100dvh; margin: 0; padding: 0;
  background: var(--nl-page); color: var(--nl-ink); line-height: 1.5;
}
.auth-column {
  flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center;
  width: min(var(--nl-column), 100% - 2 * var(--nl-gutter));
  padding: 32px 0; text-align: center;
}
.auth-column.wide { --nl-column: 420px; }
.auth-column.wider { --nl-column: 440px; }

/* Headings and text */
.auth-emblem {
  display: block; width: 40px; height: 40px; margin: 0 auto 22px;
  object-fit: contain; mix-blend-mode: multiply;
}
.auth-emblem.large { width: 60px; height: 60px; margin-bottom: 20px; }
.auth-page h1 {
  margin: 0; color: var(--nl-navy); font-size: 30px; font-weight: 800;
  line-height: 1.12; letter-spacing: -0.03em; overflow-wrap: anywhere;
}
.auth-page h1.auth-clinic { font-size: 34px; line-height: 1.1; letter-spacing: -0.035em; }
.auth-product { margin: 10px 0 40px; color: var(--nl-muted); font-size: 17px; font-weight: 500; }
.auth-page .eyebrow { margin: 0 0 8px; color: var(--nl-link); font-size: 11.5px; }
.auth-page .muted { margin: 10px 0 20px; color: var(--nl-muted); font-size: 16px; line-height: 1.5; }
.auth-page h2 { margin: 0; color: var(--nl-navy); font-size: 20px; letter-spacing: -0.02em; }
.auth-page h2 + .muted { margin: 8px 0 18px; font-size: 15px; }
.auth-page hr { margin: 30px 0 26px; border: 0; border-top: 1px solid var(--nl-rule); }
.auth-page a { color: var(--nl-link); }
.auth-page a:hover { color: var(--nl-navy); }

/* Fields */
.auth-page form { margin: 0; }
.auth-page label, .auth-page .form-field > label {
  display: block; margin: 16px 0 6px; color: var(--nl-ink);
  font-size: 14px; font-weight: 600; text-align: left;
}
.auth-page form > label:first-of-type { margin-top: 0; }
.auth-page input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  display: block; width: 100%; height: var(--nl-control-height); min-height: 0; padding: 0 14px;
  border: 1px solid var(--nl-border); border-radius: var(--nl-radius-control);
  background: #fff; color: var(--nl-ink); font-size: 16px;
}
.auth-page input:focus { border-color: var(--nl-navy); }
.auth-page input:disabled { background: #f1f4f6; }
/* Six-digit and pay codes. Matched by inputmode, so the forms need no class. */
/* The three :not()s only lift this above the input rule just before it. */
.auth-page input[inputmode="numeric"]:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  text-align: center; font-size: 24px; font-weight: 600;
  letter-spacing: 0.4em; font-variant-numeric: tabular-nums;
}
.auth-page .form-field small { display: block; margin-top: 5px; color: var(--nl-muted); font-size: 13px; text-align: left; }
.auth-page .form-field small ul { margin: 0; padding-left: 18px; }
.auth-page .field-error { display: block; margin: 6px 0 0; color: var(--nl-error-ink); font-size: 13px; text-align: left; }

/* Buttons: solid navy is the main action, white with a border the second. */
.auth-page .btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: var(--nl-button-height); margin-top: 22px; padding: 8px 16px;
  border: 1px solid var(--nl-border); border-radius: var(--nl-radius-control);
  background: #fff; color: var(--nl-navy);
  font-size: 16px; font-weight: 600; text-decoration: none; white-space: normal;
}
.auth-page .btn:hover { background: var(--nl-banner-bg); color: var(--nl-navy); }
.auth-page .btn.primary { border-color: var(--nl-navy); background: var(--nl-navy); color: #fff; }
.auth-page .btn.primary:hover { border-color: var(--nl-navy-dark); background: var(--nl-navy-dark); color: #fff; }
.auth-page a.btn { margin-top: 0; }
.auth-page .pay-code-later .btn { margin-top: 10px; }

/* Passkeys: while the passkey button shows it is the main action, so the
   password "Sign in" under it becomes the outline button. passkeys.js shows
   the block by removing its hidden attribute. */
.auth-page .passkey-signin { margin: 0; }
.auth-page .passkey-signin .btn { margin-top: 0; }
.auth-page .passkey-signin svg { width: 20px; height: 20px; }
.auth-page .passkey-error { min-height: 0; margin: 8px 0 0; color: var(--nl-error-ink); font-size: 13px; }
.auth-page .passkey-or { margin: 20px 0 16px; color: var(--nl-muted); font-size: 13px; }
.auth-page .passkey-or::before, .auth-page .passkey-or::after { background: var(--nl-rule); }
.auth-page .passkey-signin:not([hidden]) ~ form .btn.primary { border-color: var(--nl-border); background: #fff; color: var(--nl-navy); }
.auth-page .passkey-signin:not([hidden]) ~ form .btn.primary:hover { background: var(--nl-banner-bg); }

/* Secondary lines and links under the button */
.auth-hint { margin: 18px 0 0; color: var(--nl-muted); font-size: 14px; }
.auth-page .login-fallback { margin: 18px 0 0; font-size: 14px; text-align: center; }
.auth-page .login-fallback + .login-fallback { margin-top: 10px; }

/* Messages */
.auth-banner {
  flex: none; width: 100%; margin: 0; padding: 12px 24px;
  background: var(--nl-banner-bg); color: var(--nl-navy); font-size: 14.5px; text-align: center;
}
.auth-page .msg.error {
  margin: 0 0 16px; padding: 11px 14px; border-radius: var(--nl-radius-message);
  background: var(--nl-error-bg); color: var(--nl-error-ink); font-size: 14.5px; text-align: left;
}
.auth-page .msg.error ul { margin: 0; padding: 0; list-style: none; }
.auth-messages { width: 100%; }
.auth-page .auth-messages .msg {
  margin: 0 0 16px; padding: 11px 14px; border-radius: var(--nl-radius-message);
  font-size: 14.5px; text-align: left;
}

/* Authenticator pairing */
.auth-page .mfa-qr { width: 168px; height: 168px; margin: 0 auto; border-radius: var(--nl-radius-control); background: #fff; }
.auth-page details { margin: 12px 0 22px; font-size: 14px; }
.auth-page summary { display: inline-block; color: var(--nl-link); text-decoration: underline; cursor: pointer; list-style: none; }
.auth-page summary::-webkit-details-marker { display: none; }
.auth-page details .muted { margin: 10px 0 0; font-size: 14px; }
.auth-page .mfa-secret { margin: 6px 0 0; }
.auth-page .mfa-same-device { margin: 12px 0 0; font-size: 14px; }
.auth-page .mfa-same-device a { color: var(--nl-link); }
.auth-page .mfa-same-device + details { margin-top: 8px; }
.auth-page .mfa-copy { margin-top: 10px; }

/* Powered by Pracora: the lockup at the foot of every sign-in screen and,
   smaller, at the foot of the sidebar. */
.auth-powered-by { flex: none; margin: 0 0 30px; line-height: 0; }
.auth-powered-by img { display: block; width: auto; height: 18px; }
.powered-by.powered-by-lockup { margin-bottom: 10px; line-height: 0; }
.powered-by-lockup img { display: block; width: auto; height: 16px; }
