/* ────────────────────────────────────────────────────────────
   ArogyaSync · Hospital Dashboard
   Clinical-warm: deep indigo + navy, with warm amber accents
   ──────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body {
  background: var(--h-bg);
  color: var(--h-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
#root { height: 100vh; overflow: hidden; }
button { font-family: inherit; cursor: pointer; }

/* ─── Tokens ──────────────────────────────────────────── */
:root {
  --h-primary: #4F46E5;
  --h-primary-soft: rgba(79, 70, 229, 0.10);
  --h-accent: #ec4899;
  --h-alert: #ef4444;
  --h-alert-bg: rgba(239, 68, 68, 0.10);
  --h-warning: #f59e0b;
  --h-warning-bg: rgba(245, 158, 11, 0.10);
  --h-success: #22c55e;
  --h-success-bg: rgba(34, 197, 94, 0.10);
  --h-muted: #94a3b8;

  /* Backgrounds — warm, off-white */
  --h-bg: #FBF9F6;
  --h-bg-soft: #F5F2EC;
  --h-surface: #FFFFFF;
  --h-surface-2: #FAF7F2;

  /* Text */
  --h-text: #1A1A2E;
  --h-text-2: #4B5563;
  --h-text-3: #6B7280;

  /* Borders */
  --h-border: rgba(15, 23, 42, 0.08);
  --h-border-strong: rgba(15, 23, 42, 0.14);

  /* Shadows */
  --h-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --h-shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --h-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);

  --h-radius: 14px;
  --h-radius-sm: 10px;
  --h-radius-lg: 18px;
}

html.dark {
  --h-bg: #050A15;
  --h-bg-soft: #0B1325;
  --h-surface: #0E1B30;
  --h-surface-2: #142242;
  --h-text: #F1F5F9;
  --h-text-2: #CBD5E1;
  --h-text-3: #94A3B8;
  --h-muted: #64748B;
  --h-border: rgba(255, 255, 255, 0.06);
  --h-border-strong: rgba(255, 255, 255, 0.12);
  --h-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --h-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
  --h-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ─── Density variants ────────────────────────────────── */
.density-compact { --pad: 14px; --gap: 14px; --bed-min: 240px; }
.density-comfy { --pad: 20px; --gap: 20px; --bed-min: 280px; }
.density-spacious { --pad: 28px; --gap: 28px; --bed-min: 320px; }

/* ─── App shell ───────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh;
  background: var(--h-bg);
  position: relative;
}
.app.sb-mode-floating { grid-template-columns: 1fr; padding: 16px; gap: 16px; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ─── Sidebar ─────────────────────────────────────────── */
.sidebar {
  background: var(--h-surface);
  border-right: 1px solid var(--h-border);
  width: 240px;
  transition: width 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  height: 100vh;
  position: relative;
  z-index: 5;
}
.sidebar-icon { width: 72px; }
.sidebar-floating {
  width: 240px;
  height: calc(100vh - 32px);
  border-radius: 18px;
  border: 1px solid var(--h-border);
  position: fixed;
  left: 16px; top: 16px; bottom: 16px;
  box-shadow: var(--h-shadow-lg);
  z-index: 50;
}
.app.sb-mode-floating .main { margin-left: 256px; max-width: calc(100vw - 272px); }

.sidebar-inner {
  display: flex; flex-direction: column;
  height: 100%;
  padding: 18px 14px;
  overflow: hidden;
}

.sb-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--h-border);
}
.sb-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.sb-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sb-brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.sb-brand-sub { font-size: 11px; color: var(--h-muted); font-family: 'JetBrains Mono', monospace; }

.sb-nav {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1;
}
.sb-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--h-text-2);
  font-size: 13.5px; font-weight: 500;
  text-align: left;
  position: relative;
  width: 100%;
  transition: all 0.22s ease;
  animation: slideInLeft 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes slideInLeft {
  from { transform: translateX(-12px); }
  to { transform: translateX(0); }
}
.sb-nav-icon { display: grid; place-items: center; width: 22px; height: 22px; color: var(--h-text-3); transition: color 0.2s; }
.sb-nav-label { flex: 1; white-space: nowrap; }
.sb-nav-item:hover { background: var(--h-bg-soft); color: var(--h-text); }
.sb-nav-item:hover .sb-nav-icon { color: var(--h-primary); }
.sb-nav-item.active { background: var(--h-primary-soft); color: var(--h-primary); font-weight: 600; }
.sb-nav-item.active .sb-nav-icon { color: var(--h-primary); }
.sb-nav-rail { position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; }
.sb-nav-badge {
  background: var(--h-alert); color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
}
.sb-nav-badge-dot {
  position: absolute; right: 8px; top: 8px;
  width: 8px; height: 8px; padding: 0;
  border: 2px solid var(--h-surface);
}

