/* 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; align-items: center; justify-content: center; color: #fff;
  background: var(--navy); border-radius: 10px;
}
.brand-mark { width: 37px; height: 37px; }
.brand-mark svg, .login-emblem svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* 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-divider { height: 1px; margin: 10px 8px; background: var(--line); }
.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: 8px 11px; border: 1px solid var(--line); border-radius: 9px;
  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-toolbar { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.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-view-tabs {
  width: fit-content; display: flex; gap: 3px; margin: 0 auto 16px; padding: 4px;
  border: 1px solid var(--line); border-radius: 11px; background: #eaf0f3;
}
.roster-view-tabs a {
  min-height: 40px; display: inline-flex; align-items: center; padding: 8px 15px;
  border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.78rem;
  font-weight: 700; transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.roster-view-tabs a:hover { color: var(--navy); background: rgba(255, 255, 255, 0.56); }
.roster-view-tabs a.active { color: var(--navy); background: #fff; box-shadow: var(--shadow-sm); }
.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; }
.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-quick-entry { display: grid; grid-template-columns: minmax(0, 1fr) 29px; gap: 4px; margin-top: 6px; }
.roster-quick-entry input {
  min-width: 0; width: 100%; height: 31px; padding: 5px 7px; 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: 29px; 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-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; }
.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-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; }

/* 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;
  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 { 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 {
  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 { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: transform 180ms ease; }
.task-details-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; gap: 9px; padding: 11px 13px; }
}

.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; }
.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-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; }
.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); }
.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; }
  .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-fill, minmax(210px, 1fr)); gap: 10px; }
.letter-type {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--navy); text-decoration: none;
}
.letter-type:hover, .letter-type.active { border-color: var(--brand); background: var(--brand-pale); }
.letter-type strong { font-size: 0.95rem; }
.letter-type span { color: var(--muted); font-size: 0.74rem; }
.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; }
.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; }
}
