/* Small Clinic EMR theme: a hand-written match of the Base44 (Unbroken Family Counseling) app's
   Tailwind + shadcn/ui look: same palette (src/index.css), radius, type, spacing, and shadows.
   No build step and no runtime Node; fonts are vendored in ../fonts (SIL Open Font License). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/playfair-display-latin.woff2") format("woff2"); }

:root {
  --background: 40 27% 96%;
  --foreground: 207 30% 20%;
  --card: 0 0% 100%;
  --primary: 207 30% 37%;
  --primary-foreground: 40 27% 98%;
  --secondary: 174 30% 94%;
  --secondary-foreground: 174 58% 25%;
  --muted: 40 20% 93%;
  --muted-foreground: 207 10% 42%;
  --accent: 174 58% 42%;
  --accent-foreground: 40 27% 98%;
  --destructive: 0 72% 51%;
  --border: 40 15% 88%;
  --input: 40 15% 85%;
  --ring: 207 30% 37%;
  --teal: 174 58% 37%;
  --brown: 26 43% 34%;
  --radius: .625rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; border-color: hsl(var(--border)); }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: hsl(var(--background)); color: hsl(var(--foreground));
  font-family: var(--font-body); font-size: .9375rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .font-heading { font-family: var(--font-heading); color: hsl(var(--foreground)); }
h1 { font-size: 1.5rem; font-weight: 600; line-height: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.125rem; font-weight: 600; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 .4rem; }
a { color: hsl(var(--primary)); text-underline-offset: 3px; }
a:hover { color: hsl(var(--accent)); }
code { font-family: var(--font-mono); font-size: .85em; background: hsl(var(--muted)); padding: .05rem .3rem; border-radius: .3rem; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 100; background: hsl(var(--card)); padding: .5rem 1rem; border-radius: .5rem; }
.skip:focus { left: .5rem; }
.icon { width: 1rem; height: 1rem; flex-shrink: 0; vertical-align: -.15em; }

/* ---------- app shell: sidebar + top bar (AppLayout.jsx) ---------- */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: 16rem; flex: 0 0 16rem; background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border)); display: flex; flex-direction: column; z-index: 40; }
.side-head { padding: 1rem; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; justify-content: space-between; min-height: 4.1rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: hsl(var(--foreground)); font-family: var(--font-heading); font-weight: 600; }
.brand img { height: 2.75rem; max-width: 100%; width: auto; display: block; }
.brand .mark { display: inline-flex; width: 2rem; height: 2rem; border-radius: .6rem; align-items: center; justify-content: center; color: #fff; }
.brand-gradient { background: linear-gradient(135deg, hsl(207 30% 37%) 0%, hsl(174 58% 37%) 100%); }
.side nav { flex: 1; overflow-y: auto; padding: 1rem .75rem; }
.navsec + .navsec { margin-top: 1.5rem; }
.navsec-label { font-size: .75rem; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: .05em; padding: 0 .75rem; margin: 0 0 .5rem; }
.side nav a { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: .5rem; font-size: .875rem; font-weight: 500;
  color: hsl(var(--muted-foreground)); text-decoration: none; margin-bottom: .25rem; transition: background-color .15s, color .15s; }
.side nav a:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.side nav a.on, .side nav a[aria-current="page"] { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.side nav a .badge-count, .side nav a .badge-alert { margin-left: auto; }
.side-foot { padding: .75rem; border-top: 1px solid hsl(var(--border)); }
.usercard { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: .5rem; background: hsl(var(--muted) / .5); }
.usercard .avatar { width: 2rem; height: 2rem; border-radius: 999px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: .875rem; font-weight: 600; flex-shrink: 0; }
.usercard .who { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.usercard .who b { display: block; font-size: .875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard .who small { display: block; font-size: .75rem; color: hsl(var(--muted-foreground)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { background: none; border: 0; padding: .25rem; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: .375rem; height: auto; box-shadow: none; display: inline-flex; }
.iconbtn:hover { color: hsl(var(--foreground)); background: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: hsl(var(--card) / .8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border-bottom: 1px solid hsl(var(--border)); padding: .75rem 1rem; display: flex; align-items: center; gap: 1rem; }
.topsearch { flex: 1; max-width: 28rem; position: relative; margin: 0; }
.topsearch .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); }
.topsearch input { padding-left: 2.25rem; height: 2.25rem; background: hsl(var(--muted) / .5); border: 0; box-shadow: none; }
.demo-pill { margin-left: auto; display: inline-flex; align-items: center; gap: .375rem; padding: .25rem .625rem; border-radius: 999px; font-size: .75rem;
  background: #fffbeb; color: #b45309; border: 1px solid #fde68a; white-space: nowrap; }
.menu-btn { display: none; }
main { flex: 1; width: 100%; max-width: 80rem; margin: 0 auto; padding: 1.5rem; animation: fade-in .3s ease-out; }
main.narrow { max-width: 28rem; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main { animation: none; } }
.backdrop { display: none; }
@media (max-width: 1023px) {
  .side { position: fixed; left: 0; transform: translateX(-100%); transition: transform .3s; }
  .nav-open .side { transform: none; }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .3); z-index: 30; }
  .menu-btn { display: inline-flex; }
  main { padding: 1rem; }
  .demo-pill { display: none; }
}
@media (max-width: 1023px) { .no-js .side { position: static; transform: none; width: 100%; height: auto; } .no-js .shell { display: block; } }

/* ---------- page header (PageHeader.jsx) ---------- */
.page-head { margin-bottom: 1.5rem; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.page-head h1 { margin: 0; }
.page-head .sub { font-size: .875rem; color: hsl(var(--muted-foreground)); margin: .125rem 0 0; }
.page-head .actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-icon { padding: .625rem; border-radius: .5rem; background: hsl(var(--primary) / .05); color: hsl(var(--primary)); display: inline-flex; }
.page-icon .icon { width: 1.5rem; height: 1.5rem; }

/* ---------- cards (ui/card.jsx) and stat cards (StatCard.jsx) ---------- */
.card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: .75rem; box-shadow: var(--shadow-sm); padding: 1.25rem 1.5rem; margin: 0 0 1rem; }
.card > h2:first-child, .card > h3:first-child, .card > h1:first-child { margin-top: 0; }
.card h2 { font-size: 1.125rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.stat { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: .75rem; padding: 1.25rem; box-shadow: var(--shadow-sm); text-decoration: none; color: hsl(var(--muted-foreground)); font-size: .875rem; font-weight: 500; }
a.stat:hover { border-color: hsl(var(--primary) / .35); color: hsl(var(--muted-foreground)); }
.stat .n { display: block; order: -1; font-family: var(--font-heading); font-size: 1.5rem; font-weight: 600; color: hsl(var(--foreground)); line-height: 2rem; }
.stat-body { display: flex; flex-direction: column-reverse; }
.stat .ico { padding: .625rem; border-radius: .5rem; display: inline-flex; color: hsl(var(--primary)); background: hsl(var(--primary) / .05); }
.stat .ico .icon { width: 1.25rem; height: 1.25rem; }
.stat.warn-stat .ico { color: #d97706; background: #fffbeb; }
.stat.alert-stat .ico { color: #dc2626; background: #fef2f2; }
.stat.teal .ico { color: hsl(var(--teal)); background: hsl(var(--teal) / .05); }
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1.5rem; }
.dash .card { margin: 0; }
.line { padding: .55rem 0; border-bottom: 1px solid hsl(var(--border)); font-size: .875rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.line:last-child { border-bottom: 0; }
.alert-card { border-left: 4px solid #dc2626; }

/* ---------- buttons (ui/button.jsx) ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; white-space: nowrap; height: 2.25rem; padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px); font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer; text-decoration: none;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border: 1px solid transparent; box-shadow: var(--shadow); transition: background-color .15s, color .15s; }
button:hover, .btn:hover { background: hsl(var(--primary) / .9); color: hsl(var(--primary-foreground)); }
button:disabled { opacity: .5; pointer-events: none; }
.btn.secondary, button.secondary { background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--input)); box-shadow: var(--shadow-sm); }
.btn.secondary:hover, button.secondary:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn.small, button.small { height: 2rem; padding: 0 .75rem; font-size: .75rem; }
.btn.danger, button.danger { background: hsl(var(--destructive)); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; color: hsl(var(--foreground)); }
.btn.ghost:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
form.inline, .inline-form { display: inline; }

/* ---------- forms (ui/input, select, textarea, label) ---------- */
label { display: block; margin-top: .9rem; font-size: .875rem; font-weight: 500; color: hsl(var(--foreground)); }
input, select, textarea { display: block; width: 100%; margin-top: .375rem; height: 2.25rem; padding: .25rem .75rem; font: inherit; font-size: .875rem;
  color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
select { padding-right: 2rem; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; }
select[multiple] { height: auto; background-image: none; }
textarea { height: auto; min-height: 5rem; padding: .5rem .75rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 1px hsl(var(--ring)); }
input[type=checkbox], input[type=radio] { display: inline-block; width: 1rem; height: 1rem; margin: 0 .4rem 0 0; padding: 0; box-shadow: none; vertical-align: -.15em; accent-color: hsl(var(--primary)); }
input[type=file] { height: auto; padding: .4rem; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { font-weight: 400; }
.checks label, .radio label { display: inline-flex; align-items: center; font-weight: 400; margin: .3rem 1.25rem .3rem 0; }
.checks input, .radio input { width: 1rem; }
fieldset { border: 1px solid hsl(var(--border)); border-radius: .75rem; margin: 1rem 0; padding: .5rem 1rem 1rem; background: hsl(var(--card)); }
legend { font-weight: 600; font-size: .875rem; padding: 0 .35rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; } .row > label { flex: 1; min-width: 10rem; }
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
.toolbar label { margin: 0; display: inline-flex; align-items: center; gap: .4rem; }
.toolbar select, .toolbar input:not([type=checkbox]) { width: auto; margin: 0; display: inline-block; }
.toolbar .spacer { flex: 1; }
.grid input, .grid select { width: auto; max-width: 100%; display: inline-block; margin: 0; }
details { margin: 1rem 0; } summary { cursor: pointer; font-weight: 500; color: hsl(var(--primary)); }

/* ---------- tables (ui/table.jsx), shown in a card ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; background: hsl(var(--card));
  border: 1px solid hsl(var(--border)); border-radius: .75rem; box-shadow: var(--shadow-sm); overflow: hidden; margin: 0 0 1rem; }
th, td { text-align: left; padding: .6rem .75rem; vertical-align: top; border-bottom: 1px solid hsl(var(--border)); }
th { height: 2.5rem; vertical-align: middle; font-weight: 500; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .45); }
tr:last-child > td, tr:last-child > th { border-bottom: 0; }
tr:hover > td { background: hsl(var(--muted) / .35); }
.card table, .kv, table.kv { border: 0; box-shadow: none; border-radius: 0; margin: 0; }
table.kv th { width: 11rem; background: none; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.overdue > td { background: #fef2f2; }

/* ---------- badges (StatusBadge.jsx / ui/badge.jsx) ---------- */
.badge, .status, .cs, .ns, .confirmed, .kb-open, .kb-won, .kb-lost { display: inline-flex; align-items: center; gap: .25rem; padding: .125rem .625rem; border-radius: 999px;
  font-size: .75rem; font-weight: 500; line-height: 1.1rem; border: 1px solid #e2e8f0; background: #f1f5f9; color: #475569; white-space: nowrap; }
.b-blue, .status-scheduled, .cs-submitted, .st-open, .kb-open, .pri-medium { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.b-green, .status-completed, .cs-accepted, .cs-paid, .ns-signed, .cosign-cosigned, .st-done, .kb-won, .confirmed { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.b-amber, .cs-partially_paid, .ns, .cosign-pending, .st-in_progress, .pri-high, .ann-pri-important { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.b-red, .status-no_show, .status-cancelled, .cs-rejected, .cs-denied, .cosign-returned { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.b-cyan, .status-checked_in { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.b-teal, .cs-ready { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.cs-draft, .st-cancelled, .pri-low, .kb-lost { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.pri-urgent, .ann-pri-urgent { background: #dc2626; color: #fff; border-color: #dc2626; }
.badge-alert, .badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .4rem; border-radius: 999px; font-size: .7rem; font-weight: 600; line-height: 1; }
.badge-alert { background: hsl(var(--destructive)); color: #fff; }
.badge-count { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border: 1px solid hsl(var(--accent) / .25); }
.side nav a.on .badge-count { background: hsl(var(--primary-foreground)); color: hsl(var(--primary)); }

/* ---------- messages ---------- */
.flash, .error, .warn, .alert, .mode { border-radius: .5rem; padding: .75rem 1rem; margin: 0 0 1rem; font-size: .875rem; border: 1px solid; }
.flash { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.error { background: hsl(var(--destructive) / .1); color: #b91c1c; border-color: hsl(var(--destructive) / .25); }
.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert { background: #fef2f2; color: #991b1b; border-color: #fecaca; border-left: 4px solid #dc2626; }
.mode.mock { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border-color: hsl(var(--accent) / .25); }
.mode.live { background: #fef2f2; color: #991b1b; border-color: #fecaca; font-weight: 600; }
.banner { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.muted { color: hsl(var(--muted-foreground)); font-size: .875rem; }
.small { font-size: .8rem; }
.note { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: .75rem; padding: .75rem 1rem; margin: .75rem 0; box-shadow: var(--shadow-sm); }
.readonly dt { font-weight: 600; margin-top: .6rem; font-size: .875rem; } .readonly dd { margin-left: 0; white-space: pre-wrap; }
.tree ul { margin: .2rem 0 .4rem 1.2rem; padding: 0; }
pre.x12 { background: hsl(var(--muted)); padding: .75rem; overflow-x: auto; font-size: .8rem; border-radius: .5rem; font-family: var(--font-mono); }

/* ---------- schedule: appointment chips and the week hour grid (WeekHourGrid.jsx) ---------- */
.appt { display: block; padding: .375rem .5rem; margin: .25rem 0; border-radius: .5rem; background: hsl(var(--muted) / .7); color: inherit;
  text-decoration: none; font-size: .78rem; line-height: 1.35; border-left: 3px solid hsl(var(--primary)); }
.appt:hover { background: hsl(var(--muted)); color: inherit; }
.appt strong { font-family: var(--font-mono); font-weight: 500; color: hsl(var(--muted-foreground)); font-size: .72rem; }
.appt .who { font-weight: 600; }
.appt .status, .appt .confirmed { margin-top: .2rem; font-size: .68rem; padding: 0 .45rem; }
.appt.group { border-left-color: hsl(var(--accent)); background: hsl(var(--secondary)); }
.appt.inactive { border-left-color: #cbd5e1; color: hsl(var(--muted-foreground)); }
.appt.inactive .who, .appt .gone { text-decoration: line-through; }
.hourgrid { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: .75rem; overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.hourgrid .scroll { overflow-x: auto; }
.hourgrid .grid7 { min-width: 900px; display: grid; grid-template-columns: 70px repeat(7, minmax(0, 1fr)); }
.hourgrid .hd { padding: .5rem; text-align: center; border-left: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); }
.hourgrid .hd:first-child { border-left: 0; }
.hourgrid .hd a { text-decoration: none; color: inherit; display: block; }
.hourgrid .dow { font-size: .75rem; color: hsl(var(--muted-foreground)); text-transform: uppercase; display: block; }
.hourgrid .dnum { font-family: var(--font-heading); font-size: 1.125rem; font-weight: 600; display: block; }
.hourgrid .today, .hourgrid .today .dnum { background: hsl(var(--primary) / .05); color: hsl(var(--primary)); }
.hourgrid .hr { padding: .5rem; text-align: right; font-family: var(--font-mono); font-size: .75rem; color: hsl(var(--muted-foreground)); border-bottom: 1px solid hsl(var(--border)); }
.hourgrid .cell { border-left: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); min-height: 64px; padding: .25rem; }
.hourgrid .cell.today { background: hsl(var(--primary) / .05); }
.hourgrid .cell.now { background: hsl(var(--accent) / .1); }
.hourgrid .cell .appt { margin: 0 0 .25rem; }
table.dayview td:first-child { font-family: var(--font-mono); font-size: .78rem; color: hsl(var(--muted-foreground)); white-space: nowrap; }

/* ---------- kanban (IntakePipeline.jsx) ---------- */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .75rem; align-items: flex-start; }
.kcol { flex: 0 0 16rem; background: hsl(var(--muted) / .5); border-radius: .75rem; padding: .75rem; border: 1px solid hsl(var(--border)); border-top: 4px solid hsl(var(--primary)); }
.kcol.kind-won { border-top-color: hsl(var(--accent)); } .kcol.kind-lost { border-top-color: #cbd5e1; }
.khead { font-weight: 600; font-size: .875rem; margin-bottom: .6rem; display: flex; justify-content: space-between; align-items: center; }
.kcard { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: .5rem; padding: .6rem .7rem; margin-bottom: .5rem; font-size: .82rem; box-shadow: var(--shadow-sm); }
.kcard a { font-weight: 600; text-decoration: none; }
.kcard select { height: 1.9rem; font-size: .75rem; margin-top: .4rem; }
.pipe { display: flex; flex-wrap: wrap; gap: .4rem; }
.pstage { background: hsl(var(--secondary)); border-radius: .5rem; padding: .3rem .6rem; text-decoration: none; color: hsl(var(--secondary-foreground)); font-size: .78rem; }
.pstage .n { font-weight: 700; margin-right: .3rem; }

/* ---------- bulletin ---------- */
.ann { border-left: 4px solid hsl(var(--border)); } .ann-important { border-left-color: #f59e0b; } .ann-urgent { border-left-color: #dc2626; }
.ann-head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.ann-head a { font-family: var(--font-heading); font-size: 1.05rem; text-decoration: none; color: hsl(var(--foreground)); }
.ann-body { white-space: pre-wrap; margin: .5rem 0; }

/* ---------- login (AuthLayout.jsx) ---------- */
.auth { min-height: calc(100vh - 3rem); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-box { width: 100%; max-width: 28rem; }
.auth-head { text-align: center; margin-bottom: 2.5rem; }
.auth-head img { height: 3.5rem; width: auto; margin: 0 auto 1.25rem; display: block; }
.auth-icon { display: inline-flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); margin-bottom: 1rem; }
.auth-icon .icon { width: 1.75rem; height: 1.75rem; }
.auth-head h1 { font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.auth-head p { color: hsl(var(--muted-foreground)); margin: .5rem 0 0; }
.auth-card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 1rem; box-shadow: var(--shadow-sm); padding: 2rem; }
.auth-card input { height: 3rem; }
.auth-card .field { position: relative; } .auth-card .field .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); margin-top: .19rem; color: hsl(var(--muted-foreground)); }
.auth-card .field input { padding-left: 2.5rem; }
.auth-card button[type=submit] { width: 100%; height: 3rem; margin-top: 1.25rem; }
.auth-foot { text-align: center; font-size: .875rem; color: hsl(var(--muted-foreground)); margin-top: 1.5rem; }
.auth-demo { font-size: .75rem; color: hsl(var(--muted-foreground)); margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid hsl(var(--border)); }
.plain-top { display: flex; justify-content: flex-end; padding: .75rem 1rem; }
.plain-top .demo-pill { display: inline-flex; }
.auth-forgot { text-align: right; font-size: .875rem; margin: .5rem 0 0; }
.auth-head img + .auth-icon { display: none; }
.auth-card h1 { font-size: 1.5rem; margin-top: 0; }
.ph-title { display: flex; align-items: center; gap: .75rem; }
.avatar.lg { width: 3rem; height: 3rem; border-radius: 999px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 1.125rem; font-weight: 600; flex-shrink: 0; }
.btn .icon, button .icon { width: 1rem; height: 1rem; margin-right: .1rem; }
.btn, button { gap: .4rem; }
table.demog th { background: hsl(var(--muted) / .5); width: 10rem; }
button, .btn, input, select, textarea { font-family: var(--font-body); }
h1 .btn, h2 .btn, h2 button, h1 button, h3 .btn, h3 button { vertical-align: middle; font-size: .8125rem; font-weight: 500; }

/* ---------- claim readiness ---------- */
.readiness { margin: 1.25rem 0; }
.readiness-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.readiness-head h2 { margin: 0; }
.readiness-table td { vertical-align: top; font-size: .875rem; }
.readiness-table td.nowrap { white-space: nowrap; font-weight: 600; }
.badge.rd-ok { background: hsl(142 70% 95%); color: hsl(142 72% 26%); border-color: hsl(142 60% 80%); }
.badge.rd-missing { background: hsl(0 85% 96%); color: hsl(0 70% 38%); border-color: hsl(0 80% 85%); }
.badge.rd-warn { background: hsl(40 95% 94%); color: hsl(30 80% 30%); border-color: hsl(40 90% 75%); }
tr.rd-row-missing td { background: hsl(0 85% 98.5%); }
tr.rd-row-warn td { background: hsl(40 95% 98%); }
.rd-msgs { margin: .25rem 0 0; padding-left: 1rem; font-size: .8125rem; }
.billing-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem 1rem; }
.billing-fields label { margin: 0; }

/* Sign dialog (note signing with the cosigner choice). Without JS it shows inline as a fieldset. */
.no-js .js-only { display: none !important; }
dialog.inline-dialog { width: min(34rem, calc(100vw - 2rem)); padding: 0; border: 1px solid hsl(var(--border));
  border-radius: var(--radius); background: hsl(var(--card)); color: hsl(var(--foreground));
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.25); }
dialog.inline-dialog > fieldset { margin: 0; border: 0; padding: 1.25rem 1.5rem; }
dialog.inline-dialog legend { font-family: var(--font-heading, inherit); font-size: 1.15rem; font-weight: 600; padding: 0; margin-bottom: .25rem; }
dialog.inline-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.no-js dialog.inline-dialog { display: block; position: static; width: auto; margin: 1rem 0; box-shadow: none; }
.reassign-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; max-width: 40rem; margin: .25rem 0 1rem; }
.reassign-form label { width: 100%; margin: 0; }
.reassign-form select { max-width: 20rem; }

/* Copy prior note: copied sections stay highlighted until edited or ticked as reviewed. */
.copy-banner { border: 1px solid hsl(38 80% 70%); background: hsl(45 90% 95%); color: hsl(30 60% 25%);
  border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; font-size: .9rem; }
fieldset.copied-section { border-left: 4px solid hsl(38 85% 60%); }
fieldset.copied-pending { background: hsl(45 90% 97%); }
.copied-field { box-shadow: inset 3px 0 0 hsl(38 85% 60%); padding-left: .6rem; margin-left: -.6rem; }
.review-tick { margin-top: .75rem; font-weight: 500; }
.copy-form select { max-width: 22rem; }