.sb-footer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--h-border); }
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px;
  border-radius: 10px;
}
.sb-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 12px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.sb-user-text { flex: 1; min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 600; }
.sb-user-role { font-size: 11px; color: var(--h-muted); }
.sb-logout {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: none;
  color: var(--h-muted);
  display: grid; place-items: center;
  transition: all 0.2s;
}
.sb-logout:hover { background: var(--h-bg-soft); color: var(--h-alert); }

/* ─── Header ──────────────────────────────────────────── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: var(--h-surface);
  border-bottom: 1px solid var(--h-border);
  z-index: 4;
  gap: 20px;
}
.app.sb-mode-floating .header { border-radius: 14px; border: 1px solid var(--h-border); margin-bottom: 16px; }

.header-left { min-width: 0; flex: 1; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--h-muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-link { font-weight: 500; }
.bc-current { color: var(--h-text-2); font-weight: 600; }
.bc-sep { display: inline-flex; opacity: 0.5; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
.page-subtitle { font-size: 13px; color: var(--h-text-3); margin-top: 4px; }

.header-right { display: flex; align-items: center; gap: 12px; }

.header-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--h-bg-soft);
  border: 1px solid var(--h-border);
  border-radius: 10px;
  min-width: 320px;
  color: var(--h-muted);
  transition: border-color 0.2s;
}
.header-search:focus-within { border-color: var(--h-primary); }
.header-search input { background: transparent; border: 0; outline: 0; flex: 1; font-size: 13px; color: var(--h-text); font-family: inherit; }
.header-search input::placeholder { color: var(--h-muted); }
.header-search kbd {
  padding: 2px 6px;
  background: var(--h-surface); border: 1px solid var(--h-border);
  border-radius: 4px; font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--h-muted);
}

.live-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 8px; border: 1px solid var(--h-border);
  background: var(--h-bg-soft);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  font-family: 'JetBrains Mono', monospace;
  color: var(--h-text-2);
  transition: all 0.2s;
}
.live-toggle.on { color: var(--h-success); border-color: rgba(34,197,94,0.3); }
.live-toggle .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--h-muted);
}
.live-toggle.on .live-dot { background: var(--h-success); box-shadow: 0 0 8px var(--h-success); animation: pulse 1.6s ease-in-out infinite; }

.header-clock { font-family: 'JetBrains Mono', monospace; text-align: right; padding: 0 8px; border-left: 1px solid var(--h-border); border-right: 1px solid var(--h-border); }
.clock-time { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.clock-date { font-size: 10px; color: var(--h-muted); letter-spacing: 0.08em; }

.icon-btn {
  width: 36px; height: 36px;
  background: var(--h-bg-soft); border: 1px solid var(--h-border);
  border-radius: 10px;
  color: var(--h-text-2);
  display: grid; place-items: center;
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--h-primary-soft); color: var(--h-primary); border-color: var(--h-primary); }

/* ─── Screen wrapper + transitions ────────────────────── */
.screen {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 24px 28px 40px;
  animation: screenIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes screenIn {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}

/* ─── Card styles ─────────────────────────────────────── */
.card-flat { background: var(--h-surface); border: 1px solid var(--h-border); border-radius: var(--h-radius); }
.card-elevated { background: var(--h-surface); border: 1px solid var(--h-border); border-radius: var(--h-radius); box-shadow: var(--h-shadow); }
.card-glass {
  background: color-mix(in srgb, var(--h-surface) 70%, transparent);
  border: 1px solid var(--h-border-strong);
  border-radius: var(--h-radius);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.card-surface { background: var(--h-surface); border: 1px solid var(--h-border); border-radius: var(--h-radius); }

/* ─── Ward filters ────────────────────────────────────── */
.ward-filters {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ward-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  color: var(--h-text-2);
  transition: all 0.2s;
}
.ward-chip:hover { border-color: var(--h-border-strong); color: var(--h-text); }
.ward-chip.active { background: var(--h-primary); border-color: var(--h-primary); color: white; }
.ward-chip.active .chip-count { background: rgba(255,255,255,0.2); color: white; }
.ward-chip.active .ward-dot { background: white; }
.ward-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-count {
  background: var(--h-bg-soft);
  color: var(--h-text-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.ward-summary { display: flex; gap: 16px; font-size: 12px; color: var(--h-text-3); }
.ward-summary span { display: inline-flex; align-items: center; gap: 6px; }
.ward-summary .dot { width: 7px; height: 7px; border-radius: 50%; }

/* ─── Ward grid + bed cards ───────────────────────────── */
.ward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--bed-min), 1fr));
  gap: var(--gap);
}
.bed-entry {
  animation: bedIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes bedIn {
  from { transform: translateY(14px) scale(0.97); }
  to { transform: translateY(0) scale(1); }
}

.bed-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: 14px;
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
}
.bed-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--h-shadow-lg);
  border-color: var(--h-border-strong);
}
.bed-card.bed-alert {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(180deg, rgba(239,68,68,0.06) 0%, var(--h-surface) 60%);
}
.bed-card.bed-alert::before {
  content: ''; position: absolute; inset: -1px; border-radius: 14px;
  border: 2px solid var(--h-alert); opacity: 0.5;
  animation: alertPulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes alertPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 0.7; } }
