/* ===========================================================
   ICU CDS — Clinical UI styling (projector-ready single mode)
   Designed for large-hall presentation: generous type, calm palette.
   =========================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Clinical neutral palette */
  --bg-app:        #eef1f5;
  --bg-card:       #ffffff;
  --bg-strip:      #fafbfc;
  --bg-hover:      #f3f5f8;
  --bg-header:     #1c2a3a;
  --bg-sidebar:    #243447;

  --border:        #d9dde3;
  --border-strong: #b9c0c9;
  --border-dark:   #2d3e54;

  --text-primary:  #1a2332;
  --text-secondary:#3a4658;
  --text-muted:    #5b6878;          /* darkened from #8693a4 for WCAG AA */
  --text-on-dark:  #e8edf3;
  --text-on-dark-mute: #b8c2d0;      /* lightened for better contrast on navy */

  /* Risk colors — warning hue chosen to differ from brand orange */
  --risk-critical: #c0392b;
  --risk-critical-bg: #fdecea;
  --risk-warning:  #b45309;          /* amber, distinct from --brand */
  --risk-warning-bg:  #fef3c7;
  --risk-stable:   #1f7a4f;
  --risk-stable-bg:   #e6f3ec;

  /* Brand (TBU orange) — used only for branding and CPE accents */
  --brand:         #e87722;
  --brand-dark:    #c3621a;

  /* Functional */
  --info-blue:     #1864ab;
  --focus-ring:    0 0 0 3px rgba(232, 119, 34, 0.35);
  --shadow-sm:     0 1px 2px rgba(20,30,45,0.06);
  --shadow-md:     0 2px 6px rgba(20,30,45,0.08);

  --radius-sm: 3px;
  --radius:    5px;
  --radius-lg: 8px;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
             "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html, body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Visible focus ring everywhere — accessibility baseline */
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 3px;
}

/* Screen-reader-only utility */
.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-to-content link, visible on focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--bg-header);
  color: #fff;
  padding: 8px 14px;
  z-index: 1000;
  border-radius: 4px;
  font-size: 14px;
}
.skip-link:focus { top: 8px; }

/* ========= Research banner ========= */
.research-banner {
  background: #2e3a4d;
  color: #d4dae3;
  font-size: 13px;
  text-align: center;
  padding: 7px 16px;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #1c2a3a;
}
.research-banner .dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--brand);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  position: relative; top: -1px;
}

/* ========= Top header bar ========= */
.app-header {
  background: var(--bg-header);
  color: var(--text-on-dark);
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  padding: 0 28px;
  height: 64px;
  gap: 26px;
}
.app-header .brand {
  display: flex; align-items: center; gap: 12px;
}
/* Logo sits directly on the navy header — its black background blends in,
   and the orange book reads as the brand mark. No white frame. */
.app-header .brand img {
  height: 38px; width: 38px; object-fit: contain;
  border-radius: 4px;
  display: block;
}
.app-header .brand-text {
  display: flex; flex-direction: column; line-height: 1.2;
}
.app-header .brand-text .sys {
  font-size: 18px; font-weight: 600; letter-spacing: 0.1px;
}
.app-header .brand-text .sub {
  font-size: 13px; color: var(--text-on-dark-mute); letter-spacing: 0.3px;
}

.header-spacer { flex: 1; }

.header-right {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 16px;
}
.header-right .item {
  color: var(--text-on-dark-mute);
}
.header-right .item strong {
  color: var(--text-on-dark);
  font-weight: 500;
}
.header-right .clock {
  font-variant-numeric: tabular-nums;
}
.header-right .user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 22px;
}
.header-right .user-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.header-right .user-chip .meta { line-height: 1.15; }
.header-right .user-chip .meta .name { font-weight: 500; font-size: 14px; }
.header-right .user-chip .meta .role {
  font-size: 12px; color: var(--text-on-dark-mute);
}

.header-right .logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text-on-dark-mute);
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 4px;
}
.header-right .logout:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
}

