/* ===== Dreamer Healthcare — Service Documentation =====
   Design direction "Calm Clinical" (2026-09-04): self-hosted Manrope for headings /
   numbers, Inter for body (the CSP blocks Google Fonts, so both live in vendor/fonts),
   18px squircle cards on a mint-tinted ground, brand teal for chrome, the logo's green
   for the ONE primary action, line icons instead of emoji in navigation. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("vendor/fonts/manrope-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("vendor/fonts/inter-latin.woff2") format("woff2"); }
:root {
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --ink: #14212b;
  --ink-soft: #44546a;
  --muted: #6b7a90;
  --line: #e2ebe9;
  --brand: #1f7a8c;
  --brand-dark: #155e6b;
  --brand-x: #0e4651;
  --brand-soft: #e4f2f3;
  --accent: #2a9d8f;
  --green: #5aa832;
  --green-dark: #3d7a1e;
  --green-soft: #e9f5e1;
  --danger: #d64545;
  --danger-soft: #fbe7e7;
  --warn: #e39b2b;
  --warn-soft: #fdf3e2;
  --ok: #2f9e6f;
  --ok-soft: #e3f4ec;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20,40,60,.05), 0 8px 24px rgba(20,60,70,.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-family: var(--font-head); letter-spacing: -.01em; }

/* ===== Buttons =====
   Primary = green ("go"). Teal stays the brand/chrome color: ghost + soft buttons, links,
   active navigation. Danger unchanged. */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; border-radius: 12px;
  padding: 11px 18px; background: var(--green); color: #fff;
  box-shadow: 0 4px 14px rgba(90,168,50,.22);
  transition: filter .15s, background .15s, border .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { filter: brightness(.96); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--brand-dark); border-color: var(--line); box-shadow: none; font-weight: 600; }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); box-shadow: none; font-weight: 600; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; display: block; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Login ===== */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f7a8c 0%, #155e6b 60%, #0e4651 100%);
  padding: 24px;
}
.login-card {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  padding: 36px; width: 100%; max-width: 460px;
}
.login-card h2 { margin-top: 18px; }
.staff-login-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.staff-pick {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; font: inherit; transition: .15s;
}
.staff-pick:hover { border-color: var(--brand); background: var(--brand-soft); }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; }

/* ===== Brand ===== */
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 20px; margin: 0; }
.brand .tagline { margin: 0; font-size: 13px; color: var(--muted); }
.brand-mark {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.brand-logo {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  object-fit: cover;
}
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}

/* ===== Annual MUI Report table ===== */
.mui-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.mui-table th { background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; padding: 7px 8px; text-align: center; }
.mui-table th:first-child { text-align: left; }
.mui-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.mui-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.mui-table tfoot td { font-weight: 700; background: var(--brand-soft); border-top: 2px solid var(--brand); }
.mui-table input { padding: 4px 6px; }

/* ===== Missing-field validation highlight ===== */
.field-invalid > label,
.field-invalid label:first-child { color: var(--danger); font-weight: 700; }
.field-invalid input,
.field-invalid select,
.field-invalid textarea {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px var(--danger-soft);
  background: #fff;
}
.field-invalid::after {
  content: "Required"; display: inline-block; margin-top: 4px;
  font-size: 11px; font-weight: 700; color: var(--danger);
}
/* Lighter outline for non-field targets (a goals list, a whole section, a checkbox). */
.flash-required {
  outline: 2px solid var(--danger); outline-offset: 4px; border-radius: 10px;
}