.bed-card.bed-watch { border-color: rgba(245, 158, 11, 0.32); }
.bed-card.bed-idle { opacity: 0.7; }

.bed-card.card-glass {
  background: color-mix(in srgb, var(--h-surface) 70%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--h-border-strong);
}
.bed-card.card-elevated { box-shadow: var(--h-shadow); }
.bed-card.card-flat { box-shadow: none; }

.bed-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bed-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-shrink: 0; }
.bed-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.bed-ward { font-size: 11px; color: var(--h-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

.bed-patient { line-height: 1.3; }
.bed-patient-name { font-size: 14px; font-weight: 600; color: var(--h-text); }
.bed-patient-meta { font-size: 11.5px; color: var(--h-muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

.bed-wave-wrap {
  margin: 0 -4px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  padding: 4px;
}
html.dark .bed-wave-wrap { background: rgba(0,0,0,0.4); }

.bed-vitals {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  border-top: 1px solid var(--h-border); padding-top: 12px;
}
.bv-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.bv-icon { width: 22px; height: 22px; display: grid; place-items: center; }
.bv-num { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--h-text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.bv-unit { font-size: 10px; color: var(--h-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.bed-idle { display: flex; flex-direction: column; align-items: center; padding: 24px 0; gap: 10px; color: var(--h-muted); }
.bed-idle-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--h-bg-soft); display: grid; place-items: center; }
.bed-idle-text { font-size: 12px; }

.bed-alert-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--h-alert-bg);
  color: var(--h-alert);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
}
.bed-alert-pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--h-alert);
  box-shadow: 0 0 8px var(--h-alert); animation: pulse 1s infinite;
  flex-shrink: 0;
}

/* ─── Pulse keyframe ──────────────────────────────────── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ─── Live Vitals screen ──────────────────────────────── */
.screen-live { display: flex; flex-direction: column; gap: 20px; }

.live-patient-card {
  padding: 24px 28px;
  position: relative;
}
.live-back {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0; padding: 0;
  font-size: 12px; color: var(--h-muted); font-weight: 600;
  margin-bottom: 16px;
}
.live-back:hover { color: var(--h-primary); }
.live-avatar {
  width: 60px; height: 60px; border-radius: 16px;
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 20px;
  letter-spacing: 0.02em;
}
.live-patient-name { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.live-patient-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--h-text-3); margin-top: 6px; font-family: 'JetBrains Mono', monospace; }
.dot-sep { color: var(--h-muted); }