/* ========= Main layout ========= */
.app-layout {
  display: block;
  min-height: calc(100vh - 64px - 34px);
}
.main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 34px 38px;
}

/* ========= Footer ========= */
.app-footer {
  background: #1c2a3a;
  color: var(--text-on-dark-mute);
  font-size: 12px;
  text-align: center;
  padding: 9px;
  letter-spacing: 0.4px;
  border-top: 1px solid var(--border-dark);
}
.app-footer .sep { margin: 0 8px; opacity: 0.5; }

/* ========= Common UI primitives ========= */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-strip);
}
.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.card-body { padding: 14px; }

.risk-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  letter-spacing: 0.2px;
}
.risk-tag::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
}
.risk-critical { color: var(--risk-critical); background: var(--risk-critical-bg); }
.risk-critical::before { background: var(--risk-critical); }
.risk-warning  { color: var(--risk-warning);  background: var(--risk-warning-bg);  }
.risk-warning::before  { background: var(--risk-warning); }
.risk-stable   { color: var(--risk-stable);   background: var(--risk-stable-bg);   }
.risk-stable::before   { background: var(--risk-stable); }

/* Risk text colors as utility classes (replaces inline styles) */
.risk-text-critical { color: var(--risk-critical); }
.risk-text-warning  { color: var(--risk-warning); }
.risk-text-stable   { color: var(--risk-stable); }

/* ========= Tables ========= */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 11px 12px;
  background: var(--bg-strip);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:hover td { background: var(--bg-hover); cursor: pointer; }
/* Critical rows: visible tint + left border so colorblind users see structure */
.table tr.row-critical td {
  background: rgba(192,57,43,0.10);
}
.table tr.row-critical td:first-child {
  box-shadow: inset 4px 0 0 var(--risk-critical);
}
.table tr.row-critical:hover td { background: rgba(192,57,43,0.16); }
.table th.num, .table td.num { text-align: right; }
.table th.center, .table td.center { text-align: center; }

.mono { font-family: var(--font-mono); font-size: 14px; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }

.trend-up   { color: var(--risk-critical); }
.trend-down { color: var(--risk-stable);   }
.trend-flat { color: var(--text-muted);    }

/* ========= Dashboard ========= */
.dash-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 14px;
}
.dash-header h1 {
  font-size: 28px; font-weight: 600;
  color: var(--text-primary);
}
.dash-header .sub {
  font-size: 17px; color: var(--text-secondary); margin-top: 4px;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  overflow: hidden;
}
.stat-card .label {
  font-size: 14px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-card .value {
  font-size: 34px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-card .delta {
  font-size: 14px; color: var(--text-muted);
}
.stat-card.critical .value { color: var(--risk-critical); }
.stat-card.warning  .value { color: var(--risk-warning); }

.toolbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
  padding: 12px 16px;
  font-size: 15px;
}
.toolbar .filter {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
}
.toolbar select, .toolbar input {
  border: 1px solid var(--border-strong);
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 15px;
  background: #fff;
  color: var(--text-primary);
}
.toolbar .right {
  margin-left: auto; color: var(--text-muted); font-size: 14px;
}

.patient-list-card {
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ========= Patient detail ========= */
.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--info-blue); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 7px; opacity: 0.5; }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.page-h1 {
  /* visually styled like a banner — but provides the H1 semantic */
  font-size: 1px; color: transparent; height: 0; margin: 0;
  position: absolute; left: -9999px;
}

.patient-banner {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--risk-critical);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}
.patient-banner.is-critical { border-left-color: var(--risk-critical); }
.patient-banner.is-warning  { border-left-color: var(--risk-warning); }
.patient-banner.is-stable   { border-left-color: var(--risk-stable); }

