:root {
  /* --- Sophisticated HSL Palettes --- */
  --hull-bg: hsl(210, 40%, 98%);
  --hull-glass: hsla(210, 40%, 98%, 0.85);
  
  --accent-cyan: hsl(199, 89%, 48%);
  --accent-cyan-soft: hsla(199, 89%, 48%, 0.1);
  --accent-cyan-glow: hsla(199, 89%, 48%, 0.3);
  
  --accent-purple: hsl(262, 83%, 58%);
  --accent-green: hsl(152, 69%, 31%);
  --accent-green-soft: hsla(152, 69%, 31%, 0.1);
  
  --alert-red: hsl(0, 84%, 60%);
  --warning-amber: hsl(38, 92%, 50%);
  
  --text-primary: hsl(222, 47%, 11%);
  --text-secondary: hsl(215, 25%, 27%);
  --text-muted: hsl(215, 16%, 47%);
  
  --card-bg: hsl(0, 0%, 100%);
  --card-border: hsla(215, 32%, 17%, 0.08);
  --glass-border: hsla(0, 0%, 100%, 0.4);
  
  --glass-blur: blur(24px);
  --shadow-premium: 
    0 4px 6px -1px hsla(222, 47%, 11%, 0.05),
    0 10px 15px -3px hsla(222, 47%, 11%, 0.1),
    0 20px 40px -12px hsla(222, 47%, 11%, 0.15);
  
  --transition-snappy: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

.hospital-console-container ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.hospital-console-container ::-webkit-scrollbar-track {
  background: transparent;
}

.hospital-console-container ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.hospital-console-container ::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.hospital-console-container {
  height: 100vh;
  width: 100vw;
  background: #F8FAFC;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* --- SELECTION LANDING --- */
.hospital-selection-overlay {
  position: fixed;
  inset: 0;
  background: var(--base-bg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 40px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background-image: url('/console_bg.png');
  background-size: cover;
  background-position: center;
}

@media (max-width: 768px) {
  .hospital-selection-overlay { padding: 40px 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── PREMIUM CONSOLE HEADER V2 ─── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.console-header-premium {
  position: relative;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  background: #ffffff;
  border-bottom: 1px solid #edf2f7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.header-glass-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, hsla(0, 0%, 100%, 0.5) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Top Row: Brand + Utility ─────────────── */
.header-content-wrap {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 56px;
  min-height: 56px;
  position: relative;
  z-index: 2;
}

.brand-section-interactive {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 6px 14px 6px 8px;
  border-radius: 12px;
  transition: var(--transition-snappy);
  flex-shrink: 0;
}

.brand-section-interactive:hover {
  background: hsla(199, 89%, 48%, 0.06);
}

.node-indicator {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.pulse-dot {
  width: 100%;
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan-glow);
}

.pulse-ring {
  position: absolute;
  inset: -4px;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  animation: hdr-pulse-ring 2.5s infinite;
  opacity: 0.4;
}

@keyframes hdr-pulse-ring {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.8); opacity: 0; }
}

.hospital-brand-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hospital-name-glow {
  font-size: 1rem;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.protocol-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.status-tag {
  color: var(--accent-green);
}

/* ── Header Right Utility ─────────────── */
.header-utility-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.realtime-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: hsla(210, 30%, 94%, 0.8);
  padding: 5px 12px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  border: 1px solid var(--card-border);
}

.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition-snappy);
}

.mobile-toggle-btn:hover {
  background: hsla(0, 0%, 0%, 0.05);
}

/* ── Navigation Bar Strip ─────────────── */
.premium-nav-bar {
  position: relative;
  z-index: 1;
  border-top: 1px solid hsla(215, 32%, 17%, 0.04);
  padding: 0 24px;
  overflow: hidden;
}

.nav-scroll-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 4px;
}

.nav-scroll-wrap::-webkit-scrollbar {
  display: none;
}

.nav-group {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.nav-spacer {
  flex: 1;
  min-width: 16px;
  flex-shrink: 1;
}

.nav-group.secondary {
  border-left: 1px solid var(--card-border);
  margin-left: 4px;
  padding-left: 8px;
}

.nav-item-premium {
  background: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-item-premium:hover {
  color: var(--text-primary);
  background: #f8fafc;
}

.nav-item-premium.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

.active-underline {
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 2px 2px 0 0;
}

/* ── MOBILE OVERLAY BACKDROP ─────────── */
.mobile-nav-backdrop {
  display: none;
}

/* ── MOBILE BOTTOM NAV ─────────────── */
.mobile-bottom-nav {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── RESPONSIVE: TABLET (≤ 1100px) ─── */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .header-content-wrap {
    padding: 0 20px;
    height: 52px;
    min-height: 52px;
  }

  .hospital-name-glow {
    font-size: 0.92rem;
  }

  .show-desktop {
    display: none !important;
  }

  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Nav drawer: slide from right ─── */
  .premium-nav-bar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 300px;
    max-width: 85vw;
    background: hsla(210, 40%, 99%, 0.98);
    backdrop-filter: blur(40px) saturate(1.8);
    border-top: none;
    border-left: 1px solid var(--card-border);
    box-shadow: -20px 0 60px hsla(222, 47%, 11%, 0.12);
    padding: 0;
    overflow: hidden;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .premium-nav-bar.mobile-open {
    transform: translateX(0);
  }

  .nav-scroll-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 72px 16px 24px;
    overflow-x: visible;
    overflow-y: auto;
    height: 100%;
  }

  .nav-group {
    flex-direction: column;
    gap: 2px;
  }

  .nav-group.secondary {
    border-left: none;
    border-top: 1px solid var(--card-border);
    margin-left: 0;
    margin-top: 8px;
    padding-left: 0;
    padding-top: 12px;
  }

  .nav-spacer {
    display: none;
  }

  .nav-item-premium {
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    gap: 12px;
    color: var(--text-secondary);
  }

  .nav-item-premium:hover {
    background: hsla(199, 89%, 48%, 0.06);
  }

  .nav-item-premium.active {
    background: hsla(199, 89%, 48%, 0.08);
    color: var(--accent-cyan);
  }

  .active-underline {
    display: none;
  }

  /* ── Backdrop overlay ─── */
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: hsla(222, 47%, 11%, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-nav-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* ── Mobile bottom nav bar ─── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: hsla(210, 40%, 99%, 0.96);
    backdrop-filter: blur(24px) saturate(1.6);
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -4px 20px hsla(222, 47%, 11%, 0.06);
    z-index: 1500;
    padding: 0 8px;
    align-items: center;
    justify-content: space-around;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: color 0.2s ease;
    flex: 1;
    max-width: 72px;
    position: relative;
  }

  .bottom-nav-item span {
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .bottom-nav-item.active {
    color: var(--accent-cyan);
  }

  .bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2.5px;
    background: var(--accent-cyan);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px var(--accent-cyan-glow);
  }

  /* Adjust main content for bottom nav */
  .console-main {
    padding-bottom: 80px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── RESPONSIVE: SMALL MOBILE (≤ 600px) ─── */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .header-content-wrap {
    padding: 0 14px;
    height: 48px;
    min-height: 48px;
    gap: 10px;
  }

  .brand-section-interactive {
    gap: 10px;
    padding: 4px 8px 4px 4px;
  }

  .hospital-name-glow {
    font-size: 0.82rem;
    max-width: 160px;
  }

  .protocol-status-row {
    display: none;
  }

  .premium-nav-bar {
    width: 280px;
  }

  .nav-item-premium {
    font-size: 0.82rem;
    padding: 12px 14px;
  }

  .bottom-nav-item {
    max-width: 60px;
  }

  .bottom-nav-item span {
    font-size: 0.52rem;
  }

  .mobile-bottom-nav {
    height: 60px;
  }
}

.selection-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow-sphere {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  filter: blur(160px);
  opacity: 0.12;
  animation: float-slow 20s infinite alternate;
}

.glow-sphere.top-left { top: -300px; left: -300px; background: var(--accent-cyan); }
.glow-sphere.bottom-right { bottom: -300px; right: -300px; background: var(--accent-purple); animation-delay: -10s; }

@keyframes float-slow {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(100px, 50px) scale(1.1); }
}

.selection-content {
  width: 100%;
  max-width: 1400px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: auto;
  padding: 40px 0;
  min-height: calc(100vh - 160px);
}

.selection-header {
  text-align: center;
  margin-bottom: 60px;
  max-width: 800px;
}

.brand-logo.large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: 32px;
  color: var(--accent-cyan);
  text-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.selection-header h1 {
  font-size: 4rem;
  font-weight: 950;
  background: linear-gradient(180deg, #1E293B 30%, rgba(30, 41, 59, 0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  letter-spacing: -3px;
  line-height: 0.9;
}

.selection-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hospital-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  padding: 20px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .selection-header h1 { font-size: 2.2rem; letter-spacing: -1.5px; }
  .brand-logo.large { font-size: 1.6rem; gap: 12px; margin-bottom: 16px; }
  .selection-subtitle { font-size: 0.9rem; letter-spacing: 0.05em; line-height: 1.4; }
  .hospital-grid { grid-template-columns: 1fr; gap: 20px; padding: 10px; }
  .hospital-selection-overlay { padding: 40px 16px; }
}

@media (max-width: 380px) {
  .selection-header h1 { font-size: 1.8rem; }
  .hospital-select-card { padding: 20px; gap: 20px; }
}

.hospital-select-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.05);
}

.hospital-select-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(0, 0, 0, 0.02);
}

.h-icon-bg {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
  margin: 0 auto;
}

.hospital-select-card h3 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 950;
  margin: 0;
  letter-spacing: -0.5px;
}

.no-hospitals, .loading-hospitals {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  padding: 60px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  max-width: 600px;
  margin: 40px auto;
  backdrop-filter: var(--glass-blur);
}

