:root {
  --primary-700: #0e7490; --primary-600: #0891b2; --primary-100: #cffafe;
  --success-600: #059669; --success-50: #ecfdf5; --warning-600: #d97706; --warning-50: #fff7ed;
  --danger-600: #dc2626; --danger-50: #fef2f2; --background: #f6fafb; --surface: #fff;
  --surface-soft: #f8fbfc; --text-strong: #16333b; --text-muted: #667985; --border: #d6e6ea; --sidebar: #0f3a45;
  font-family: "Be Vietnam Pro", "Noto Sans", system-ui, sans-serif; color: var(--text-strong); background: var(--background); line-height: 1.5;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: clip; }
body { margin: 0; min-width: 320px; min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 44px; }
textarea { min-height: 104px; resize: vertical; }
button, input, select, textarea { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text-strong); background: var(--surface); }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--warning-600); outline-offset: 2px; }
h1, h2, h3, h4, p { margin-top: 0; } h1 { font-size: clamp(1.38rem, 5vw, 2rem); line-height: 1.2; } h2 { font-size: clamp(1.13rem, 3vw, 1.4rem); } h3 { font-size: 1rem; }
a { color: var(--primary-700); } [hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px; border-radius: 10px; color: var(--surface); background: var(--sidebar); }.skip-link:focus { transform: translateY(0); }
.auth-card { width: min(calc(100% - 32px), 440px); margin: min(10vh, 72px) auto; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 2px 8px rgb(22 51 59 / 8%); }
.auth-card form, .stack-form, .create-form { display: grid; gap: 10px; }.auth-card label, .stack-form label, .create-form label { font-weight: 600; }
.eyebrow { margin-bottom: 4px; color: var(--primary-700); font-size: .78rem; font-weight: 700; letter-spacing: .08em; }.helper-text { margin: -4px 0 0; color: var(--text-muted); font-size: .875rem; }.field-error { color: var(--danger-600); }.feedback { min-height: 24px; color: var(--text-strong); font-weight: 600; }
.button { font-weight: 700; }.button-primary { border-color: var(--primary-700); color: var(--surface); background: var(--primary-700); }.button-primary:hover { background: var(--primary-600); }.button-secondary { color: var(--primary-700); background: var(--surface); }.button-full { width: 100%; }.icon-button { display: none; }
.operational-shell { min-height: 100dvh; }.sidebar { display: flex; flex-direction: column; background: var(--sidebar); color: var(--surface); }.brand { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--surface); text-decoration: none; }.brand strong, .brand small { display: block; }.brand small { color: #d6e6ea; font-size: .75rem; font-weight: 400; }.brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: var(--sidebar); background: var(--primary-100); font-weight: 800; }
.drawer-backdrop { display: none; }
.sidebar-nav { display: grid; gap: 4px; padding: 8px; }.nav-item { min-height: 44px; border: 0; border-radius: 10px; color: #d6e6ea; background: transparent; text-align: left; }.nav-item:hover, .nav-item[aria-current="page"] { color: var(--surface); background: rgb(207 250 254 / 15%); }.nav-group { margin: 16px 12px 2px; color: #b7d5dc; font-size: .75rem; font-weight: 700; letter-spacing: .06em; }.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgb(214 230 234 / 25%); }.sidebar-footer p { margin-bottom: 10px; overflow-wrap: anywhere; color: #d6e6ea; font-size: .875rem; }
.main-column { min-width: 0; }.topbar { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }.topbar h1 { margin: 0; }.topbar .eyebrow { margin: 0 0 2px; }.app-shell { width: min(100%, 1440px); margin: 0 auto; padding: 16px; }.page-heading, .section-heading { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }.page-heading > div, .section-heading > div { min-width: 0; }.page-heading p, .section-heading p, #selected-patient-meta { margin-bottom: 0; overflow-wrap: anywhere; color: var(--text-muted); }
.surface { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }.summary-grid { display: grid; gap: 12px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }.summary-card { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }.summary-card strong, .summary-card span { display: block; }.summary-card strong { margin-top: 4px; font-size: 1.6rem; }.summary-card span { color: var(--text-muted); font-size: .875rem; }.readiness-list, .record-list, .timeline { display: grid; gap: 8px; }.readiness-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }.readiness-row:last-child { border-bottom: 0; }.status-badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; }.status-ready { color: var(--success-600); background: var(--success-50); }.status-partial { color: var(--warning-600); background: var(--warning-50); }.status-blocked { color: var(--danger-600); background: var(--danger-50); }.system-summary { display: grid; gap: 8px; }.system-summary dl { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1.3fr); gap: 8px 12px; margin: 0; }.system-summary dt { color: var(--text-muted); }.system-summary dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.clinical-grid { display: grid; min-width: 0; gap: 16px; }.patient-list-panel { min-width: 0; }.record-card, .timeline-card { min-width: 0; overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }.record-card { width: 100%; color: inherit; text-align: left; }.record-card[aria-current="true"] { border-color: var(--primary-700); box-shadow: inset 4px 0 0 var(--primary-700); }.record-card strong, .record-card span { display: block; }.record-card span, .timeline-card p { color: var(--text-muted); font-size: .875rem; }.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }.search-form input, .stack-form input, .stack-form select, .stack-form textarea, .create-form input { min-width: 0; }.create-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }.detail-section { min-width: 0; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }.detail-section:first-of-type { border-top: 0; padding-top: 0; }.notice { overflow-wrap: anywhere; margin-bottom: 16px; padding: 12px; border-radius: 12px; color: var(--warning-600); background: var(--warning-50); }.empty-state, .blocked-state { color: var(--text-muted); padding: 32px 4px; }.blocked-state { max-width: 720px; padding: 24px; }.badge { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }.badge-required { color: var(--success-600); background: var(--success-50); }.badge-validation, .badge-revalidation { color: var(--warning-600); background: var(--warning-50); }.badge-completed { color: var(--primary-700); background: var(--primary-100); }.badge-cancelled { color: var(--danger-600); background: var(--danger-50); }
.plan-editor { margin-top: 12px; }.plan-editor summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--primary-700); font-weight: 700; }.plan-editor .stack-form { margin-top: 12px; }
.mobile-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }.mobile-nav button { min-width: 0; min-height: 44px; border: 0; border-radius: 8px; color: var(--text-muted); font-size: .71rem; font-weight: 700; background: transparent; overflow-wrap: anywhere; }.mobile-nav button[aria-current="page"] { color: var(--primary-700); background: var(--primary-100); }.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 768px) { .app-shell { padding: 24px; }.clinical-grid { grid-template-columns: minmax(280px, 34%) 1fr; align-items: start; }.patient-list-panel { position: sticky; top: 16px; }.stack-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }.stack-form textarea, .stack-form button { grid-column: 1 / -1; }.mobile-nav { display: none !important; } }
@media (min-width: 1024px) { .operational-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }.sidebar { position: sticky; top: 0; height: 100dvh; }.app-shell { padding: 24px 32px; }.clinical-grid { grid-template-columns: minmax(320px, 34%) 1fr; } }
@media (max-width: 767px) { .drawer-backdrop { position: fixed; z-index: 14; inset: 0; display: block; width: 100%; min-height: 100dvh; border: 0; border-radius: 0; background: rgb(15 58 69 / 42%); }.sidebar { position: fixed; z-index: 15; inset: 0 auto 0 0; width: min(84vw, 320px); transform: translateX(-105%); transition: transform 180ms ease; }.operational-shell.menu-open .sidebar { transform: translateX(0); box-shadow: 8px 0 24px rgb(22 51 59 / 22%); }.icon-button { display: inline-flex; align-items: center; }.app-shell { padding-bottom: 84px; }.topbar .button:last-child { display: none; }.system-summary dl { grid-template-columns: 1fr; gap: 2px; }.system-summary dd { margin-bottom: 8px; } }
@media (prefers-reduced-motion: no-preference) { .surface, .record-card, .button, .nav-item, .mobile-nav button { transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, color 160ms ease; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