.live-strip { padding: 20px 24px; }
.live-strip-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.strip-label { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.strip-meta { font-size: 11px; color: var(--h-muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.strip-actions { display: flex; gap: 4px; padding: 4px; background: var(--h-bg-soft); border-radius: 8px; }
.strip-btn { padding: 5px 12px; background: transparent; border: 0; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--h-text-3); }
.strip-btn.active { background: var(--h-surface); color: var(--h-text); box-shadow: var(--h-shadow-sm); }
.live-strip-canvas { background: rgba(15,23,42,0.04); border-radius: 10px; padding: 12px; min-height: 160px; }
html.dark .live-strip-canvas { background: rgba(0,0,0,0.5); }

.live-vitals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.vital-big {
  position: relative;
  padding: 20px 22px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.vital-big:hover { transform: translateY(-3px); }
.vital-big::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--vital-color);
}
.vital-big.vital-out::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--h-alert);
  pointer-events: none;
  animation: alertPulse 2s infinite;
}
.vital-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vital-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.vital-label { font-size: 13px; font-weight: 600; color: var(--h-text-2); flex: 1; }
.vital-flag { font-size: 9.5px; font-weight: 700; padding: 3px 7px; background: var(--h-alert); color: white; border-radius: 4px; letter-spacing: 0.06em; }
.vital-value { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.vital-unit { font-size: 14px; font-weight: 500; color: var(--h-muted); margin-left: 6px; letter-spacing: 0; }
.vital-sub { font-size: 11px; color: var(--h-muted); margin-top: 6px; font-family: 'JetBrains Mono', monospace; }
.vital-spark { margin-top: 14px; }

/* ─── Hospitals list ──────────────────────────────────── */
.screen-hospitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.hospital-card {
  overflow: hidden;
  animation: bedIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}
.hospital-card:hover { transform: translateY(-4px); box-shadow: var(--h-shadow-lg); }
.hospital-banner { height: 88px; position: relative; padding: 16px; }
.hospital-code { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(255,255,255,0.85); letter-spacing: 0.12em; font-weight: 600; }
.hospital-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.hospital-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.hospital-city { font-size: 12px; color: var(--h-muted); }
.hospital-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--h-border); border-bottom: 1px solid var(--h-border); }
.hs-num { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.hs-lbl { font-size: 10px; color: var(--h-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.hospital-cta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  background: transparent; border: 0;
  font-size: 13px; font-weight: 600;
  color: var(--h-primary);
}
.hospital-cta:hover { gap: 8px; }

/* ─── Tables ──────────────────────────────────────────── */
.screen-patients, .screen-devices {
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: 14px;
  overflow: hidden;
}
.screen-patients.card-elevated, .screen-devices.card-elevated { box-shadow: var(--h-shadow); }
.screen-patients.card-glass, .screen-devices.card-glass {
  background: color-mix(in srgb, var(--h-surface) 70%, transparent);
  backdrop-filter: blur(20px);
}
.screen-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--h-border);
  background: var(--h-surface-2);
  gap: 12px;
}
.toolbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: 8px;
  flex: 1; max-width: 400px;
  color: var(--h-muted);
}
.toolbar-search input { background: transparent; border: 0; outline: 0; flex: 1; font-size: 13px; color: var(--h-text); }
.toolbar-search input::placeholder { color: var(--h-muted); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left;
  padding: 10px 16px;
  background: var(--h-surface-2);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; color: var(--h-text-3);
  border-bottom: 1px solid var(--h-border);
}
.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--h-border); font-size: 13px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-row {
  animation: rowIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rowIn {
  from { opacity: 0.001; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.data-row:hover { background: var(--h-bg-soft); }
.cell-patient { display: flex; align-items: center; gap: 10px; }
.cell-avatar {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--h-primary), var(--h-accent));
  color: white; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.mono { font-family: 'JetBrains Mono', monospace; }
.bar-mini { width: 60px; height: 6px; background: var(--h-bg-soft); border-radius: 3px; overflow: hidden; }
.bar-mini-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  font-family: inherit;
}
.btn-primary { background: var(--h-primary); color: white; }
.btn-primary:hover { background: color-mix(in srgb, var(--h-primary) 88%, black); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--h-text-2); border-color: var(--h-border); }
.btn-ghost:hover { background: var(--h-bg-soft); color: var(--h-text); }
.btn-sm { padding: 5px 11px; font-size: 11.5px; }