.security-scan-line {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.security-scan-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  animation: scan-move 3s infinite linear;
}

@keyframes scan-move {
  0% { left: -100%; }
  100% { left: 100%; }
}

.h-status-pulse {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}
.h-status-pulse.Active { background: rgba(0, 226, 114, 0.1); color: var(--accent-green); border: 1px solid rgba(0, 226, 114, 0.2); }

.bed-progress { height: 10px; background: rgba(255,255,255,0.05); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%;  background: linear-gradient(90deg, var(--accent-cyan), #3B82F6); box-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }

.select-hospital-btn {
  margin-top: auto;
  padding: 18px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.4s;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
}

.h-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.h-type {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.h-beds {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bed-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* --- CONSOLE HEADER --- */
.console-header.premium {
  padding: 0 16px;
  height: 58px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(50px) saturate(2);
  border-bottom: 1px solid var(--card-border);
  display: grid;
  grid-template-columns: minmax(0, 140px) 1fr auto;
  align-items: center;
  gap: 8px;
  z-index: 1200;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.header-left {
  min-width: 0;
  overflow: hidden;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .console-header.premium {
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    grid-template-columns: 1fr auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .header-left { grid-column: 1; }
  .console-nav-modern { grid-column: 1 / -1; order: 3; }
}

.brand-glow-container {
  position: relative;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.h-glow {
  position: absolute;
  inset: -10px;
  background: var(--accent-cyan);
  filter: blur(25px);
  opacity: 0.15;
}

.console-nav-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-tab-container {
  display: flex;
  align-items: center;
  gap: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge */
  flex-wrap: nowrap;
  width: 100%;
  justify-content: center;
}

.nav-tab-container::-webkit-scrollbar { display: none; }

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--card-border);
  margin: 0 3px;
  flex-shrink: 0;
}

/* ── HAMBURGER DRAWER: true mobile only ─────────── */
@media (max-width: 860px) {
  .console-nav-modern {
    position: fixed;
    top: 0; right: 0;
    width: 300px; height: 100vh;
    background: #F8FAFC;
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 28px;
    z-index: 3000;
    border-left: 1px solid var(--card-border);
    box-shadow: -40px 0 80px rgba(0,0,0,0.1);
    transform: translateX(105%);
    visibility: hidden;
    gap: 32px;
  }

  .console-nav-modern.mobile-open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-tab-container {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 8px;
  }

  .nav-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
  }

  .nav-tab {
    width: 100%;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
    gap: 14px !important;
  }

  .nav-tab span { display: inline !important; }
}

/* ── COMPACT: hide labels 900–1200px ─────────────── */
@media (min-width: 861px) and (max-width: 1200px) {
  .nav-tab {
    padding: 8px 10px !important;
    gap: 0 !important;
    border-radius: 10px !important;
  }
  .nav-tab span { display: none !important; }
  .nav-divider { margin: 0 2px; }
  .nav-tab-container { gap: 1px; }
}

/* ── FULL LABELS: 1200px+ ─────────────────────────── */
@media (min-width: 1201px) {
  .nav-tab {
    padding: 7px 11px !important;
    font-size: 0.72rem !important;
    gap: 6px !important;
  }
  .nav-tab-container { gap: 0px; }
  .nav-divider { margin: 0 3px; }
}

.mobile-close-btn, .menu-toggle-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-close-btn { position: absolute; top: 24px; right: 24px; }
.menu-toggle-btn { padding: 10px; background: rgba(255,255,255,0.05); border-radius: 12px; }

.back-btn-mobile {
  background: rgba(255,255,255,0.05);
  border: none;
  color: #fff;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  margin-right: 12px;
}

.nav-tab {
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: #f1f5f9;
}

.nav-tab.active {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  font-weight: 600;
}

.search-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.02);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-mini:focus-within {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.search-mini input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  width: 220px;
}

.tab-indicator {
  position: absolute;
  bottom: 0px;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--accent-cyan);
  opacity: 0;
  transition: all 0.4s;
  border-radius: 5px 5px 0 0;
  box-shadow: 0 0 15px var(--accent-cyan);
}

.nav-tab.active .tab-indicator { opacity: 1; }

/* --- MODULE CONTENT --- */
.console-main {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  background: #f8f9fb;
}

@media (max-width: 1100px) {
  .console-main {
    padding: 20px 16px;
    padding-bottom: 80px;
  }
}

@media (max-width: 600px) {
  .console-main {
    padding: 14px 10px;
    padding-bottom: 76px;
  }
}

.module-content {
  height: 100%;
  animation: slide-up-premium 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slide-up-premium {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ED MONITOR GRID */
.ed-grid-modern {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
  min-width: 0;
}

@media (max-width: 1500px) {
  .ed-grid-modern { grid-template-columns: 1fr 320px; gap: 20px; }
}

@media (max-width: 1280px) {
  .ed-grid-modern { grid-template-columns: 1fr 280px; gap: 16px; }
}

@media (max-width: 1100px) {
  .ed-grid-modern { grid-template-columns: 1fr; }
  .ed-ops-side-panel { position: static !important; }
}

/* --- PREMIUM FLEET VIEW --- */
.fleet-visibility-grid-premium {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  height: calc(100vh - 180px);
}

.map-command-surface {
  position: relative;
  background: #0a0e14;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-premium);
}

.map-overlay-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 5;
}

.map-scan-lines {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
  z-index: 4;
  opacity: 0.1;
}

.map-placeholder-premium {
  width: 100%;
  height: 100%;
  position: relative;
}

.map-coordinate-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.node-marker-premium {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 10;
}

.marker-core {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  position: relative;
  z-index: 2;
  transition: var(--transition-snappy);
}

.node-marker-premium.status-running .marker-core { background: var(--accent-cyan); color: #fff; }
.node-marker-premium.status-idle .marker-core { background: var(--text-muted); color: #fff; }
.node-marker-premium.status-breakdown .marker-core { background: var(--alert-red); color: #fff; }

.marker-ping {
  position: absolute;
  inset: -10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  animation: marker-ping 2s infinite;
}

@keyframes marker-ping {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.marker-label-premium {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(255,255,255,0.1);
}

.marker-label-premium .id { font-size: 0.7rem; font-weight: 950; color: #fff; }
.marker-label-premium .type { font-size: 0.5rem; font-weight: 700; color: var(--accent-cyan); }

.map-hud-controls {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
}

.hud-group {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 12px;
  transition: var(--transition-snappy);
}

.hud-btn:hover { background: hsla(0, 0%, 100%, 0.1); }

.fleet-mission-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-head {
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
}

.sidebar-head h4 { margin: 0; font-size: 0.9rem; font-weight: 900; }
.sidebar-head p { margin: 4px 0 0; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); }

.status-summary-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-cyan-soft);
  padding: 4px 12px;
  border-radius: 20px;
}

.status-summary-mini .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); }
.status-summary-mini .val { font-size: 0.8rem; font-weight: 900; color: var(--accent-cyan); }

.fleet-unit-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-bottom: 100px;
}

.unit-mission-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-snappy);
  position: relative;
  overflow: hidden;
}

.unit-mission-card.critical { border-color: var(--alert-red); }

.unit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.type-badge {
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
}
.status-pill.running { background: var(--accent-cyan-soft); color: var(--accent-cyan); }
.status-pill.idle { background: hsla(0, 0%, 0%, 0.05); color: var(--text-secondary); }
.status-pill.breakdown { background: hsla(0, 84%, 60%, 0.1); color: var(--alert-red); }

/* --- ePCR & DOCUMENTATION MODULE --- */
.epcr-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pcr-modal-overlay {
  position: fixed;
  inset: 0;
  background: hsla(var(--hull-dark-h), var(--hull-dark-s), 5%, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.pcr-detail-card {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: #fff;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px hsla(0, 0%, 0%, 0.5);
  border: 1px solid var(--card-border);
}

.pcr-detail-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--hull-glass);
}

.pcr-id-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 850;
  color: var(--text-primary);
  font-family: var(--font-header);
  letter-spacing: -0.01em;
}

.pcr-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pcr-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 950;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.bio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background: hsla(var(--hull-h), var(--hull-s), 50%, 0.03);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.bio-item .label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.bio-item .value {
  font-size: 0.875rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-left: 8px;
}

.pcr-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.vitals-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.trend-item {
  background: #fff;
  border: 1px solid var(--card-border);
  padding: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition-snappy);
}

.trend-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 20px -5px hsla(var(--accent-cyan-h), 100%, 50%, 0.1);
}

.trend-item .label {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
}

.trend-item .value {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-primary);
}

.sparkline-placeholder {
  height: 24px;
  background: linear-gradient(90deg, transparent, hsla(var(--accent-cyan-h), 100%, 50%, 0.1), transparent);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.sparkline-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 L20 15 L40 5 L60 18 L80 12 L100 15' fill='none' stroke='%233b82f6' stroke-width='2'/%3E%3C/svg%3E");
  background-size: cover;
  opacity: 0.4;
}

.med-list-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.med-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  background: hsla(0, 0%, 0%, 0.02);
  padding: 8px 12px;
  border-radius: 8px;
}

.med-item.highlight {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
}

.sign-off-panel {
  background: var(--accent-cyan-soft);
  border: 1px dashed var(--accent-cyan);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.pending-sign-area p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 20px;
}

.confirm-sign-btn {
  background: var(--accent-cyan);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 12px;
  font-weight: 850;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-snappy);
}

/* --- CLINICAL INTELLIGENCE / ANALYTICS V2 --- */
.analytics-v2 {
  background: transparent;
  padding: 0;
}

.clinical-intel-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.intel-filters {
  display: flex;
  background: var(--hull-glass);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.intel-filter-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-snappy);
}

.intel-filter-btn.active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 4px 12px hsla(0, 0%, 0%, 0.05);
}