.patient-banner h2 { font-size: 28px; font-weight: 600; }
.patient-banner h2 .age-sex { color: var(--text-muted); font-weight: 400; }
.patient-banner .meta {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin-top: 6px;
  font-size: 16px; color: var(--text-secondary);
}
.patient-banner .meta span strong { color: var(--text-primary); font-weight: 500; }
.patient-banner .badges {
  display: flex; gap: 10px; align-items: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.detail-left, .detail-right { display: flex; flex-direction: column; gap: 18px; }

/* Vitals strip */
.vitals-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
}
.vital {
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  /* invisible left border placeholder so alarm/warn states don't shift layout */
  border-left: 3px solid transparent;
}
.vital:last-child { border-right: none; }
.vital .vname {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 5px;
}
/* Non-color alarm indicator: a small triangle/circle glyph */
.vital .vname .alarm-glyph {
  display: none;
  font-size: 12px;
}
.vital.alarm .vname .alarm-glyph,
.vital.warn  .vname .alarm-glyph { display: inline; }
.vital.alarm .vname .alarm-glyph { color: var(--risk-critical); }
.vital.warn  .vname .alarm-glyph { color: var(--risk-warning); }
.vital .vval {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.vital .vunit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 3px;
}
/* Non-color signal: left border for alarm/warn */
.vital.alarm { border-left-color: var(--risk-critical); background: rgba(192,57,43,0.04); }
.vital.warn  { border-left-color: var(--risk-warning);  background: rgba(180,83,9,0.04); }
.vital.alarm .vval { color: var(--risk-critical); }
.vital.warn  .vval { color: var(--risk-warning); }
.vital .vrange { font-size: 13px; color: var(--text-muted); }
.vital .sparkline { height: 16px; margin-top: 4px; }

/* Labs */
.labs-table { width: 100%; }
.labs-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.labs-table td:first-child { color: var(--text-secondary); }
.labs-table td.val {
  font-variant-numeric: tabular-nums; font-weight: 500;
}
.labs-table td.val.high {
  color: var(--risk-critical);
}
.labs-table td.val.high::after {
  content: " ↑";
  font-weight: 700;
  font-size: 0.85em;
}
.labs-table td.val.low  {
  color: var(--info-blue);
}
.labs-table td.val.low::after {
  content: " ↓";
  font-weight: 700;
  font-size: 0.85em;
}
.labs-table td.ref { color: var(--text-muted); font-size: 13px; }

/* Meds */
.med-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.med-row:last-child { border-bottom: none; }
.med-row .name { font-weight: 500; }
.med-row .dose { color: var(--text-secondary); }