/* ===== App shell ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: 0 6px; }
.sidebar-brand strong { display: block; font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-btn {
  text-align: left; font: inherit; font-weight: 500; font-size: 14px;
  padding: 10px 12px; border-radius: 12px; border: none; background: transparent;
  color: var(--ink-soft, #44546a); cursor: pointer; transition: .12s;
  display: flex; align-items: center; gap: 11px;
}
.nav-btn:hover { background: var(--surface-2); }
.nav-btn.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
/* Line icons (set by App._applyNavIcons) — inherit color so the active state tints them. */
.nav-btn .nav-ico, .mob-btn .nav-ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.mob-btn .nav-ico { width: 22px; height: 22px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.sidebar-foot .who { font-weight: 600; margin-bottom: 8px; font-size: 14px; }

.content { flex: 1; padding: 30px 38px; max-width: 1100px; }

/* ===== Page header ===== */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ===== Cards / grid ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat { padding: 16px 18px; }
.stat.stat-click { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.stat.stat-click:hover { box-shadow: 0 6px 18px rgba(20,60,70,.10); transform: translateY(-1px); }
.stat .num { font-size: 30px; font-weight: 800; color: var(--brand-dark); font-family: var(--font-head); letter-spacing: -.02em; line-height: 1.1; }
.stat .num.warn-num { color: var(--warn); }
.stat .num.danger-num { color: var(--danger); }
.stat .num.ok-num { color: var(--green-dark); }

/* ===== Dashboard hero (Calm Clinical) ===== */
.dash-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 55%, var(--brand-x) 100%);
  color: #fff; border-radius: 22px; padding: 22px 24px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(14,70,81,.18);
}
.dash-hero::after { content: ""; position: absolute; right: -70px; bottom: -110px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.dash-hero h2 { color: #fff; font-size: 24px; margin: 0; }
.dash-hero p { margin: 4px 0 0; color: rgba(255,255,255,.82); font-size: 13.5px; }
.dash-hero .btn { position: relative; z-index: 1; }
.dash-hero .hero-sub { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.9); display: flex; gap: 14px; flex-wrap: wrap; }
.dash-hero .hero-sub span { background: rgba(255,255,255,.14); padding: 5px 10px; border-radius: 10px; backdrop-filter: blur(4px); }

/* ===== Page hero — every page header becomes a teal strip (App._decoratePageHead) ===== */
.page-head.page-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 55%, var(--brand-x) 100%);
  color: #fff; border-radius: 22px; padding: 20px 24px; margin-bottom: 18px;
  position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(14,70,81,.16);
}
.page-head.page-hero > * { position: relative; z-index: 1; }
.page-head.page-hero h2 { color: #fff; }
.page-head.page-hero p { color: rgba(255,255,255,.82); }
.page-head.page-hero .muted, .page-head.page-hero .small { color: rgba(255,255,255,.78); }
.page-head.page-hero a { color: #fff; }
.page-head.page-hero .tag { background: rgba(255,255,255,.16); color: #fff; }
.page-head.page-hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.06); }
.page-head.page-hero .btn-ghost:hover { background: rgba(255,255,255,.16); }
.page-head.page-hero .btn-soft { background: rgba(255,255,255,.16); color: #fff; }
.page-head.page-hero .btn-danger { background: rgba(214,69,69,.9); }
.page-head.page-hero select, .page-head.page-hero input { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.page-head.page-hero .hero-mark {
  position: absolute; right: -18px; bottom: -30px; width: 150px; height: 150px; z-index: 0;
  stroke: rgba(255,255,255,.10); fill: none; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.page-head.page-hero::after { content: ""; position: absolute; right: -70px; top: -110px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.06); pointer-events: none; }

/* ===== Inline line icons produced by the emoji swap (App._iconify) ===== */
.ui-ico { width: 1.05em; height: 1.05em; vertical-align: -.16em; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; display: inline-block; flex: none; }
h2 .ui-ico { width: 1em; height: 1em; opacity: .9; }
.btn .ui-ico { margin-right: 2px; }
.step-num .ui-ico { width: 14px; height: 14px; }
.inbox .banner .ui-ico { display: none; }   /* rows already carry a colored dot */
.form-type-card .title .ui-ico { color: var(--brand-dark); }
.form-type-card > div:first-child .ui-ico { width: 28px; height: 28px; color: var(--brand); stroke-width: 1.6; }
.avatar .ui-ico { width: 19px; height: 19px; color: var(--brand-dark); }
#forms-list strong .ui-ico, .card > strong .ui-ico { color: var(--brand-dark); }
#notif-bell .ui-ico, #notif-bell-sidebar .ui-ico { width: 20px; height: 20px; color: var(--brand-dark); }
.help-ui .ui-ico { width: .95em; height: .95em; }
.tag .ui-ico { width: 12px; height: 12px; vertical-align: -.1em; margin-right: 1px; }
.row-card .sub .ui-ico { width: 12px; height: 12px; color: var(--brand-dark); }
.banner .ui-ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.goal-item > span .ui-ico { color: var(--brand-dark); }
.ins-row > .ui-ico { width: 16px; height: 16px; color: var(--brand-dark); }
.sc-line .ui-ico { width: 11px; height: 11px; vertical-align: -.08em; }
p .ui-ico, li .ui-ico, .hint .ui-ico, .small .ui-ico, .muted .ui-ico, label .ui-ico { width: 1em; height: 1em; color: var(--brand-dark); }
summary .ui-ico, th .ui-ico, strong .ui-ico { width: 1em; height: 1em; }

/* ===== Needs-attention inbox (replaces the banner stack) ===== */
.inbox { padding: 0; overflow: hidden; margin-bottom: 16px; }
.inbox-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.inbox-hd h3 { margin: 0; font-size: 15px; }
.inbox-hd .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.inbox .banner {
  margin: 0; border-radius: 0; background: transparent !important; color: var(--ink) !important;
  font-weight: 500; font-size: 13.5px; padding: 11px 18px 11px 40px; border-bottom: 1px solid var(--line);
  position: relative; display: block; line-height: 1.45;
}
.inbox .banner::before { content: ""; position: absolute; left: 18px; top: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.inbox .banner.danger::before { background: var(--danger); }
.inbox .banner.warn::before { background: var(--warn); }
.inbox .banner a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.inbox .banner a:hover { text-decoration: underline; }
.inbox .banner strong { font-weight: 700; }
.inbox .banner > button[aria-label="Dismiss"] { color: var(--muted) !important; }
.inbox-more { width: 100%; background: transparent; border: none; font: inherit; font-weight: 700; color: var(--brand-dark); padding: 11px; cursor: pointer; }
.inbox-more:hover { background: var(--surface-2); }
.inbox-empty { padding: 14px 18px; color: var(--green-dark); font-weight: 600; font-size: 13.5px; }
/* Severity colors the card (2026-09-06): red edge + tinted header when anything is urgent,
   amber when only upcoming items remain, small green when clear. */
.inbox-sub { font-size: 12.5px; opacity: .85; margin-top: 1px; }
.inbox.sev-red { border-left: 6px solid var(--danger); box-shadow: 0 8px 24px rgba(214,69,69,.10); }
.inbox.sev-red .inbox-hd { background: var(--danger-soft); border-bottom-color: #f3cfcf; }
.inbox.sev-red .inbox-hd h3, .inbox.sev-red .inbox-sub { color: #9c2b2b; }
.inbox.sev-amber { border-left: 6px solid var(--warn); }
.inbox.sev-amber .inbox-hd { background: var(--warn-soft); border-bottom-color: #f1dcb3; }
.inbox.sev-amber .inbox-hd h3, .inbox.sev-amber .inbox-sub { color: #8a5a00; }
.inbox.sev-info { border-left: 6px solid var(--brand); }
.inbox.sev-ok { border-left: 6px solid var(--green); }
.inbox.sev-ok .inbox-hd { background: var(--green-soft); border-bottom: none; }
.inbox.sev-ok .inbox-hd h3, .inbox.sev-ok .inbox-sub { color: var(--green-dark); }
.inbox .banner.urgent { background: #fff7f7 !important; font-weight: 600; font-size: 14px; }
.inbox .tag.danger { background: var(--danger); color: #fff; }
.hero-att { cursor: pointer; font-weight: 700; }
.hero-att.hot { background: #fff !important; color: var(--danger) !important; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* Password show/hide toggle */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap input { flex: 1; padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--brand-dark); font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.pw-toggle:hover { background: var(--brand-soft); }
.stat .lbl { color: var(--muted); font-size: 13.5px; font-weight: 600; }

/* ===== Forms ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 13.5px; }
.field .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--muted); }
/* Every form control inherits the app font — including bare <button>s (the × dismissers)
   which browsers otherwise render in their default UI font. */
button, input, select, textarea, option { font-family: var(--font); }
input, select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); width: 100%;
}
/* Safari on iPhone / Mac ignores font-family on a NATIVE <select>. Switching off the
   native look makes it honor Inter; we then draw our own chevron (inline SVG, which the
   CSP's img-src data: allows). Multi-selects keep the native listbox. */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px 16px;
}
select:not([multiple]):disabled { opacity: .6; }
.page-head.page-hero select:not([multiple]) { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>"); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 90px; }
.invalid { border-color: var(--danger) !important; background: var(--danger-soft); }
.field-err { color: var(--danger); font-size: 12px; font-weight: 600; }

/* fieldset look */
.section { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; background: var(--surface); }
.section.incident-on { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger); }
.notify-row:first-of-type { border-top: none !important; }
.section > h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.section .step-num {
  width: 24px; height: 24px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--font-head);
}
.auto-badge { font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 20px; }

/* goals checklist */
.goal-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; cursor: pointer; }
.goal-item:hover { background: var(--surface-2); }
.goal-item input { width: auto; margin-top: 3px; }
.goal-item .g-area { font-size: 11px; color: var(--brand-dark); background: var(--brand-soft); padding: 1px 7px; border-radius: 12px; font-weight: 600; }

/* signature */
.sig-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sig-pad { border: 2px dashed var(--line); border-radius: 10px; background: var(--surface-2); touch-action: none; cursor: crosshair; }
.sig-pad.unarmed { cursor: pointer; touch-action: pan-y; }
.sig-typed { font-family: "Segoe Script", "Snell Roundhand", cursive; font-size: 26px; color: var(--brand-dark); }

/* unit calc */
.calc-row { display: flex; gap: 16px; flex-wrap: wrap; }
.calc-pill { background: var(--brand-soft); color: var(--brand-dark); padding: 8px 14px; border-radius: 20px; font-weight: 700; }

/* ===== Tables / lists ===== */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.row-card .grow { flex: 1; min-width: 0; }
.row-card .title { font-weight: 700; }
.row-card .sub { color: var(--muted); font-size: 13px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: #a9701f; }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.brand { background: var(--brand-soft); color: var(--brand-dark); }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; flex: 1; min-width: 160px; }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ===== Modal ===== */
.modal-host { position: fixed; inset: 0; z-index: 100010; /* v361: above every full-screen gate (100000), which open the handbook reader inside a modal */ display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,30,50,.45); }
.modal { position: relative; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 26px; }
.modal h3 { font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 30px; font-weight: 600; box-shadow: var(--shadow); z-index: 100020; /* v361: toasts must show over the gates too */ }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

/* ===== Note detail / print ===== */
.note-doc { background: var(--surface); }
.note-doc .doc-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--brand); padding-bottom: 14px; margin-bottom: 18px; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin-bottom: 18px; }
.doc-field .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.doc-field .v { font-weight: 600; }
.doc-narr { background: var(--surface-2); border-radius: 10px; padding: 16px; white-space: pre-wrap; line-height: 1.6; }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin: 10px 0 0; }
.checklist .ci { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.checklist .ci .x { color: var(--ok); font-weight: 800; }

/* Banners flow as ONE paragraph (v327). They used to be display:flex, which turned every
   inline child (an emoji, a <strong>, a link) into its own column — on phones the amber
   "Seizure tracking is required" note split into two narrow columns. Banners that truly
   need a row layout (an action button at the right) set display:flex inline. */
.banner { padding: 12px 16px; border-radius: 10px; font-weight: 600; margin-bottom: 16px; display: block; line-height: 1.45; overflow-wrap: anywhere; }
.banner > .ui-ico { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.banner > span:only-child { display: inline; }
.banner.warn { background: var(--warn-soft); color: #8a5a14; }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.info { background: var(--brand-soft); color: var(--brand-dark); }
/* ISP goal keys — must stand out from the goal text (her rule). */
.isp-k { font-weight: 800; color: var(--brand-x); letter-spacing: .1px; }
strong, b { font-weight: 700; }

/* ===== Mobile chrome (hidden on desktop) ===== */
.mobile-header { display: none; }
.mobile-nav    { display: none; }
.menu-overlay  { display: none; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); }
.menu-overlay.open { display: block; }

.hamburger {
  background: none; border: none; cursor: pointer; padding: 8px;
  display: flex; flex-direction: column; gap: 5px; border-radius: 8px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ===== Responsive — tablet ===== */
@media (max-width: 860px) {
  .content { padding: 22px 18px; }
  .form-grid, .doc-grid, .grid-3, .grid-2, .checklist { grid-template-columns: 1fr; }
}

/* ===== Responsive — phone ===== */
@media (max-width: 680px) {
  /* Layout */
  .app { flex-direction: column; min-height: 100vh; padding-bottom: 64px; }
  .content { padding: 14px 14px 20px; }

  /* Hide desktop sidebar; show as slide-in drawer */
  .sidebar {
    position: fixed; top: 0; left: -270px; width: 260px; height: 100vh;
    z-index: 40; transition: left .25s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; box-shadow: none;
  }
  .sidebar.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,.18); }

  /* Mobile top bar — extra top padding for iPhone notch */
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20; flex-shrink: 0;
  }

  /* Mobile bottom nav */
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mob-btn {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; padding: 8px 0;
    background: none; border: none; cursor: pointer; font-family: var(--font);
    color: var(--muted); min-height: 56px; -webkit-tap-highlight-color: transparent;
  }
  .mob-btn.active { color: var(--brand-dark); }
  /* Calm Clinical: active tab gets a short teal underline; icons are line SVGs. */
  .mob-btn::after { content: ""; display: block; width: 18px; height: 3px; border-radius: 2px; margin-top: 3px; background: transparent; }
  .mob-btn.active::after { background: var(--brand); }
  .mob-icon { font-size: 20px; line-height: 1.2; display: flex; align-items: center; justify-content: center; height: 22px; }
  /* 6-tab admin bar: longest label ("Compliance") must fit a 1/6 slot on a 360px
     phone; never wrap — clip with an ellipsis on anything narrower. */
  .mob-lbl { font-size: 10px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Toast above bottom nav */
  .toast { bottom: 72px; }

  /* Login */
  .login-card { padding: 24px 18px; }
  .brand h1 { font-size: 17px; }

  /* Page header */
  .page-head { margin-bottom: 14px; gap: 10px; }
  .page-head h2 { font-size: 20px; }

  /* Stat cards — 3/4 across is too tight, go 2 cols on phones */
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat .num { font-size: 26px; }

  /* Row cards — clean single-line layout: truncate long text, hide staff name */
  .row-card { gap: 8px; padding: 12px; flex-wrap: nowrap; align-items: center; }
  .row-card .avatar { display: none; }
  .row-card .grow { min-width: 0; flex: 1; }
  .row-card .grow .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
  .row-card .grow .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .row-card .staff-tag { display: none; }
  .row-card > .tag { font-size: 10px; padding: 2px 6px; flex-shrink: 0; white-space: nowrap; }
  .row-card .btn.btn-ghost { flex-shrink: 0; min-height: 36px; padding: 0 10px; font-size: 13px; }

  /* Toolbar — stack vertically so filters don't crunch */
  .toolbar { flex-direction: column; gap: 8px; }
  .toolbar input, .toolbar select { width: 100%; min-width: unset; flex: none; }
  .toolbar .btn { width: 100%; }

  /* Modal slides up from bottom on mobile */
  .modal-host { align-items: flex-end; padding: 0; }
  .modal { border-radius: 20px 20px 0 0; max-width: none; max-height: 88vh; }

  /* Forms — prevent iOS auto-zoom on focus */
  input, select, textarea { font-size: 16px; }

  /* Better tap targets */
  .btn { min-height: 44px; }
  .nav-btn { min-height: 44px; }

  /* Banner */
  .banner { font-size: 13.5px; }
}

/* ===== Print ===== */
@media print {
  @page { size: letter; margin: .75in .7in .65in; }
  .sidebar, .bottom-nav, .page-head .btn, .toolbar, .modal-actions, .no-print { display: none !important; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .content { padding: 0; max-width: none; }
  /* Remove decorative shadows; keep borders so fields stay readable */
  .card  { box-shadow: none !important; }
  .section { box-shadow: none !important; page-break-inside: avoid; break-inside: avoid; }
  /* Make narrative text boxes visible without background noise */
  .doc-field { page-break-inside: avoid; break-inside: avoid; margin-bottom: 10pt; }
  /* Force all text to wrap — no hidden overflow on print */
  * { overflow: visible !important; white-space: normal !important; }
  pre, .doc-narr, .narr { white-space: pre-wrap !important; }
  /* Signature cursive larger on print */
  .doc-sig-name, .signed { font-size: 22pt !important; }
}

/* ===== Privacy mode (handing the device to a client / guardian to sign) =====
   HIPAA: the person signing must see THEIR OWN record and nothing else. Rather than
   blurring the surroundings (still partly readable, and a tap away from the real
   thing), everything that could carry another individual's information is removed
   from the screen and from reach: the navigation, the notification bell and panel,
   and any toast that fires mid-signature. */
body.privacy-mode .sidebar,
body.privacy-mode .mobile-header,
body.privacy-mode .mobile-nav,
body.privacy-mode .menu-overlay,
body.privacy-mode #notif-panel,
body.privacy-mode #notif-bell,
body.privacy-mode #notif-bell-sidebar,
body.privacy-mode #toast { display: none !important; }
body.privacy-mode .content { margin: 0 !important; padding-top: 0; max-width: none; }
body.privacy-mode .app { display: block; }
.privacy-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--brand); color: #fff;
  padding: 10px 16px; font-size: 14px; font-weight: 700;
  margin: 0 0 14px;
}
.privacy-bar .pb-sub { font-weight: 400; opacity: .92; font-size: 13px; }
.privacy-bar button { margin-left: auto; }

/* Capped lists (freeze fix): "Show N more" under a long list */
.list-more { display: block; width: 100%; margin-top: 8px; }

/* DSP care card (v317) — read-only client view */
.cc-card { margin-bottom: 12px; }
.cc-card.cc-emerg { border-left: 5px solid var(--brand); }
.cc-card.cc-danger { border-left-color: var(--danger); }
.cc-sec { font-family: var(--head); font-weight: 800; font-size: 15px; margin: 0 0 8px; color: var(--ink); }
.cc-sub { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 6px 0 4px; }
.cc-row { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cc-row:last-child { border-bottom: 0; }
.cc-k { font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 2px; }
.cc-v { color: var(--ink); line-height: 1.45; }
.cc-v a { color: var(--brand-dark, var(--brand)); font-weight: 600; }
@media (max-width: 520px) { .cc-row { grid-template-columns: 1fr; gap: 2px; } }

/* Tabbed admin client editor (v318) */
.ce-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); overflow-x: auto; margin-top: 12px; scrollbar-width: none; }
.ce-tabs::-webkit-scrollbar { display: none; }
.ce-tab { flex: none; display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: transparent; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; font: 700 13px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; border-radius: 0; }
.ce-tab.on { color: var(--brand-dark, var(--brand)); border-bottom-color: var(--brand); }
.ce-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ce-badge { font-size: 10.5px; font-weight: 800; background: var(--brand-soft, #e4f2f3); color: var(--brand-dark, var(--brand)); border-radius: 8px; padding: 1px 6px; }
.ce-badge.warn { background: var(--warn-soft, #fdf3e2); color: #8a5a00; }
.ce-badge.hidden { display: none; }
.ce-pane[hidden] { display: none; }
.ce-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; padding: 10px 12px; background: var(--warn-soft, #fdf3e2); border: 1px solid #f1dcb3; border-radius: 12px; font-size: 12.5px; }
.ce-strip b { color: #8a5a00; margin-right: 2px; }
.ce-strip.ok { background: var(--green-soft, #e9f5e1); border-color: #cde6bf; }
.ce-strip.ok b { color: var(--green-dark, #3d7a1e); }
.ce-strip.ok span { color: var(--green-dark, #3d7a1e); }
.ce-chip { font: 700 12px var(--font); background: #fff; border: 1px solid #f1dcb3; color: #8a5a00; padding: 4px 10px; border-radius: 10px; cursor: pointer; }
.ce-chip::after { content: " ›"; opacity: .6; }
.ce-foot { position: sticky; bottom: -16px; background: var(--surface, #fff); padding-top: 10px; padding-bottom: 10px; margin-top: 14px; border-top: 1px solid var(--line); z-index: 3; }
@media (max-width: 860px) { .ce-tab .ce-lb { display: none; } .ce-tab { padding: 9px 10px; } .ce-tab.on .ce-lb { display: inline; } }
.ce-foot { display: flex; gap: 8px; }
.ce-foot .ce-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .ce-foot { flex-direction: column; align-items: stretch; } .ce-foot .ce-actions { margin-left: 0; } .ce-foot .ce-actions .btn { flex: 1; } }

/* Clients list readiness chips (v319) */
.cl-ready { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.cl-chip { font: 700 11.5px var(--font); background: var(--warn-soft, #fdf3e2); border: 1px solid #f1dcb3; color: #8a5a00; padding: 3px 9px; border-radius: 9px; cursor: pointer; }
.cl-chip::after { content: " ›"; opacity: .6; }
.tag.ok { background: var(--green-soft, #e9f5e1); color: var(--green-dark, #3d7a1e); }

/* Med Pass v320 — grouped by person, inline rights, hold rules, overdue outcomes */
.mp-person { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 6px; margin-bottom: 10px; background: var(--surface, #fff); }
.mp-person.overdue { border-color: var(--danger); }
.mp-person-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.mp-allergy { margin-left: auto; color: var(--danger); font-weight: 700; font-size: 12px; }
.mp-dose { padding: 8px 0; border-top: 1px solid var(--line); }
.mp-dose:first-of-type { border-top: 0; }
.mp-dose.ticked { background: var(--green-soft, #e9f5e1); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.mp-dose.holdtrip { background: var(--warn-soft, #fdf3e2); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.mp-dose.late .mp-text strong { color: var(--danger); }
.mp-line { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 0; }
.mp-check { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--green); }
.mp-latebox { width: 22px; flex: none; text-align: center; font-size: 16px; margin-top: 1px; }
.mp-text { flex: 1; font-size: 14px; line-height: 1.35; }
.mp-when { display: block; font-size: 12px; color: var(--brand-dark, var(--brand)); font-weight: 600; margin-top: 1px; }
.mp-rights { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mp-issue { flex: none; white-space: nowrap; margin-top: 3px; }
.mp-outcomes { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px 32px; }
.mp-late-btn { background: var(--warn); color: #fff; }
.mp-hold { margin: 6px 0 0 32px; font-size: 12px; background: var(--warn-soft, #fdf3e2); border: 1px solid #f1dcb3; border-radius: 10px; padding: 6px 10px; color: #8a5a00; }
.mp-verdict { font-weight: 800; margin-left: 6px; }
.mp-verdict.give { color: var(--green-dark, #3d7a1e); }
.mp-verdict.hold { color: var(--danger); }
.mp-vitals { margin: 8px 0 0 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.mp-dose.done { display: flex; gap: 10px; align-items: flex-start; opacity: .85; }
.mp-done { width: 22px; flex: none; text-align: center; color: var(--green-dark, #3d7a1e); font-weight: 800; font-size: 16px; }
.mp-given { font-size: 12px; color: var(--green-dark, #3d7a1e); font-weight: 600; }
.mp-changed { background: var(--brand-soft, #e4f2f3); border-left: 4px solid var(--brand); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 0 0 10px; }
.mp-prn { margin-top: 12px; }
.mp-prn-item { background: var(--warn-soft, #fdf3e2); border: 1px solid #f1dcb3; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; font-size: 13px; }
.mp-prn-item .mp-outcomes { margin-left: 0; }

/* Med Admin exceptions inbox (v321) */
.mi-box { padding: 12px 14px; border-left: 6px solid var(--danger); }
.mi-box.mi-clear { border-left-color: var(--green); }
.mi-hd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.mi-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.mi-item i { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--danger); }
.mi-item.amber i { background: var(--warn); }
.mi-item.teal i { background: var(--brand); }
.mi-item .mi-txt { flex: 1; min-width: 0; }
.mi-item .mi-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.mi-days { margin-top: 10px; }
.mi-clean { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--green-soft, #e9f5e1); color: var(--green-dark, #3d7a1e); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; }
.mi-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.mi-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px; border-bottom: 2px solid var(--line); }
.mi-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mi-table td.nw { white-space: nowrap; }
@media (max-width: 600px) { .mi-item { flex-wrap: wrap; } .mi-item .mi-act { width: 100%; justify-content: flex-start; margin-left: 19px; } }

/* Med Admin per-client 30-day strip + pattern/refill cards (v322) */
.ms-wrap { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0 10px; }
.ms-hd { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 6px; font-size: 13px; }
.ms-scroll { overflow-x: auto; }
.ms-days, .ms-row { display: grid; grid-template-columns: 150px repeat(30, minmax(18px, 1fr)); gap: 2px; align-items: center; min-width: 720px; }
.ms-days { font-size: 9.5px; color: var(--muted); text-align: center; margin-bottom: 2px; }
.ms-row { margin: 2px 0; }
.ms-lbl { font-size: 12.5px; line-height: 1.25; padding-right: 6px; }
.ms-lbl small { display: block; color: var(--muted); font-weight: 500; }
.ms-red { color: var(--danger); font-weight: 800; } .ms-amber { color: #8a5a00; font-weight: 800; }
.ms-cell { height: 18px; border-radius: 4px; border: 0; padding: 0; font: 800 9.5px var(--font); display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--green-soft, #e9f5e1); color: var(--green-dark, #3d7a1e); }
.ms-cell.x { background: transparent; cursor: default; }
.ms-cell.R { background: var(--warn-soft, #fdf3e2); color: #8a5a00; }
.ms-cell.N { background: #eef2f4; color: var(--muted); }
.ms-cell.E { background: var(--danger); color: #fff; }
.ms-card { border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ms-card.amber { background: var(--warn-soft, #fdf3e2); border: 1px solid #f1dcb3; }
.ms-card.red { background: var(--danger-soft, #fcebea); border: 1px solid #f3cfcf; }

/* RN review lane (v323) */
.rl-box { padding: 12px 14px; border-left: 6px solid var(--brand); background: var(--brand-xs, #f1f8f9); }

/* ISP goal cards (v325) — editor, care card, note */
.gc { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface, #fff); }
.gc.gc-active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft, #e4f2f3); }
.gc-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-dark, var(--brand)); background: var(--brand-soft, #e4f2f3); padding: 3px 9px; border-radius: 8px; margin-bottom: 6px; }
.gc-title { font-family: var(--head); font-weight: 800; font-size: 15px; line-height: 1.3; margin: 0 0 8px; color: var(--ink); }
.gc-sec { display: grid; grid-template-columns: 128px 1fr; gap: 6px 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.gc-k { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-x, var(--brand-dark)); padding-top: 2px; }
.gc-v { color: var(--soft); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.gc-foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.gc-foot .chip { font-size: 11.5px; font-weight: 700; background: var(--surface-2, #f2f5f6); border: 1px solid var(--line); color: var(--soft); padding: 3px 9px; border-radius: 9px; }
.gc-foot .chip.t { background: var(--brand-soft, #e4f2f3); border-color: #cfe4e8; color: var(--brand-dark, var(--brand)); }
.gc-act { margin-left: auto; display: flex; gap: 6px; }
@media (max-width: 560px) { .gc-sec { grid-template-columns: 1fr; gap: 2px; } }
/* note checklist variant */
.ng { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface, #fff); }
.ng.on { border-color: var(--green); background: var(--green-soft, #e9f5e1); }
.ng-hd { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ng-hd .goal-cb { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--green); }
.ng-txt { flex: 1; min-width: 0; }
.ng-t { display: block; font-weight: 700; font-size: 14px; line-height: 1.3; }
.ng-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ng-more { display: block; background: none; border: 0; padding: 0; margin: 6px 0 0 32px; font: 700 12px var(--font); color: var(--brand-dark, var(--brand)); cursor: pointer; }
.ng-body { margin: 6px 0 0 32px; border-left: 2px solid var(--brand-soft, #e4f2f3); padding-left: 10px; }
.ng-body .gc-sec { grid-template-columns: 1fr; gap: 2px; padding: 5px 0; border-top: 0; }
.ng .goal-detail { margin-left: 32px; }
@media (max-width: 560px) { .ng-more, .ng-body, .ng .goal-detail { margin-left: 0; } }

/* Emergency Info — in-the-moment view (v329) */
.em-wrap { max-height: 66vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); padding: 12px; }
.em-head { text-align: center; border-bottom: 3px solid var(--danger); padding-bottom: 8px; margin-bottom: 10px; }
.em-name { font-family: var(--head); font-weight: 800; font-size: 20px; }
.em-dob { color: var(--muted); font-size: 13px; }
.em-block { border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; font-weight: 700; font-size: 15px; line-height: 1.35; }
.em-block.danger { background: var(--danger-soft, #fbe7e7); border: 2px solid var(--danger); color: var(--danger); }
.em-block.warn { background: var(--warn-soft, #fbf1de); border: 2px solid var(--warn); color: #8a5a14; }
.em-block.ok { background: var(--green-soft, #e3f4ec); border: 1px solid #b8dcc8; color: var(--green-dark, #2a7a52); font-weight: 600; font-size: 13.5px; }
.em-sec { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.em-call { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; text-decoration: none; color: var(--ink); background: var(--surface, #fff); }
.em-call.em-911 { background: var(--danger); border-color: var(--danger); color: #fff; }
.em-call.em-911 .em-num, .em-call.em-911 .em-who span { color: #fff; }
.em-call.em-agency { border-color: var(--brand); }
.em-call.none { cursor: default; }
.em-who { display: flex; flex-direction: column; min-width: 0; }
.em-who strong { font-size: 14px; }
.em-who span { font-size: 12px; color: var(--muted); }
.em-num { flex: none; font-weight: 800; font-size: 15px; color: var(--brand-dark, var(--brand)); white-space: nowrap; }
.em-kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.em-k { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.em-v { line-height: 1.45; }
.em-more { margin-top: 10px; font-size: 13px; }
.em-more summary { cursor: pointer; color: var(--brand-dark, var(--brand)); font-weight: 700; margin-bottom: 6px; }
@media (max-width: 520px) { .em-kv { grid-template-columns: 1fr; gap: 1px; } }

/* 🚨 Emergency button on the Clients list — a real emoji, larger, so it stands out (v330) */
.btn-emergency { font-size: 20px; line-height: 1; padding: 6px 10px; border-color: #f3cfcf; background: var(--danger-soft, #fcebea); }
.btn-emergency:hover { background: #f8d9d9; }
.btn-seizure { font-size: 20px; line-height: 1; padding: 6px 10px; border-color: #f1dfa8; background: #fdf6dc; }
.btn-seizure:hover { background: #f9ecc0; }

/* ── v333: admin desk tiles + All Notes mode switch ─────────────────────── */
.desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.desk-tile .lbl { font-weight: 600; }
.desk-tile .num.warn-num { color: var(--warn); }
.desk-clear { background: var(--green-soft, rgba(46,125,50,.08)); border: 1px solid var(--green-dark, #2e7d32); color: var(--green-dark, #2e7d32); border-radius: 12px; padding: 12px 16px; font-weight: 600; margin-bottom: 16px; }
.desk-clear .muted { font-weight: 400; margin-left: 6px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2, rgba(43,103,119,.06)); border-radius: 12px; }
.seg-btn { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: var(--surface, #fff); color: var(--brand-dark); box-shadow: 0 1px 3px rgba(20,60,70,.12); }

/* ── v341: county shift card, shift bar, verification timeline ───────────── */
.shift-card { border: 1.5px solid var(--green-dark); background: var(--green-soft); border-radius: 16px; padding: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.shift-card.on { border-color: var(--brand); background: var(--brand-soft, #e1eef0); }
.shift-card.done { border-color: var(--line); background: var(--surface); }
.shift-card.stale { border-color: var(--danger); background: var(--danger-soft, #fbe6e6); }
.shift-card .sc-who { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.shift-card .sc-meta { font-size: 13px; color: var(--muted); line-height: 1.45; }
.shift-card .sc-clock { font-family: var(--font-head); font-weight: 800; font-size: 32px; line-height: 1; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.shift-card .sc-stamps { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.shift-card .sc-stamps div { display: flex; gap: 8px; align-items: baseline; }
.shift-card .sc-stamps b { min-width: 68px; font-variant-numeric: tabular-nums; }
.shift-card .sc-link { font-size: 13px; text-align: center; }
.sc-big { font-family: var(--font-head); font-weight: 700; font-size: 16px; border: 0; border-radius: 13px; padding: 16px 14px; width: 100%; cursor: pointer; display: block; text-align: center; }
.sc-big.sc-start { background: var(--green-dark); color: #fff; }
.sc-big.sc-end { background: var(--danger); color: #fff; }
.sc-big.sc-neutral { background: var(--brand); color: #fff; }
.sc-big:active { transform: translateY(1px); }
.shift-bar { position: sticky; top: 0; z-index: 40; display: flex; gap: 8px; align-items: center; background: var(--brand-dark); color: #fff; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.shift-bar .sb-grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-bar button { font: inherit; font-weight: 700; font-size: 12.5px; border: 0; border-radius: 8px; padding: 6px 10px; background: var(--danger); color: #fff; cursor: pointer; }
.vt-line { border-left: 2px solid var(--line); margin: 12px 0 0 8px; padding-left: 16px; }
.vt-line > div { position: relative; padding: 5px 0; font-size: 13.5px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.vt-line > div::before { content: ""; position: absolute; left: -22px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--green-dark); }
.vt-line > div.far::before { background: var(--danger); }
.vt-line > div.none::before { background: var(--warn); }
.vt-line b { min-width: 74px; font-variant-numeric: tabular-nums; }

.shift-card .sc-more { font-size: 13px; color: var(--muted); }
.shift-card .sc-more summary { cursor: pointer; text-align: center; padding: 4px 0; }

.sc-big .sc-sub { display: block; font-family: var(--font-body, inherit); font-weight: 500; font-size: 12.5px; opacity: .9; margin-top: 3px; }

/* v347 — county shifts, live (admin/RN dashboard) */
.live-shifts { padding: 12px 14px; margin-bottom: 14px; border-left: 4px solid var(--line); }
.live-shifts.on { border-left-color: #1f9d55; }
.live-shifts .ls-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-shifts .ls-row { display: flex; gap: 10px; align-items: flex-start; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.live-shifts .ls-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }

/* v348 — new-hire onboarding checklist (the hire's phone) */
.hire-bar { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
.hire-bar > div { height: 100%; background: #1f9d55; border-radius: 6px; transition: width .3s; }
.hire-group { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; margin: 16px 0 6px; text-align: left; }
.hire-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; color: inherit; cursor: pointer; }
.hire-row[disabled], .hire-row.locked { cursor: default; opacity: .8; }
.hire-row.locked { background: transparent; border-style: dashed; }
.hire-row.returned { border-color: var(--danger); }
.hire-row .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hire-lbl { font-weight: 600; font-size: 14px; }
.hire-sub { font-size: 12px; color: #6b7280; }
.hire-row.returned .hire-sub { color: var(--danger); }
.hire-go { font-size: 13px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.hire-ico { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 2px solid var(--line); color: #6b7280; }
.hire-ico.accepted { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.hire-ico.waiting { background: #fdf6dc; border-color: #e6c75a; color: #8a6d00; }
.hire-ico.returned { background: var(--danger); border-color: var(--danger); color: #fff; }

/* v352 — front / back upload boxes */
.hire-sides { display: grid; gap: 10px; margin-top: 12px; }
.hire-side { border: 2px dashed var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; }
.hire-side-h { font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.hire-side input[type=file] { margin-top: 8px; width: 100%; }

/* v355 — back bar on the new hire's document / form screens */
.scr-back, .hire-backbar { position: sticky; top: -24px; z-index: 2; max-width: 720px; margin: -24px auto 10px; padding: 10px 0 8px; background: var(--bg, #eef1f2); }
.scr-back .btn, .hire-backbar .btn { font-weight: 700; }

/* v357 — W-4 Step 3: count × rate = amount, shown line by line */
.w4-line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.w4-q { font-size: 14px; margin-bottom: 8px; }
.w4-calc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.w4-calc label { font-weight: 600; margin: 0; }
.w4-calc input { width: 84px; text-align: right; }
.w4-amt { margin-left: auto; background: #e3f1f4; color: #155e6b; border-radius: 8px; padding: 6px 10px; white-space: nowrap; }

/* v362 — Back bar pinned to the top of the handbook reader */
.hb-top { position: sticky; top: -26px; z-index: 3; margin: -26px -26px 8px; padding: 10px 14px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.hb-top .btn { font-weight: 700; }

/* ── 🧑‍💼 Hiring tab (v395) ── */
.hire-card { padding: 12px 14px; cursor: pointer; border: 1px solid var(--line); margin-top: 8px; }
.hire-card .title { font-weight: 700; } .hire-card .sub { font-size: 12px; color: var(--muted); }
.hire-ring { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hire-ring span { width: 30px; height: 30px; border-radius: 50%; background: var(--surface, #fff); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink, #14212b); }
.hire-chip { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--brand-xs, #f1f8f9); color: var(--muted); margin-top: 8px; }
.hire-chip.warn { background: var(--warn-soft, #fdf3e2); color: #633806; } .hire-chip.ok { background: var(--green-soft, #e9f5e1); color: #27500a; } .hire-chip.danger { background: var(--danger-soft, #fcecec); color: #791f1f; }
.hire-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.hire-col-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 4px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; } .seg .btn { border-radius: 0; } .seg .btn.on { background: var(--brand-soft, #e4f2f3); color: var(--brand-dark, #155e6b); font-weight: 700; }
.hire-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.hire-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hire-tile { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--surface, #fff); cursor: pointer; } .hire-tile:hover { border-color: var(--brand); }
.hire-tile.todo { border-style: dashed; } .hire-tile-name { font-weight: 700; font-size: 13px; margin-top: 6px; }
.hire-thumbs { display: flex; gap: 4px; }
.hire-thumb { flex: 1; min-height: 64px; border-radius: 6px; background: #e8ecef center/cover no-repeat; position: relative; display: flex; align-items: flex-end; justify-content: center; font-size: 11px; color: var(--muted); text-align: center; padding: 4px; }
.hire-thumb.loaded { color: #fff; } .hire-thumb-cap { background: rgba(20,33,43,.55); color: #fff; border-radius: 4px; padding: 1px 6px; }
.hire-thumb.loaded .hire-thumb-cap { } .hire-thumb-pdf { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; background: rgba(20,33,43,.08); border-radius: 4px; padding: 1px 5px; }
.hire-thumb.empty { background: transparent; border: 1.5px dashed var(--line); align-items: center; } .hire-thumb.off { background: var(--brand-xs, #f1f8f9); align-items: center; flex-direction: column; justify-content: center; }
.hire-thumb.text { background: var(--brand-xs, #f1f8f9); align-items: flex-start; justify-content: flex-start; text-align: left; flex-direction: column; font-size: 12px; color: var(--ink, #14212b); }
.hire-note { font-size: 11px; color: #633806; margin-top: 4px; }
.hire-owes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.app-screen.dark { background: #1f2a33 !important; color: #f1efe8; }
.app-screen.dark .scr-back .btn { color: #f1efe8; }
.hire-card.stalled { opacity: .72; }
.hire-viewer { max-width: 1100px; margin: 0 auto; padding: 8px 12px 24px; }
.hv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; } .hv-top .btn { color: inherit; } .hv-title { font-size: 13px; text-align: center; flex: 1; }
.hv-stage { min-height: 50vh; display: flex; align-items: center; justify-content: center; background: #0e161c; border-radius: 12px; overflow: auto; }
.hv-img { max-width: 100%; max-height: 72vh; cursor: zoom-in; } .hv-img.zoom { max-width: none; max-height: none; width: 200%; cursor: zoom-out; }
.hv-pdf { width: 100%; height: 75vh; border: 0; }
.hv-pdf-pages { width: 100%; max-height: 75vh; overflow: auto; padding: 12px 0; } .hv-page { display: block; margin: 0 auto 10px; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); max-width: 100%; } .hv-msg { color: #b4b2a9; padding: 24px; text-align: center; }
.hv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.hv-meta { color: var(--muted); } .hv-meta a { color: var(--brand-dark); font-weight: 600; } .hv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.hire-tile-btns { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.btn.btn-xs { padding: 4px 8px; font-size: 12px; line-height: 1.2; border-radius: 8px; }

/* v417 — 📈 Performance tab */
.perf-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.perf-tile { padding: 12px 14px; cursor: pointer; }
.perf-tile.on { outline: 2px solid var(--brand); }
.perf-tile.red { border-color: #e9b3ad; } .perf-tile.amber { border-color: #e8d3a6; }
.perf-tile .n { font-family: var(--head); font-size: 24px; font-weight: 800; line-height: 1; }
.perf-tile .k { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 4px; }
.perf-tile .s { font-size: 12px; color: var(--soft, var(--muted)); margin-top: 4px; }
.perf-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.perf-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line); }
.perf-dot.red { background: var(--danger); } .perf-dot.amber { background: var(--warn, #c47d12); } .perf-dot.green { background: var(--ok, #2a7a52); }
.perf-who { min-width: 110px; } .perf-why { flex: 1; min-width: 200px; color: var(--soft, var(--muted)); } .perf-act { display: flex; gap: 6px; }
.perf-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.perf-chip { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--soft, var(--muted)); cursor: pointer; }
.perf-chip.on { background: var(--brand-soft, #e4f2f3); color: var(--brand-dark); border-color: var(--brand); }
.perf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.perf-card { padding: 14px; display: grid; gap: 10px; cursor: pointer; }
.perf-card.red { border-color: #e9b3ad; } .perf-card.amber { border-color: #e8d3a6; }
.perf-top { display: flex; gap: 12px; align-items: center; }
.perf-name { font-family: var(--head); font-weight: 800; font-size: 15px; }
.perf-pct { margin-left: auto; text-align: right; }
.perf-pct .n { font-family: var(--head); font-size: 24px; font-weight: 800; line-height: 1; }
.perf-pct .t { font-size: 11px; font-weight: 700; } .perf-pct .up { color: var(--ok, #2a7a52); } .perf-pct .down { color: var(--danger); } .perf-pct .flat { color: var(--muted); }
.perf-strip { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; }
.perf-strip i { display: block; height: 9px; border-radius: 2px; background: var(--line); }
.perf-strip i.g { background: var(--ok, #2a7a52); } .perf-strip i.a { background: var(--warn, #c47d12); } .perf-strip i.r { background: var(--danger); }
.perf-words { font-size: 12.5px; color: var(--soft, var(--muted)); } .perf-words strong { color: var(--ink); }
.perf-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.perf-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, #f4f7f8); color: var(--muted); }
.perf-pill.red { background: #fcecec; color: #b93636; } .perf-pill.amber { background: #fdf3e2; color: #b7791f; } .perf-pill.green { background: #e6f4ec; color: #2a7a52; }

/* v419 — hire set-up switches (drive / work authorization) */
.hire-setup-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ══ v420 — "it's loading, not crashed" layer ══ */
.boot { text-align: center; padding: 10px 0 4px; }
.boot-logo { width: 64px; height: 64px; border-radius: 14px; display: block; margin: 0 auto 10px; }
.boot-name { font-weight: 800; font-size: 20px; letter-spacing: -.01em; color: var(--ink, #1c2b33); }
.boot-bar { position: relative; height: 6px; border-radius: 6px; background: #e3eef0; overflow: hidden; margin: 18px auto 12px; max-width: 240px; }
.boot-bar span { position: absolute; left: -40%; top: 0; bottom: 0; width: 40%; border-radius: 6px; background: linear-gradient(90deg, #1f7a8c, #3aa7a3); animation: boot-slide 1.4s ease-in-out infinite; }
@keyframes boot-slide { 0% { left: -40%; } 60% { left: 100%; } 100% { left: 100%; } }
.boot-status { font-size: 14px; color: var(--muted, #5b6b72); min-height: 20px; }
.boot-slow { margin-top: 10px; font-size: 13px; color: #8a5a14; background: #fff7e6; border: 1px solid #f3d9a4; border-radius: 10px; padding: 8px 12px; }
.boot-slow a { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .boot-bar span { animation-duration: 3s; } }

.busy-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100018; pointer-events: none; }
.busy-track { height: 3px; background: rgba(31,122,140,.15); overflow: hidden; }
.busy-track span { display: block; height: 100%; width: 35%; background: var(--brand, #1f7a8c); border-radius: 3px; animation: boot-slide 1.1s ease-in-out infinite; position: relative; }
.busy-msg { display: inline-block; margin: 6px 0 0 50%; transform: translateX(-50%); background: var(--ink, #1c2b33); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; box-shadow: var(--shadow); }

.net-strip { position: fixed; top: env(safe-area-inset-top, 0); left: 0; right: 0; z-index: 100016; text-align: center; font-size: 12.5px; font-weight: 600; padding: 6px 12px; }
.net-strip.off { background: #3b4a52; color: #fff; }
.net-strip.on { background: var(--ok, #2f8f5b); color: #fff; }
.net-strip.off ~ .busy-bar .busy-msg, .net-strip.on ~ .busy-bar .busy-msg { margin-top: 36px; }   /* pill sits under the offline strip */

/* v421 — segmented switches inside a dark hero (Performance period, Hiring List/Board): the
   hero turns ghost buttons white, but the .seg pill itself is light → white-on-white (her
   screenshot 2026-10-27). Inside the pill, buttons keep dark text; the chosen one is tinted. */
.page-head.page-hero .seg { background: rgba(255,255,255,.94); border-color: transparent; }
.page-head.page-hero .seg .btn-ghost { color: var(--brand-dark, #155e6b); background: transparent; border-color: transparent; }
.page-head.page-hero .seg .btn-ghost:hover { background: rgba(31,122,140,.10); }
.page-head.page-hero .seg .btn.on { background: var(--brand-soft, #e4f2f3); color: var(--brand-dark, #155e6b); font-weight: 700; }