.intelligence-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.kpi-card-modern {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-snappy);
}

.kpi-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-premium);
}

.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(0, 0%, 0%, 0.03);
  color: var(--text-primary);
}

.neon-blue .kpi-icon { background: hsla(210, 100%, 50%, 0.05); color: #3b82f6; }
.neon-purple .kpi-icon { background: hsla(270, 100%, 50%, 0.05); color: #8b5cf6; }
.neon-green .kpi-icon { background: hsla(142, 100%, 50%, 0.05); color: #10b981; }
.neon-amber .kpi-icon { background: hsla(38, 100%, 50%, 0.05); color: #f59e0b; }

.kpi-info label {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
}

.kpi-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.kpi-value-wrap .value {
  font-size: 1.5rem;
  font-weight: 950;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-value-wrap .trend {
  font-size: 0.75rem;
  font-weight: 850;
}

.trend.positive { color: #10b981; }
.trend.neutral { color: var(--text-muted); }

.analytics-body-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.intel-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.intel-card.large {
  min-height: 400px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 950;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.legend-mini {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
}

.l-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.l-dot.current { background: var(--accent-cyan); }
.l-dot.base { background: var(--text-muted); opacity: 0.5; }

.viewport-chart.donut {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-center-label {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center-label .v {
  display: block;
  font-size: 1.75rem;
  font-weight: 950;
  color: var(--text-primary);
  line-height: 1;
}

.donut-center-label .l {
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.pie-legend-v2 {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- ED MONITOR V2 & TRIAGE BOARD --- */
.ed-monitor-v2 {
  background: transparent;
  padding: 0;
}

.triage-scroll-area-modern {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 8px;
}

.patient-triage-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  display: flex;
  overflow: hidden;
  transition: all 0.15s ease;
  position: relative;
}

.patient-triage-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.triage-sidebar {
  width: 4px;
  flex-shrink: 0;
}

.triage-sidebar.critical, .triage-sidebar.Red { background: var(--alert-red); }
.triage-sidebar.emergent, .triage-sidebar.Yellow { background: #f59e0b; }
.triage-sidebar.standard, .triage-sidebar.Green { background: #10b981; }

.t-card-main {
  flex: 1;
  display: grid;
  grid-template-columns: 100px 1fr 1fr 200px;
  align-items: center;
  padding: 14px 20px;
}

.t-unit-hex {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid var(--card-border);
  padding-right: 20px;
}

.unit-id {
  font-size: 0.875rem;
  font-weight: 950;
  color: var(--text-primary);
  font-family: var(--font-header);
}

.eta-block {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 850;
  color: var(--accent-cyan);
  margin-top: 4px;
}

.t-patient-info {
  padding: 0 24px;
}

.p-name-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.p-name-row h4 {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
}

.p-id {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 800;
}

.p-bio {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.clinical-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 850;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 8px;
  text-transform: uppercase;
}

.clinical-status-pill.critical, .clinical-status-pill.Red { background: hsla(0, 84%, 60%, 0.1); color: var(--alert-red); }
.clinical-status-pill.emergent, .clinical-status-pill.Yellow { background: hsla(38, 92%, 50%, 0.1); color: #f59e0b; }
.clinical-status-pill.standard, .clinical-status-pill.Green { background: hsla(142, 70%, 45%, 0.1); color: #10b981; }

.t-vitals-stream {
  display: flex;
  gap: 20px;
  padding: 0 24px;
  border-left: 1px solid var(--card-border);
}

.v-stream-node {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v-stream-node.hr { color: var(--accent-cyan); }
.v-stream-node.o2 { color: #10b981; }

.v-stream-node .val {
  display: block;
  font-size: 1.125rem;
  font-weight: 950;
  line-height: 1;
}

.v-stream-node .val-bp {
  display: block;
  font-size: 0.875rem;
  font-weight: 950;
  color: var(--text-primary);
}

.v-stream-node .lab {
  font-size: 0.55rem;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
}

.t-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.intel-action-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  font-size: 0.75rem;
  font-weight: 850;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  transition: var(--transition-snappy);
}

.intel-action-btn.video { color: var(--accent-cyan); border-color: var(--accent-cyan-soft); background: var(--accent-cyan-soft); }
.intel-action-btn.video:hover { background: var(--accent-cyan); color: #fff; border-color: var(--accent-cyan); }

.intel-action-btn.admit { background: var(--text-primary); color: #fff; border: none; }
.intel-action-btn.admit:hover { transform: translateY(-2px); box-shadow: 0 4px 12px hsla(0, 0%, 0%, 0.2); }

.more-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Side Panel */
.ed-intel-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hub-card.high-intensity {
  background: var(--text-primary);
  color: #fff;
  border-radius: 20px;
  padding: 24px;
}

.hub-label {
  font-size: 0.6rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin-bottom: 16px;
}

.hub-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.broadcast-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  border: none;
  background: hsla(0, 0%, 100%, 0.1);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-snappy);
}

.broadcast-btn:hover { background: hsla(0, 0%, 100%, 0.2); transform: scale(1.02); }

.broadcast-btn.code-red { border: 1px solid var(--alert-red); }
.broadcast-btn.code-red .b-icon { color: var(--alert-red); }

.broadcast-btn.code-trauma { border: 1px solid #f59e0b; }
.broadcast-btn.code-trauma .b-icon { color: #f59e0b; }

.b-text strong { display: block; font-size: 1rem; font-weight: 950; }
.b-text span { font-size: 0.65rem; font-weight: 750; opacity: 0.7; }

.intel-side-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
}

.card-lbl {
  font-size: 0.65rem;
  font-weight: 950;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.meter-row { margin-bottom: 16px; }
.m-info { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 850; color: var(--text-primary); margin-bottom: 6px;}

.m-bar { height: 6px; background: hsla(0, 0%, 0%, 0.05); border-radius: 3px; overflow: hidden; }
.m-fill { height: 100%; border-radius: 3px; }
.m-fill.warning { background: #f59e0b; }
.m-fill.critical { background: var(--alert-red); }

.hms-sync-trigger {
  width: 100%;
  padding: 10px;
  background: hsla(0, 0%, 0%, 0.03);
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 850;
  color: var(--text-muted);
  cursor: pointer;
}

.intel-log-list { display: flex; flex-direction: column; gap: 12px; }
.log-item { display: flex; gap: 10px; }
.log-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--card-border); margin-top: 6px; flex-shrink: 0; }
.log-item .dot.pulse-blue { background: var(--accent-cyan); box-shadow: 0 0 10px var(--accent-cyan); animation: pulse-dot 2s infinite; }
.log-item p { margin: 0; font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); line-height: 1.4; }

@keyframes pulse-dot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 1200px) {
  .t-card-main { grid-template-columns: 100px 1fr 1fr; }
  .t-card-actions { grid-column: span 3; margin-top: 16px; border-top: 1px solid var(--card-border); padding-top: 12px; }
  .analytics-body-layout { grid-template-columns: 1fr; }
  .intelligence-footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .t-card-main { grid-template-columns: 1fr; gap: 16px; }
  .t-unit-hex { border-right: none; border-bottom: 1px solid var(--card-border); padding: 0 0 16px 0; width: 100%; }
  .t-patient-info { padding: 0; }
  .t-vitals-stream { padding: 16px 0; border-left: none; border-top: 1px solid var(--card-border); width: 100%; justify-content: space-between; }
  .t-card-actions { grid-column: span 1; justify-content: space-between; }
  .kpi-strip { grid-template-columns: 1fr; }
  .card-top { flex-direction: column; gap: 12px; }
  .pcr-modal-overlay { padding: 12px; }
  .pcr-row-split { grid-template-columns: 1fr; }
  .bio-grid { grid-template-columns: 1fr; }
}

.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: hsla(0, 0%, 0%, 0.02);
  border-radius: 12px;
}

.l-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.l-name {
  font-size: 0.75rem;
  font-weight: 850;
  color: var(--text-secondary);
}

.l-val {
  font-size: 0.8125rem;
  font-weight: 950;
  color: var(--text-primary);
}

.intelligence-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.intel-card.no-bg { background: transparent; border: 1px dashed var(--card-border); }

.dept-load-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dept-progress-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 850;
}

.d-name { color: var(--text-primary); }
.d-val { color: var(--text-muted); }

.d-bar-bg {
  height: 8px;
  background: hsla(0, 0%, 0%, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.d-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-title.alert-mode {
  color: var(--alert-red);
}

.anomaly-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anomaly-item {
  padding: 12px 16px;
  background: hsla(0, 0%, 0%, 0.02);
  border-radius: 12px;
  border-left: 3px solid var(--accent-cyan);
}

.anomaly-item.warning {
  border-left-color: var(--alert-red);
  background: hsla(0, 84%, 60%, 0.02);
}

.anomaly-item .time {
  font-size: 0.65rem;
  font-weight: 950;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.anomaly-item p {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.signed-at {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.pcr-detail-footer {
  padding: 20px 32px;
  background: var(--hull-glass);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.pcr-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 750;
  font-size: 0.8125rem;
  border: 1px solid var(--card-border);
  background: #fff;
  cursor: pointer;
  transition: var(--transition-snappy);
}

.pcr-action-btn.primary {
  background: var(--text-primary);
  color: #fff;
  border: none;
}

@media (max-width: 768px) {
  .pcr-modal-overlay { padding: 12px; }
  .pcr-row-split { grid-template-columns: 1fr; }
  .bio-grid { grid-template-columns: 1fr; }
}

.unit-card-body h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 1000;
  letter-spacing: -0.5px;
}

.unit-stats-row {
  display: flex;
  gap: 16px;
}

.u-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.highlight-cyan { color: var(--accent-cyan); }

.mission-active-indicator {
  margin-top: 12px;
  background: hsla(262, 83%, 58%, 0.05);
  padding: 12px;
  border-radius: 12px;
  border-left: 3px solid var(--accent-purple);
}

.m-label { font-size: 0.55rem; font-weight: 900; color: var(--accent-purple); margin-bottom: 2px; }
.m-id { font-size: 0.85rem; font-weight: 950; color: var(--text-primary); }

.unit-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px dashed var(--card-border);
}

.crew-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.unit-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-snappy);
}

.unit-action-btn:hover { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

.unit-card-alert {
  background: var(--alert-red);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  bottom: 0; left: 0; right: 0;
}

@media (max-width: 1400px) {
  .fleet-visibility-grid-premium { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
  .map-command-surface { height: 500px; }
}

/* --- PREMIUM ANALYTICS MODULE --- */
.analytics-display-grid-premium {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.analytics-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.stat-node-premium {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-snappy);
}

.stat-node-premium:hover {
  border-color: var(--accent-cyan-soft);
  transform: translateY(-4px);
  box-shadow: var(--shadow-premium);
}

.node-accent-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent-cyan);
  opacity: 0.2;
}

.node-accent-top.purple { background: var(--accent-purple); }
.node-accent-top.green { background: var(--accent-green); }

.node-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.node-icon-soft {
  width: 40px;
  height: 40px;
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-icon-soft.purple { background: hsla(262, 83%, 58%, 0.1); color: var(--accent-purple); }
.node-icon-soft.green { background: var(--accent-green-soft); color: var(--accent-green); }

.node-head label {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.node-value {
  font-size: 2rem;
  font-weight: 1000;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.node-value small { font-size: 0.8rem; font-weight: 700; opacity: 0.5; margin-left: 4px; }

.trend-indicator {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.trend-indicator.up { background: var(--accent-green-soft); color: var(--accent-green); }
.trend-indicator.down { background: rgba(239, 68, 68, 0.1); color: var(--alert-red); }
.trend-indicator.neutral { background: hsla(0, 0%, 0%, 0.05); color: var(--text-muted); }

.analytics-charts-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.premium-chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chart-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.title-stack h4 { margin: 0; font-size: 1.1rem; font-weight: 900; color: var(--text-primary); }
.title-stack p { margin: 4px 0 0; font-size: 0.6rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.1em; }

.chart-type-icon { color: var(--text-muted); opacity: 0.3; }

.chart-viewport { flex: 1; min-height: 300px; display: flex; }
.chart-viewport.flex-col { flex-direction: column; }

.premium-pie-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

.p-legend-item {
  flex: 1;
  min-width: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: hsla(0, 0%, 0%, 0.02);
  padding: 10px 14px;
  border-radius: 12px;
}

.indicator-wrap { display: flex; align-items: center; gap: 8px; }
.p-dot { width: 8px; height: 8px; border-radius: 50%; }
.p-label { font-size: 0.6rem; font-weight: 900; color: var(--text-muted); }
.p-val { font-size: 0.8rem; font-weight: 950; color: var(--text-primary); }

@media (max-width: 1200px) {
  .analytics-charts-container { grid-template-columns: 1fr; }
}

.module-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.title-wrap h3 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(180deg, #1E293B 40%, rgba(30, 41, 59, 0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 12px 0;
}

@media (max-width: 768px) {
  .title-wrap h3 { font-size: 1.4rem; }
  .module-header-modern { flex-direction: column; align-items: flex-start; gap: 16px; }
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 59, 59, 0.08);
  color: var(--alert-red);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 900;
  border: 1px solid rgba(255, 59, 59, 0.2);
}

.pulse {
  width: 10px;
  height: 10px;
  background: var(--alert-red);
  border-radius: 50%;
  animation: pulse-aura 2s infinite;
}

@keyframes pulse-aura {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(255, 59, 59, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); }
}

/* PATIENT CARDS */
.patient-alert-card.premium {
  display: flex;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px 20px 20px 30px;
  position: relative;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-bottom: 20px;
  overflow: hidden;
  min-width: 0;
}

.patient-alert-card.premium:hover {
  transform: translateX(12px) scale(1.01);
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.1);
}

.triage-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 10px; }
.triage-accent.RED { background: linear-gradient(to bottom, var(--alert-red), #991b1b); box-shadow: 5px 0 25px rgba(255, 59, 59, 0.4); }
.triage-accent.YELLOW { background: linear-gradient(to bottom, var(--warning-amber), #92400e); box-shadow: 5px 0 25px rgba(255, 184, 0, 0.4); }
.triage-accent.GREEN { background: linear-gradient(to bottom, var(--accent-green), #065f46); box-shadow: 5px 0 25px rgba(0, 226, 114, 0.4); }

.alert-grid {
  display: grid;
  grid-template-columns: 90px 1fr minmax(0, 1.4fr) 160px;
  gap: 20px;
  width: 100%;
  align-items: center;
  min-width: 0;
}

@media (max-width: 1500px) {
  .alert-grid { grid-template-columns: 90px 1fr minmax(0, 1.3fr) 150px; gap: 16px; }
}

@media (max-width: 1280px) {
  .alert-grid { grid-template-columns: 85px 1fr minmax(0, 1.2fr) 140px; gap: 14px; }
}

@media (max-width: 1100px) {
  .alert-grid { 
    grid-template-columns: 90px 1fr minmax(0, 1.4fr) 150px;
    gap: 16px;
  }
}

@media (max-width: 900px) {
  .alert-grid { 
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 16px;
  }
  .unit-info { 
    grid-column: 1;
    grid-row: 1;
  }
  .patient-details {
    grid-column: 2;
    grid-row: 1;
  }
  .vital-telemetry-grid { 
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(4, 1fr);
  }
  .card-actions-area { 
    grid-column: 1 / -1;
    grid-row: 3;
    flex-direction: row !important;
  }
  .card-actions-area button { flex: 1; }
}

@media (max-width: 600px) {
  .alert-grid { grid-template-columns: 1fr; gap: 16px; }
  .unit-info { 
    display: flex !important; 
    flex-direction: row !important; 
    justify-content: space-between !important; 
    align-items: center; 
    width: 100%; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    padding-bottom: 14px; 
  }
  .vital-telemetry-grid { grid-template-columns: repeat(2, 1fr) !important; width: 100%; }
  .card-actions-area { flex-direction: column !important; width: 100%; }
  .card-actions-area button { width: 100%; }
}

.ambulance-badge {
  background: rgba(13, 148, 136, 0.1);
  color: #5eead4;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(13, 148, 136, 0.2);
  font-family: 'JetBrains Mono';
  font-weight: 800;
  font-size: 0.75rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.eta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
}

.eta-value { font-size: 1.6rem; font-weight: 950; color: var(--accent-cyan); line-height: 1; letter-spacing: -1px; }
.eta-label { font-size: 0.55rem; color: var(--text-secondary); font-weight: 800; text-transform: uppercase; margin-top: 2px; }

.patient-details h4 { 
  font-size: 1.3rem; 
  font-weight: 950; 
  margin: 0 0 6px 0; 
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.p-sub { 
  font-size: 0.8rem; 
  color: var(--text-secondary); 
  font-weight: 700; 
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
/* --- PREMIUM ED MONITOR --- */
.ed-grid-modern {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.triage-feed-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.patient-alert-card.premium {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  display: flex;
  position: relative;
  transition: var(--transition-snappy);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.patient-alert-card.premium:hover {
  transform: translateX(8px);
  border-color: var(--accent-cyan-soft);
  box-shadow: var(--shadow-premium);
}

.triage-accent {
  width: 8px;
  height: auto;
}
.triage-accent.RED { background: var(--alert-red); }
.triage-accent.YELLOW { background: var(--alert-yellow); }
.triage-accent.GREEN { background: var(--accent-green); }

.alert-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 120px 1.2fr 1.5fr 180px;
  padding: 24px;
  align-items: center;
  gap: 24px;
}

.unit-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  border-right: 1px dashed var(--card-border);
  padding-right: 24px;
}

.ambulance-badge {
  background: var(--text-primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 900;
}

.eta-container {
  text-align: center;
}

.eta-value {
  font-size: 1.6rem;
  font-weight: 1000;
  color: var(--accent-cyan);
  line-height: 1;
}

.eta-label {
  font-size: 0.55rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.patient-details h4 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-primary);
}

.p-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.t-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.t-status.RED { background: rgba(239, 68, 68, 0.1); color: var(--alert-red); }
.t-status.YELLOW { background: rgba(245, 158, 11, 0.1); color: var(--alert-yellow); }
.t-status.GREEN { background: var(--accent-green-soft); color: var(--accent-green); }

.vital-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vital-cell {
  background: hsla(0, 0%, 0%, 0.02);
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
}

.vital-cell.critical {
  background: hsla(0, 84%, 60%, 0.05);
  border-color: var(--alert-red);
  animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.vital-cell .v-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
}

.vital-cell .v-label {
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--text-muted);
}

.card-actions-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.telelink-btn-premium, .assign-btn-premium {
  padding: 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-snappy);
}

.telelink-btn-premium {
  background: var(--accent-cyan);
  color: #fff;
  border: none;
}

.telelink-btn-premium:hover {
  background: #00b8e6;
  box-shadow: 0 4px 12px var(--accent-cyan-glow);
}

.assign-btn-premium {
  background: transparent;
  border: 1.5px solid var(--text-primary);
  color: var(--text-primary);
}

.assign-btn-premium:hover {
  background: var(--text-primary);
  color: #fff;
}

/* --- ED OPS HUB --- */
.ed-ops-side-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 100px;
}

.hub-card.premium-ops {
  background: #000;
  color: #fff;
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.hub-card.premium-ops h4 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.hub-desc {
  font-size: 0.75rem;
  color: hsla(0, 0%, 100%, 0.6);
  line-height: 1.5;
  margin-bottom: 24px;
}

.codes-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.code-btn-modern {
  border: none;
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-snappy);
}

.code-btn-modern:hover { transform: scale(1.02); }

.code-btn-modern.red { background: var(--alert-red); color: #fff; }
.code-btn-modern.blue { background: #3b82f6; color: #fff; }
.code-btn-modern.trauma { background: var(--accent-purple); color: #fff; }

.c-info { text-align: left; }
.c-info strong { display: block; font-size: 1.1rem; font-weight: 1000; }
.c-info span { font-size: 0.65rem; font-weight: 700; opacity: 0.8; }

.sync-btn-modern {
  width: 100%;
  padding: 14px;
  background: hsla(0, 0%, 0%, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-snappy);
  margin-top: 16px;
}

.sync-btn-modern:hover { background: hsla(0, 0%, 0%, 0.08); color: var(--text-primary); }

.operational-clock-card {
  background: var(--hull-glass);
  backdrop-filter: var(--glass-blur);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--card-border);
  text-align: center;
}

.o-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 1000;
  color: var(--text-primary);
  letter-spacing: -1.5px;
  margin-bottom: 8px;
}

.o-status {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 1200px) {
  .ed-grid-modern { grid-template-columns: 1fr; }
  .alert-grid { grid-template-columns: 100px 1fr 1fr; padding: 16px; gap: 16px; }
  .card-actions-area { grid-column: span 3; flex-direction: row; }
  .card-actions-area button { flex: 1; }
  .ed-ops-side-panel { position: static !important; }
}

.vital-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  min-width: 0;
}

.vital-cell {
  background: rgba(0, 0, 0, 0.01);
  border: 1px solid var(--card-border);
  padding: 8px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  min-width: 0;
  overflow: hidden;
}

.vital-cell:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.vital-cell.critical {
  background: rgba(255, 59, 59, 0.1);
  border-color: rgba(255, 59, 59, 0.3);
  animation: critical-vibrate 0.3s infinite alternate;
}

@keyframes critical-vibrate {
  from { transform: translateX(-1px); }
  to { transform: translateX(1px); }
}

.v-data { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.v-val { font-size: 1.1rem; font-weight: 900; line-height: 1; white-space: nowrap; }
.v-label { font-size: 0.6rem; color: var(--text-secondary); font-weight: 800; text-transform: uppercase; margin-top: 3px; white-space: nowrap; }

.card-actions-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  width: 160px;
  flex-shrink: 0;
}

.telelink-btn-premium {
  background: var(--accent-cyan);
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  font-size: 0.75rem;
  white-space: nowrap;
}

.assign-btn-premium {
  background: #f8fafc;
  color: var(--text-primary);
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.75rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.telelink-btn-premium:hover { background: #0284c7; box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25); }
.assign-btn-premium:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }

.ed-ops-side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: max-content;
  min-width: 0;
  overflow: hidden;
}

/* OPERATIONS PANEL */
.hub-card.premium-ops {
  padding: 16px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  min-width: 0;
  overflow: hidden;
}

.hub-card h4 { font-size: 1rem; font-weight: 700; margin: 0 0 8px 0; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-desc { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }

.codes-stack { display: flex; flex-direction: column; gap: 12px; }

.code-btn-modern {
  height: 54px;
  border-radius: 14px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  font-weight: 900;
  transition: background 0.2s;
  width: 100%;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  min-width: 0;
  overflow: hidden;
}

.c-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; overflow: hidden; }
.c-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85rem; }
.c-info span { font-size: 0.65rem; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.code-btn-modern.red { background: #ef4444; }
.code-btn-modern.blue { background: #3b82f6; }
.code-btn-modern.trauma { background: #f59e0b; }

.code-btn-modern:hover { filter: brightness(1.1); }

.inventory-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border) !important;
  border-radius: 20px !important;
  padding: 20px;
  min-width: 0;
  overflow: hidden;
}

.triage-feed-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.triage-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 24px 4px;
}

.operational-clock-card {
  padding: 20px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.o-time { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; color: var(--accent-cyan); font-family: 'JetBrains Mono'; white-space: nowrap; }
.o-status { margin-top: 8px; font-size: 0.65rem; font-weight: 600; color: var(--accent-green); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* TRIP MANAGEMENT */
.trip-card-premium {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.15s ease;
}

.trip-card-premium:hover { border-color: var(--accent-cyan); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); }

.trip-patient-main { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.trip-id-mono { font-family: 'JetBrains Mono'; font-size: 0.7rem; color: var(--accent-cyan); opacity: 0.8; }

.trip-status-timeline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  background: #f8fafc;
  padding: 4px;
  border-radius: 8px;
}
.ts-step { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; }
.ts-step.active { background: var(--accent-cyan); }
.ts-step.completed { background: var(--accent-green); }
.ts-line { flex: 1; height: 2px; background: #e2e8f0; }
.ts-line.active { background: var(--accent-cyan); }

/* FLEET DASHBOARD */
.fleet-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  height: calc(100vh - 140px);
}

@media (max-width: 1200px) {
  .fleet-dashboard-layout { grid-template-columns: 1fr 320px; }
}

@media (max-width: 1024px) {
  .fleet-dashboard-layout { grid-template-columns: 1fr; height: auto; }
  .fleet-map-container { height: 400px; }
}

.fleet-map-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.mock-map-view {
  width: 100%;
  height: 100%;
  background: #f8fafc url('https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}.png');
  background-size: cover;
  position: relative;
}

.map-overlay-controls {
  position: absolute;
  top: 24px; left: 24px; right: 24px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.map-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  padding: 12px 20px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.map-search input { background: transparent; border: none; color: var(--text-primary); font-weight: 600; font-size: 0.9rem; outline: none; }

.map-marker {
  position: absolute;
  width: 40px;
  height: 40px;
  background: var(--accent-cyan);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: all 0.3s;
}

.map-marker:hover { transform: scale(1.2); z-index: 20; }
.marker-pulse { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid; opacity: 0; animation: marker-ping 2s infinite; }
.marker-pulse.RED { border-color: var(--alert-red); }
.marker-pulse.GREEN { border-color: var(--accent-green); }

@keyframes marker-ping {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* SETUP LAYOUT */
/* --- SETUP MODULE PREMIUM --- */
.setup-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: calc(100vh - 140px);
  min-height: 0;
}

.setup-nav {
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow-x: auto;
  flex-shrink: 0;
}

.setup-nav::-webkit-scrollbar {
  display: none;
}

.setup-nav-item {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.setup-nav-item:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
}

.setup-nav-item.active {
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.setup-content-modern {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 12px;
  height: 100%;
  min-width: 0;
  max-width: 100%;
}

.setup-content-modern > div {
  min-width: 0;
  width: 100%;
}

.setup-content-modern::-webkit-scrollbar { width: 4px; }
.setup-content-modern::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.05); }

/* Form Elements */
.setup-form-modern {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group-premium {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group-premium label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-left: 2px;
}

.setup-input-premium {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

.setup-input-premium:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-soft);
}

.profile-data-block {
  padding: 12px 16px;
  background: #f8fafc;
  border-left: 3px solid var(--card-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-data-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-data-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

select.setup-input-premium {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%2364748b" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px top 50%;
  padding-right: 36px;
  cursor: pointer;
}

.setup-confirm-btn {
  background: var(--accent-cyan);
  color: #ffffff;
  padding: 11px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
}

.setup-confirm-btn:hover {
  background: #0284c7;
  box-shadow: var(--shadow-md);
}

/* Service Nodes */
.dept-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.service-node-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 24px;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.4s;
}

.service-node-card:hover {
  background: rgba(0, 0, 0, 0.01);
  transform: translateY(-8px);
}

.service-node-card.map-filter { filter: grayscale(100%) invert(92%) sepia(18%) saturate(163%) hue-rotate(185deg) brightness(85%) contrast(85%); }

.service-node-card.active { border-color: var(--accent-green); }
.service-node-card.inactive { opacity: 0.6; }

.node-info-text strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.node-status-text { font-size: 0.7rem; font-weight: 900; letter-spacing: 0.1em; }
.node-status-text.ON { color: var(--accent-green); }
.node-status-text.OFF { color: var(--text-secondary); }

.toggle-btn-modern {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.3s;
}

.toggle-btn-modern.enable { border-color: var(--accent-green); color: var(--accent-green); background: rgba(0, 226, 114, 0.05); }
.toggle-btn-modern.disable { border-color: var(--alert-red); color: var(--alert-red); background: rgba(255, 59, 59, 0.05); }

/* Users & Beds Tabs */
.setup-actions-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

@media (max-width: 860px) {
  .setup-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

.search-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--card-border);
  padding: 10px 16px;
  border-radius: 12px;
  flex: 1;
  min-width: 200px;
  max-width: 350px;
}

.search-mini input {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.staff-table-premium {
  display: block;
  width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.register-staff-btn-premium {
  background: var(--accent-cyan);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 950;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.register-staff-btn-premium:hover {
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(0, 209, 255, 0.3);
  
}

.pulse.status-sync {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 8px;
  background: var(--accent-green);
}

.fleet-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-title { font-size: 1.25rem; font-weight: 900; margin: 0; }

.fleet-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
}

.fleet-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  transition: all 0.3s;
}

.fleet-item:hover { border-color: var(--accent-cyan); background: rgba(0, 0, 0, 0.01); }

.f-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.v-tag { font-family: 'JetBrains Mono'; font-weight: 900; font-size: 0.9rem; color: var(--accent-cyan); }
.v-type { font-size: 0.7rem; color: var(--text-secondary); margin-left: 8px; text-transform: uppercase; font-weight: 800; }

.v-status { font-size: 0.65rem; font-weight: 900; border: 1px solid; padding: 4px 10px; border-radius: 6px; text-transform: uppercase; }
.v-status.RUNNING { color: var(--accent-green); border-color: rgba(0, 226, 114, 0.3); background: rgba(0, 226, 114, 0.05); }
.v-status.IDLE { color: var(--text-secondary); border-color: var(--card-border); }
.v-status.BREAKDOWN { color: var(--alert-red); border-color: rgba(255, 59, 59, 0.3); background: rgba(255, 59, 59, 0.05); }

.f-body { display: flex; flex-direction: column; gap: 8px; }
.f-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.f-row.highlight { color: var(--text-primary); background: rgba(59, 130, 246, 0.03); padding: 8px 12px; border-radius: 12px; }

/* TELELINK CONSOLE */
.telelink-workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  height: calc(100vh - 140px);
}

@media (max-width: 1024px) {
  .telelink-workspace { grid-template-columns: 1fr; height: auto; }
  .video-central-hub { height: 500px; order: 1; }
  .telelink-queues { order: 2; }
}

@media (max-width: 768px) {
  .video-central-hub { height: 400px; }
  .local-preview { width: 120px; height: 80px; bottom: 20px; right: 20px; border-width: 2px; }
  .video-controls { padding: 12px 20px; gap: 10px; width: 90%; }
  .ctrl-btn { width: 44px; height: 44px; }
}

.telelink-queues {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.q-header-main h3 { font-size: 1.5rem; font-weight: 900; display: flex; align-items: center; gap: 12px; }
.console-mode { font-size: 0.7rem; color: var(--accent-cyan); font-weight: 900; letter-spacing: 0.2em; margin-top: 4px; }

.queue-section .q-title { font-size: 0.75rem; font-weight: 900; color: var(--text-secondary); letter-spacing: 0.1em; margin-bottom: 20px; display: flex; justify-content: space-between; }
.q-count { color: var(--alert-red); }

.q-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.q-card:hover { border-color: var(--accent-cyan); background: rgba(0, 0, 0, 0.01); }
.q-card.RED { border-left: 6px solid var(--alert-red); }

.q-top { display: flex; justify-content: space-between; margin-bottom: 12px; }
.q-badge { font-size: 0.65rem; font-weight: 900; text-transform: uppercase; }
.q-timer { font-size: 0.7rem; color: var(--alert-red); font-weight: 800; display: flex; align-items: center; gap: 4px; }

.q-patient-info .q-name { font-size: 1rem; font-weight: 900; margin-bottom: 4px; }
.q-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }

.video-central-hub {
  background: var(--base-bg);
  border-radius: 40px;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--card-border);
}

.remote-feed { width: 100%; height: 100%; position: relative; }
.placeholder-video { 
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: linear-gradient(180deg, var(--base-bg) 0%, var(--card-bg) 100%);
}

.local-preview {
  position: absolute;
  bottom: 40px; right: 40px;
  width: 240px; height: 160px;
  background: var(--card-bg);
  border-radius: 24px;
  border: 4px solid var(--accent-cyan);
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: hidden;
}
 /* --- PREMIUM TELELINK HUB --- */
.call-surface-panel-premium {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  box-shadow: var(--shadow-premium);
}

.surface-glass-glow {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-cyan-glow) 0%, transparent 70%);
  pointer-events: none;
}

.active-call-grid {
  display: grid;
  grid-template-columns: 1.2fr 400px;
  width: 100%;
  height: 100%;
}

.video-workspace {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.video-feed-main {
  flex: 1;
  background: #000;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.feed-header-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
  z-index: 10;
}

.secure-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.video-placeholder-premium {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  gap: 20px;
  text-align: center;
}

.video-pulse-icon {
  width: 100px;
  height: 100px;
  background: var(--accent-cyan-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-aura 2s infinite;
}

.patient-id-overlay {
  position: absolute;
  bottom: 80px;
  left: 20px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  padding: 12px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255,255,255,0.1);
}

.p-triage {
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.75rem;
}
.p-triage[data-triage="red"] { background: var(--alert-red); color: #fff; }

.video-actions-floating {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  padding: 12px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 20;
}

.v-float-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: hsla(0, 0%, 100%, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-snappy);
}

.v-float-btn:hover { background: hsla(0, 0%, 100%, 0.2); transform: translateY(-2px); }
.v-float-btn.active { color: var(--accent-cyan); background: var(--accent-cyan-soft); }
.v-float-btn.end-session { background: var(--alert-red); color: #fff; margin-left: 20px; }

.clinical-data-rail {
  border-left: 1px solid var(--card-border);
  background: hsla(210, 40%, 96%, 0.3);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 32px;
}

.rail-section { display: flex; flex-direction: column; gap: 16px; }
.rail-section.grow { flex: 1; }

.rail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.vitals-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.v-stat-card {
  background: #fff;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.v-stat-card label {
  display: block;
  font-size: 0.55rem;
  font-weight: 950;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.v-stat-card .val {
  font-size: 1.4rem;
  font-weight: 1000;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.v-stat-card .val small { font-size: 0.7rem; font-weight: 600; margin-left: 4px; opacity: 0.6; }
.v-stat-card.warning { border-color: var(--alert-red); }
.v-stat-card.warning .val { color: var(--alert-red); }

.clinical-input {
  flex: 1;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
  transition: var(--transition-snappy);
}

.clinical-input:focus {
  border-color: var(--accent-cyan);
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-cyan-glow);
}

.commit-btn {
  background: var(--text-primary);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition-snappy);
}

.commit-btn:hover { background: #000; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }

.idle-surface-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.idle-icon-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.idle-ring {
  position: absolute;
  inset: -10px;
  border: 2px dashed var(--card-border);
  border-radius: 50%;
  animation: rotate-slow 20s linear infinite;
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 1400px) {
  .active-call-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .clinical-data-rail { border-left: none; border-top: 1px solid var(--card-border); }
}

.video-controls {
  position: absolute;
  bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 20px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  padding: 20px 40px;
  border-radius: 32px;
  border: 1px solid var(--card-border);
}

.ctrl-btn {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.03); color: var(--text-primary); border: 1px solid var(--card-border); cursor: pointer; transition: all 0.3s;
}
.ctrl-btn:hover { background: rgba(0,0,0,0.05); transform: scale(1.1); }
.ctrl-btn.hangup { background: var(--alert-red); border: none; }

/* EPCR & ARCHIVE TABLES */
.staff-table-premium { width: 100%; border-collapse: separate; border-spacing: 0 12px; margin-top: -12px; }
.staff-table-premium th { padding: 0 24px 12px 24px; text-align: left; font-size: 0.75rem; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.1em; }
.staff-table-premium tr td { padding: 14px 24px; background: var(--card-bg); border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); }
.staff-table-premium tr td:first-child { border-left: 1px solid var(--card-border); border-radius: 14px 0 0 14px; }
.staff-table-premium tr td:last-child { border-right: 1px solid var(--card-border); border-radius: 0 14px 14px 0; }

/* REPORTS GRID */
.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 1024px) {
  .reports-grid { grid-template-columns: 1fr; }
}

/* HEADER RESPONSIVENESS */
@media (max-width: 1024px) {
  .header-left .h-node-id, .header-left .h-loc, .header-left .separator { display: none; }
  .header-right .time-date-panel { display: none; }
}

@media (max-width: 768px) {
  .hospital-info-stack { max-width: 120px; }
  .hospital-name { font-size: 0.85rem; }
}

/* Always truncate hospital name */
.hospital-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.hospital-info-stack {
  min-width: 0;
  overflow: hidden;
}

.hospital-brand {
  min-width: 0;
  overflow: hidden;
}

/* SHARED COMPONENTS */
.stat-card-premium {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto;
  min-height: 100px;
  padding: 16px;
}

.stat-trend { font-size: 0.7rem; font-weight: 900; margin-top: 12px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--accent-green); }
.stat-trend.down { color: var(--alert-red); }
.stat-value { font-size: 1.5rem; font-weight: 900; color: var(--text-primary); margin-top: 4px; }
.stat-label { font-size: 0.7rem; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

/* RESPONSIVE UTILITIES */
.stats-grid-responsive {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.action-area-header {
  display: flex;
  gap: 12px;
}

@media (max-width: 1024px) {
  .stats-grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid-responsive {
    grid-template-columns: 1fr;
  }
  
  .action-area-header {
    width: 100%;
    margin-top: 12px;
  }
  
  .search-mini {
    flex: 1;
  }
}

.hide-tablet { display: block; }

@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

@media (max-width: 860px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline-flex !important; }
}

.show-mobile { display: none !important; }

@media (max-width: 768px) {
  .staff-table-premium { 
    display: block; 
    overflow-x: auto; 
    white-space: nowrap; 
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

.map-tabs .nav-tab {
  padding: 8px 16px;
  font-size: 0.7rem;
}

@keyframes slide-up-premium {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* AUTHENTIC DOC MOCK */
.pcr-document-mock {
  width: 100%;
  max-width: 800px;
  background: #fff;
  color: #000;
  padding: 60px;
  border-radius: 4px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  font-family: 'Helvetica', sans-serif;
}

.pcr-header { border-bottom: 3px solid #000; padding-bottom: 24px; margin-bottom: 40px; display: flex; justify-content: space-between; align-items: flex-end; }
.pcr-logo { font-size: 2rem; font-weight: 950; letter-spacing: -2px; }
.pcr-title { font-size: 1rem; font-weight: 800; text-transform: uppercase; }

.ps-title { font-size: 0.85rem; font-weight: 900; background: #f1f5f9; padding: 8px 16px; margin-bottom: 20px; border-left: 4px solid #000; }
.ps-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 16px; font-size: 0.9rem; }
.ps-row div span { font-weight: 800; display: block; font-size: 0.7rem; color: #64748b; margin-bottom: 4px; }

/* PROFESSIONAL MODALS */
.premium-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.premium-modal-container {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  padding: 0;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.premium-modal-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), #3b82f6);
}

.modal-header-premium {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.modal-header-premium h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  -webkit-text-fill-color: var(--text-primary);
  background: none;
}

.modal-close-btn {
  background: #f8fafc;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--alert-red);
  border-color: rgba(239, 68, 68, 0.2);
}

.premium-modal-container .setup-form-modern {
  gap: 16px;
}

.modal-footer-premium {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  background: #fafbfc;
}

.modal-footer-premium button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.btn-primary-glass {
  background: var(--accent-cyan);
  color: #ffffff;
  border: none !important;
  box-shadow: var(--shadow-sm);
}

.btn-primary-glass:hover {
  background: #0284c7;
  box-shadow: var(--shadow-md);
}

.btn-secondary-glass {
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--card-border) !important;
}

.btn-secondary-glass:hover {
  background: #f8fafc;
  color: var(--text-primary);
}

/* Responsive Table Utility */
/* --- PREMIUM HOSPITAL SELECTOR --- */
.hospital-select-card-premium {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 32px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.hospital-select-card-premium:hover {
  border-color: var(--accent-cyan-glow);
  transform: translateY(-8px);
}

.card-top-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0.15;
}

.hospital-select-card-premium:hover .card-top-accent {
  opacity: 1;
}

.h-icon-cluster {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.h-icon-orb {
  width: 64px;
  height: 64px;
  background: var(--accent-cyan-soft);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  transition: var(--transition-snappy);
}

.hospital-select-card-premium:hover .h-icon-orb {
  background: var(--accent-cyan);
  color: #fff;
  transform: rotate(-5deg);
}

.h-status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
}

.h-status-indicator::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.3;
}

.h-status-indicator[data-status="active"] { color: var(--accent-green); background: currentColor; }
.h-status-indicator[data-status="occupied"] { color: var(--warning-amber); background: currentColor; }

.h-name-premium {
  font-size: 1.5rem;
  font-weight: 950;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.h-type-tag {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  width: fit-content;
}

.h-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.h-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.capacity-section {
  background: hsla(210, 40%, 96.1%, 0.5);
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.capacity-val { color: var(--text-primary); font-weight: 950; }

.capacity-track {
  height: 8px;
  background: hsla(0, 0%, 0%, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 10px;
}

.h-access-btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--accent-cyan-soft);
  background: transparent;
  color: var(--accent-cyan);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition-snappy);
  cursor: pointer;
}

.hospital-select-card-premium:hover .h-access-btn {
  background: var(--accent-cyan);
  color: #fff;
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 20px var(--accent-cyan-glow);
}

/* --- REFINED GLOBAL OVERLAYS --- */
.hospital-selection-overlay {
  background: var(--hull-bg);
}

.glow-sphere {
  filter: blur(140px);
  opacity: 0.15;
}

.selection-header h1 {
  font-size: 4.5rem;
  font-weight: 1000;
  letter-spacing: -4px;
  background: linear-gradient(180deg, var(--text-primary) 30%, hsla(222, 47%, 11%, 0.4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* --- NEW MODULE STYLES --- */

.tab-switcher-premium {
  display: flex;
  background: rgba(0, 0, 0, 0.03);
  padding: 4px;
  border-radius: 14px;
  gap: 4px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active {
  background: #fff;
  color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* TeleLink */
.telelink-main-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  height: calc(100vh - 180px);
}

.call-queue-panel {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header-mini {
  padding: 16px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header-mini h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: #fcfcfc;
  transition: all 0.3s;
}

.queue-item.triage-red { border-left: 4px solid var(--alert-red); }
.queue-item.triage-yellow { border-left: 4px solid var(--warning-amber); }

.q-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.q-id { font-family: monospace; font-weight: 700; color: var(--text-secondary); font-size: 0.7rem; }
.q-wait { font-size: 0.7rem; color: var(--alert-red); font-weight: 700; display: flex; align-items: center; gap: 4px; }

.q-patient { font-weight: 800; font-size: 0.9rem; margin-bottom: 4px; }
.q-complaint { font-size: 0.75rem; color: var(--text-secondary); }

.q-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.q-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  font-weight: 800;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.3s;
}

.q-btn.accept { background: var(--accent-cyan); color: #fff; }
.q-btn.decline { background: rgba(0,0,0,0.05); color: var(--text-secondary); }

.call-surface-panel {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.active-call-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  width: 100%;
  height: 100%;
}

.video-main-container {
  background: #0f172a;
  position: relative;
  display: flex;
  flex-direction: column;
}

.video-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.video-icon { opacity: 0.2; margin-bottom: 16px; }

.patient-overlay {
  position: absolute;
  top: 24px;
  left: 24px;
}

.p-badge { background: var(--alert-red); color: #fff; font-size: 0.6rem; font-weight: 900; padding: 4px 8px; border-radius: 6px; margin-bottom: 4px; display: inline-block; }
.p-name { font-size: 1.4rem; font-weight: 900; }

.controls-bar {
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.ctrl-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
.ctrl-btn.end-call { background: var(--alert-red); }

.vitals-side-panel {
  border-left: 1px solid var(--card-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vitals-grid-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.v-card-mini {
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
}

.v-card-mini span { font-size: 0.6rem; font-weight: 800; color: var(--text-secondary); text-transform: uppercase; }
.v-card-mini .val { font-size: 1.1rem; font-weight: 950; color: var(--text-primary); margin-top: 2px; }

.clinical-notes-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clinical-notes-area textarea {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  padding: 12px;
  font-size: 0.8rem;
  resize: none;
}

.save-notes-btn {
  background: var(--text-primary);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Fleet View */
.fleet-visibility-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  height: calc(100vh - 180px);
}

.fleet-map-surface {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  background: #f1f5f9;
  position: relative;
}

.map-grid-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.map-marker {
  position: absolute;
  background: #fff;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  transform: translate(-50%, -50%);
}

.map-marker.status-running { border: 2px solid var(--accent-green); color: var(--accent-green); }
.map-marker.status-breakdown { border: 2px solid var(--alert-red); color: var(--alert-red); }

.marker-label { font-size: 0.7rem; font-weight: 900; color: var(--text-primary); }

.fleet-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fleet-unit-card {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--card-border);
}

.fleet-unit-card.has-alert { background: rgba(239, 68, 68, 0.03); border-color: rgba(239, 68, 68, 0.2); }

.unit-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.unit-id { font-weight: 800; font-size: 0.9rem; }
.unit-type { font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; font-weight: 800; margin-right: 4px; }

.unit-status { font-size: 0.6rem; font-weight: 900; padding: 4px 8px; border-radius: 6px; text-transform: uppercase; }
.unit-status.status-running { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }

.detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.unit-alert-box {
  margin-top: 12px;
  padding: 8px;
  background: var(--alert-red);
  color: #fff;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Analytics */
.analytics-dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.metrics-row-modern {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.metric-box-premium {
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-premium);
}

.m-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.m-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(59, 130, 246, 0.1); color: var(--accent-cyan); display: flex; align-items: center; justify-content: center; }
.m-title { font-size: 0.65rem; font-weight: 800; color: var(--text-secondary); letter-spacing: 0.05em; }

.m-val { font-size: 1.8rem; font-weight: 950; color: var(--text-primary); }
.m-trend { font-size: 0.7rem; font-weight: 700; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.m-trend.up { color: var(--accent-green); }
.m-trend.down { color: var(--alert-red); }

.charts-grid-main {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 20px;
}

.chart-card-premium {
  background: #fff;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
}

.chart-header h4 { margin: 0; font-size: 1rem; font-weight: 900; }
.chart-header p { margin: 4px 0 20px; font-size: 0.8rem; color: var(--text-secondary); }

/* Referrals */
.referral-grid-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.referral-node-card {
  display: flex;
  gap: 20px;
  background: #fff;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--card-border);
  margin-bottom: 16px;
  transition: all 0.3s;
}

.referral-node-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-premium); }

.node-icon-bubble {
  width: 56px;
  height: 56px;
  background: #f8fafc;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.node-info-content { flex: 1; }
.node-top-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.node-title-stack h4 { margin: 0; font-size: 1.1rem; font-weight: 900; }
.node-type { font-size: 0.7rem; color: var(--text-secondary); font-weight: 700; }

.node-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.d-item { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-secondary); }

.node-footer-actions { display: flex; gap: 12px; }

.node-action {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #fcfcfc;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.node-action-danger {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.1);
  background: rgba(239, 68, 68, 0.05);
  color: var(--alert-red);
  font-size: 0.7rem;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .telelink-main-grid, .fleet-visibility-layout, .charts-grid-main, .referral-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── OPS MODULE CARD GRID LANDING ─── */
/* ═══════════════════════════════════════════════════════════════════════════ */

.ops-card-landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 0;
}

.ops-landing-header {
  margin-bottom: 32px;
}

.ops-landing-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ops-landing-title {
  font-size: 1.75rem;
  font-weight: 950;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1.1;
  margin: 0;
}

.ops-landing-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 6px;
  line-height: 1.4;
}

.ops-module-count {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  background: hsla(210, 30%, 94%, 0.8);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  border: 1px solid var(--card-border);
  flex-shrink: 0;
}

/* ── Card Grid ── */
.ops-module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Individual Card ── */
.ops-module-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: border-color 0.25s ease, box-shadow 0.35s ease;
}

.ops-module-card:hover {
  border-color: hsla(199, 89%, 48%, 0.25);
  box-shadow:
    0 8px 24px -4px hsla(222, 47%, 11%, 0.08),
    0 16px 40px -8px hsla(222, 47%, 11%, 0.06);
}

.ops-card-accent-bar {
  height: 4px;
  width: 100%;
}

.ops-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
}

.ops-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.ops-module-card:hover .ops-card-icon {
  transform: scale(1.08);
}

.ops-card-text {
  flex: 1;
  min-width: 0;
}

.ops-card-label {
  font-size: 0.92rem;
  font-weight: 850;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.ops-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ops-card-arrow {
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ops-module-card:hover .ops-card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Back Button ── */
.ops-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--card-border);
  padding: 7px 16px 7px 12px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ops-back-btn:hover {
  background: hsla(199, 89%, 48%, 0.06);
  border-color: hsla(199, 89%, 48%, 0.25);
  color: var(--accent-cyan);
}

/* ── Breadcrumb ── */
.ops-module-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: hsla(210, 30%, 94%, 0.6);
  border-radius: 20px;
  border: 1px solid var(--card-border);
  flex-shrink: 0;
}

.ops-breadcrumb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ops-breadcrumb-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ── Active Module Wrapper ── */
.ops-active-module {
  width: 100%;
}

/* ── Responsive: Tablet ── */
@media (max-width: 1100px) {
  .ops-module-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .ops-landing-title {
    font-size: 1.4rem;
  }

  .ops-card-body {
    padding: 16px 18px;
    gap: 14px;
  }

  .ops-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .ops-card-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* ── Responsive: Mobile ── */
@media (max-width: 600px) {
  .ops-module-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ops-landing-title {
    font-size: 1.2rem;
  }

  .ops-landing-title-row {
    flex-direction: column;
    gap: 8px;
  }

  .ops-card-body {
    padding: 14px 16px;
    gap: 12px;
  }

  .ops-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .ops-card-label {
    font-size: 0.85rem;
  }

  .ops-card-desc {
    font-size: 0.68rem;
    -webkit-line-clamp: 1;
  }

  .ops-card-arrow {
    opacity: 0.5;
    transform: translateX(0);
  }

  .ops-back-btn {
    font-size: 0.75rem;
    padding: 6px 12px 6px 8px;
  }

  .ops-module-breadcrumb {
    padding: 4px 10px;
  }

  .ops-breadcrumb-label {
    font-size: 0.7rem;
  }
}

/* ─── Hospital Picker (Inline) ─── */
.ops-hospital-picker {
  flex-shrink: 0;
}

.ops-picker-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ops-picker-indicator:hover {
  border-color: hsla(199, 89%, 48%, 0.3);
}

.ops-hospital-select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 4px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Module Topbar ─── */
.ops-module-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--card-border);
}

/* ─── Spinner Animation ─── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 0.8s linear infinite;
}

@media (max-width: 600px) {
  .ops-module-topbar {
    gap: 8px;
    padding-bottom: 14px;
    flex-wrap: wrap;
  }

  .ops-hospital-select {
    font-size: 0.72rem;
    max-width: 140px;
  }

  .page-container {
    padding: 16px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ─── INLINE MODULE RESPONSIVENESS OVERRIDES ─── */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Ensure the active module container doesn't overflow the page-container horizontally */
.ops-active-module {
  width: 100%;
  min-width: 0; /* Critical for flex/grid children to not overflow */
  display: flex;
  flex-direction: column;
}

.ops-active-module > * {
  min-width: 0;
}

/* Remove fixed 100vh calc heights so modules can scroll naturally within page-container */
.fleet-visibility-grid-premium,
.fleet-dashboard-layout,
.telelink-dashboard-layout,
.epcr-dashboard-layout,
.telelink-main-grid,
.fleet-visibility-layout,
.ed-grid-modern,
.analytics-dashboard-grid,
.referral-grid-layout {
  height: auto !important;
  min-height: calc(100vh - 240px);
}

/* Give minimum heights to scrollable areas inside modules */
.triage-scroll-area-modern,
.fleet-scroll-area,
.map-command-surface,
.epcr-list-column,
.epcr-content-column {
  min-height: 500px;
}

/* Prevent horizontal overflow on tables and grids */
.trip-mgmt-table-container,
.hospital-grid,
.staff-table-premium,
.staff-grid,
.module-content {
  max-width: 100%;
  overflow-x: auto;
}

/* Make wide grids stack earlier on typical laptop screens (1366px) when sidebar is open */
@media (max-width: 1400px) {
  .ed-grid-modern,
  .fleet-visibility-grid-premium,
  .telelink-main-grid,
  .fleet-dashboard-layout,
  .telelink-dashboard-layout,
  .epcr-dashboard-layout,
  .referral-grid-layout {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  
  .ed-ops-side-panel,
  .vitals-side-panel {
    border-left: none;
    border-top: 1px solid var(--card-border);
  }
  
  .charts-grid-main {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   HOSPITAL OPS DUAL SIDEBAR LAYOUT
   ========================================================================== */
.ops-child-sidebar {
  width: 260px;
  min-width: 260px;
  flex-basis: 260px;
  flex-shrink: 0;
  background: var(--glass-bg);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 1000;
}

.ops-child-sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(15,23,42,0.8) 0%, rgba(2,6,23,0.9) 100%);
  flex-shrink: 0;
}

.ops-hospital-picker-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
}

.ops-child-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ops-child-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-family: inherit;
}

.ops-child-nav-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.ops-child-nav-item.active {
  background: var(--bg-primary);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.ops-nav-icon {
  flex-shrink: 0;
  transition: color 0.2s;
}

.ops-nav-label {
  font-size: 0.9rem;
  font-weight: inherit;
  color: var(--text-primary);
  flex: 1;
}

.ops-nav-indicator {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 0 4px 4px 0;
}

.ops-active-module-wrapper {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PROFESSIONAL ED MONITOR DESIGN - DECENT & CLEAN */
.ed-monitor-tactical {
  --tactical-bg: #f8fafc;
  --tactical-border: #e2e8f0;
  --monitor-dark: #1e293b;
}

.metrics-row-modern {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card-premium {
  background: #ffffff;
  border: 1px solid var(--tactical-border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s;
}

.metric-card-premium:hover {
  border-color: #cbd5e1;
}

.metric-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
}

.tactical-board-container {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--tactical-border);
  padding: 24px;
  min-height: 500px;
}

.tactical-patient-card {
  background: #ffffff;
  border: 1px solid var(--tactical-border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  position: relative;
  min-width: 0;
}

.card-status-indicator {
  width: 6px;
  height: auto;
  flex-shrink: 0;
}

.card-status-indicator.RED { background: #ef4444; }
.card-status-indicator.ORANGE { background: #f97316; }
.card-status-indicator.YELLOW { background: #eab308; }
.card-status-indicator.GREEN { background: #22c55e; }
.card-status-indicator.WHITE { background: #e2e8f0; }

.card-main-tactical {
  flex: 1;
  display: grid;
  grid-template-columns: 200px 1fr 320px 160px;
  align-items: center;
  padding: 16px 24px;
  gap: 24px;
}

.unit-info-hex {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.unit-label-premium {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  width: max-content;
  text-transform: uppercase;
}

.p-identity-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-name-premium {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.p-meta-inline {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vitals-monitor-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.v-node-tactical {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.v-node-tactical .v-val {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
}

.v-node-tactical .v-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
}

.v-node-tactical.hr .v-val { color: #ef4444; }
.v-node-tactical.spo2 .v-val { color: #0ea5e9; }
.v-node-tactical.bp .v-val { color: #10b981; }

.tactical-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  border-left: 1px solid #f1f5f9;
}

.action-btn-tactical {
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.action-btn-tactical:hover {
  background: #f8fafc;
}

.action-btn-tactical.primary {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff;
}

.action-btn-tactical.primary:hover {
  background: #0f172a;
}

.complaint-badge-tactical {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
}

.complaint-badge-tactical.CRITICAL {
  background: #fee2e2;
  color: #b91c1c;
}

/* RESPONSIVE TACTICAL DESIGN */
@media (max-width: 1440px) {
  .card-main-tactical {
    grid-template-columns: 200px 1fr 280px 160px;
    padding: 20px 24px;
    gap: 16px;
  }
  .v-node-tactical .v-val { font-size: 1.2rem; }
  .p-name-premium { font-size: 1.1rem; }
}

@media (max-width: 1280px) {
  .card-main-tactical {
    grid-template-columns: 180px 1fr 240px 150px;
  }
}

@media (max-width: 1100px) {
  .card-main-tactical {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
  }
  .tactical-actions {
    border-left: none;
    padding-left: 0;
    flex-direction: row;
    grid-column: span 2;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
  }
  .vitals-monitor-block {
    grid-column: span 1;
  }
}

/* FINAL RESPONSIVE FIX FOR TACTICAL ED MONITOR */
.ed-grid-modern {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
  width: 100%;
}

.tactical-patient-card {
  width: 100%;
  min-width: 0;
}

.card-main-tactical {
  display: grid;
  grid-template-columns: 200px 1fr 320px 160px;
  align-items: center;
  padding: 16px 24px;
  gap: 24px;
  width: 100%;
}

@media (max-width: 1600px) {
  .ed-grid-modern {
    grid-template-columns: 1fr 320px;
    gap: 24px;
  }
  .card-main-tactical {
    grid-template-columns: 180px 1fr 280px 150px;
    gap: 16px;
    padding: 16px;
  }
}

@media (max-width: 1400px) {
  .ed-grid-modern {
    grid-template-columns: 1fr;
  }
  .ed-intel-sidebar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

@media (max-width: 1200px) {
  .card-main-tactical {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .tactical-actions {
    grid-column: span 2;
    border-left: none;
    padding-left: 0;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    flex-direction: row;
  }
}

@media (max-width: 900px) {
  .ed-intel-sidebar {
    grid-template-columns: 1fr;
  }
  .metrics-row-modern {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .card-main-tactical {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .vitals-monitor-block, .unit-info-hex, .p-identity-block, .tactical-actions {
    grid-column: span 1;
  }
  .tactical-actions {
    flex-direction: column;
  }
  .detail-module-grid { /* For the expanded view */
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .metrics-row-modern {
    grid-template-columns: 1fr;
  }
}