/* AI panel */
.ai-card {
  background: linear-gradient(180deg, #fff 0%, #fbf3ec 100%);
  border: 1.5px solid #f3d9bf;
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand);
}
.ai-card .ai-label {
  font-size: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--brand-dark);
  font-weight: 600;
}
.ai-card .risk-big {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 8px;
}
.ai-card .risk-big .num {
  font-size: 54px;
  font-weight: 700;
  color: var(--risk-critical);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ai-card .risk-big .lbl {
  font-size: 18px; color: var(--text-secondary);
}
.ai-card .horizon {
  margin-top: 10px;
  font-size: 16px;
  color: var(--text-secondary);
}
.ai-card .horizon strong { color: var(--text-primary); }
.ai-card .explain-btn {
  margin-top: 14px;
  background: var(--bg-header);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 4px;
  font-size: 17px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ai-card .explain-btn:hover { background: #2d3e54; }
.ai-card .explain-btn.open { background: var(--brand); }

/* Explanation panel */
.explain-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.explain-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-strip);
}
.explain-tabs .tab {
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
}
.explain-tabs .tab .new-pill {
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.explain-tabs .tab.active {
  color: var(--text-primary);
  background: #fff;
  border-bottom-color: var(--brand);
}
.explain-tabs .tab:hover:not(.active) { background: var(--bg-hover); }
.explain-body { padding: 22px; }

/* SHAP view */
.shap-meta {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}
.shap-meta strong { color: var(--text-secondary); font-weight: 600; }
.shap-chart-wrap {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px;
  overflow-x: auto;
}
.shap-disclaimer {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  text-align: right;
  font-family: var(--font-mono);
}
.shap-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: #f0f3f7;
  border-left: 3px solid #5b6878;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.shap-note .sub { color: var(--text-muted); }

/* CPE view */
.cpe-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.cpe-section h4 {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.cpe-section h4 .step {
  background: var(--brand);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.cpe-narrative {
  background: #fcf6f0;
  border-left: 3px solid var(--brand);
  padding: 16px 18px;
  border-radius: 0 4px 4px 0;
  font-size: 18px;
  color: var(--text-primary);
  line-height: 1.55;
}
.cpe-narrative strong { color: var(--brand-dark); }

.action-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.action-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px;
  background: var(--bg-strip);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 17px;
}
.action-list li .check {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--risk-stable-bg);
  color: var(--risk-stable);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  margin-top: 2px;
  font-weight: 700;
}
.action-list li .label-strong {
  font-weight: 600; color: var(--text-primary);
}
.action-list li .why {
  color: var(--text-muted); font-size: 15px; display: block; margin-top: 3px;
}

.cpe-footnote {
  text-align: right; padding-top: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Pathway cards */
.path-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  overflow-x: visible;
}
.pathway-svg {
  display: block;
  width: 100%;
  height: auto;
}
.path-label {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.15;
  color: var(--text-primary);
  font-style: italic;
  text-align: center;
}
.pathway-main text {
  paint-order: stroke;
  stroke: rgba(255,255,255,0.55);
  stroke-width: 1px;
  stroke-linejoin: round;
}

/* ========= Login page ========= */
.login-wrap {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -20%, rgba(232,119,34,0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 120%, rgba(28,42,58,0.10), transparent 60%),
    linear-gradient(180deg, #f0f3f7 0%, #e5eaf0 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px 36px;
  box-shadow: 0 8px 30px rgba(20,30,45,0.08);
}
.login-card .logo-row {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
/* No dark frame around the logo on the login card —
   logo's own black square is sufficient visual weight. */
.login-card .logo-row img {
  height: 64px; width: 64px;
  border-radius: 10px;
  display: block;
}
.login-card h1 {
  font-size: 24px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.login-card .org {
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.login-card .sys-tag {
  text-align: center;
  font-size: 12px;
  color: var(--brand-dark);
  background: #fbeede;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin: 0 auto;
}
.login-card .center-tag {
  display: flex; justify-content: center; margin-bottom: 22px;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 17px;
  font-family: inherit;
  outline: none;
  color: var(--text-primary);
  background: #fff;
}
.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,119,34,0.18);
}
.login-btn {
  width: 100%;
  background: var(--bg-header);
  color: #fff;
  border: none;
  padding: 13px 14px;
  border-radius: 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: 6px;
}
.login-btn:hover { background: #2d3e54; }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}
.login-extras {
  display: flex; justify-content: space-between;
  font-size: 14px; color: var(--text-muted);
  margin-bottom: 18px;
}
.login-extras a { color: var(--info-blue); }
.login-extras a:hover { text-decoration: underline; }
.login-warn {
  background: #fef3c7;
  border: 1px solid #f5d8a3;
  color: #6e4a10;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 18px;
  line-height: 1.4;
}

/* Make table rows behave as links (the anchor wraps the row content). */
.row-link {
  display: contents;
  cursor: pointer;
  color: inherit;
}

/* ========= Responsive ========= */
@media (max-width: 1100px) {
  .vitals-strip { grid-template-columns: repeat(3, 1fr); }
  .vital {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .vital:nth-child(3n) { border-right: none; }
  .vital:nth-last-child(-n+3) { border-bottom: none; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 18px 18px 28px; }
  .app-header { padding: 0 16px; gap: 14px; }
  .header-right { gap: 14px; }
  .header-right .user-chip .meta { display: none; }
}

@media (max-width: 760px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .patient-banner { grid-template-columns: 1fr; }
  .patient-banner .badges { justify-content: flex-start; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .right { margin-left: 0; }
  .vitals-strip { grid-template-columns: repeat(2, 1fr); }
  .vital:nth-child(3n) { border-right: 1px solid var(--border); }
  .vital:nth-child(2n) { border-right: none; }
  .vital:nth-last-child(-n+2) { border-bottom: none; }
  .header-right .logout { display: none; }
}