/* ─── Alert list ──────────────────────────────────────── */
.screen-alerts { display: flex; flex-direction: column; gap: 16px; }
.alert-filters { display: flex; gap: 8px; }
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px 16px 22px;
  position: relative;
  animation: bedIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 0.2s;
}
.alert-row:hover { transform: translateY(-2px); }
.alert-sev-bar { position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; }
.alert-sev-critical .alert-sev-bar { background: var(--h-alert); box-shadow: 0 0 12px var(--h-alert); }
.alert-sev-warning .alert-sev-bar { background: var(--h-warning); }
.alert-sev-info .alert-sev-bar { background: var(--h-primary); }
.alert-ack { opacity: 0.65; }
.alert-icon {
  width: 36px; height: 36px; border-radius: 10px;
  font-size: 16px;
  display: grid; place-items: center; flex-shrink: 0;
  font-weight: 700;
}
.alert-sev-critical .alert-icon { background: var(--h-alert-bg); color: var(--h-alert); }
.alert-sev-warning .alert-icon { background: var(--h-warning-bg); color: var(--h-warning); }
.alert-sev-info .alert-icon { background: var(--h-primary-soft); color: var(--h-primary); }
.alert-body { flex: 1; min-width: 0; }
.alert-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.alert-vital { font-size: 14px; font-weight: 700; }
.alert-value { font-size: 14px; color: var(--h-alert); font-weight: 700; }
.alert-sev-warning .alert-value { color: var(--h-warning); }
.alert-sev-info .alert-value { color: var(--h-primary); }
.alert-thresh { font-size: 11px; color: var(--h-muted); font-family: 'JetBrains Mono', monospace; }
.alert-meta { font-size: 12px; color: var(--h-text-3); margin-bottom: 4px; }
.alert-note { font-size: 12.5px; color: var(--h-text-2); }
.alert-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.alert-ack-tag { font-size: 11px; font-weight: 600; color: var(--h-success); padding: 4px 8px; background: var(--h-success-bg); border-radius: 6px; }

/* ─── Floor plan ──────────────────────────────────────── */
.floor-plan {
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: 14px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.floor-plan.card-elevated { box-shadow: var(--h-shadow); }
.floor-plan.card-glass { background: color-mix(in srgb, var(--h-surface) 75%, transparent); backdrop-filter: blur(20px); }
.fp-head { display: flex; justify-content: space-between; align-items: center; }
.fp-title { font-size: 15px; font-weight: 700; }
.fp-sub { font-size: 12px; color: var(--h-muted); }
.fp-legend { display: flex; gap: 14px; font-size: 11px; color: var(--h-text-3); font-weight: 500; }
.fp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ldot { width: 8px; height: 8px; border-radius: 50%; }
.fp-svg {
  width: 100%; aspect-ratio: 100 / 80;
  background:
    linear-gradient(rgba(79, 70, 229, 0.04) 1px, transparent 1px) 0 0 / 4% 4%,
    linear-gradient(90deg, rgba(79, 70, 229, 0.04) 1px, transparent 1px) 0 0 / 4% 4%,
    var(--h-bg-soft);
  border-radius: 12px;
  border: 1px solid var(--h-border);
}
.fp-summary { display: flex; flex-direction: column; gap: 4px; }
.fp-alert-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--h-alert-bg);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s;
}
.fp-alert-row:hover { transform: translateX(4px); }

/* ─── Toasts ──────────────────────────────────────────── */
.toast-stack {
  position: fixed; right: 24px; top: 88px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-left: 3px solid var(--h-primary);
  border-radius: 11px;
  box-shadow: var(--h-shadow-lg);
  width: 320px;
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast-alert { border-left-color: var(--h-alert); }
.toast-success { border-left-color: var(--h-success); }
.toast-info { border-left-color: var(--h-primary); }
.toast-icon {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--h-primary-soft); color: var(--h-primary);
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 14px; font-weight: 700;
}
.toast-alert .toast-icon { background: var(--h-alert-bg); color: var(--h-alert); }
.toast-success .toast-icon { background: var(--h-success-bg); color: var(--h-success); }
.toast-x {
  width: 22px; height: 22px; border-radius: 6px;
  background: transparent; border: 0;
  color: var(--h-muted); font-size: 16px;
  display: grid; place-items: center;
  margin-left: auto;
}
.toast-x:hover { background: var(--h-bg-soft); color: var(--h-text); }
@keyframes toastIn {
  from { transform: translateX(80px); }
  to { transform: translateX(0); }
}

/* ─── Scrollbar ───────────────────────────────────────── */
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-thumb { background: var(--h-border-strong); border-radius: 4px; }
.screen::-webkit-scrollbar-track { background: transparent; }
