/**
 * Suite Clínica Veterinaria y Urgencias - Estilos Prémium y Cockpit Clínico
 * Fijate Tools - Suite de Herramientas Web de Alta Productividad
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema Oscuro Clínico (Por defecto) */
  --bg-body: #070b12;
  --bg-card: #0d1524;
  --bg-card-glass: rgba(13, 21, 36, 0.85);
  --bg-card-elevated: #152033;
  --bg-card-hover: #1b2940;
  --bg-input: #111b2b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-focus: #00f0ff;
  
  /* Acentos Médicos y Quirúrgicos */
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.25);
  --accent-blue: #38bdf8;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-rose: #ff2e63;
  --accent-rose-glow: rgba(255, 46, 99, 0.35);
  --accent-purple: #a855f7;
  --accent-indigo: #6366f1;

  /* Sombras y Radios */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow-cyan: 0 0 25px rgba(0, 240, 255, 0.2);
  --shadow-glow-rose: 0 0 25px rgba(255, 46, 99, 0.25);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg-body: #f4f7fb;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.95);
  --bg-card-elevated: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #0284c7;

  --accent-cyan: #0284c7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.2);
  --accent-blue: #2563eb;
  --accent-emerald: #059669;
  --accent-emerald-glow: rgba(5, 150, 105, 0.2);
  --accent-amber: #d97706;
  --accent-amber-glow: rgba(217, 119, 6, 0.2);
  --accent-rose: #e11d48;
  --accent-rose-glow: rgba(225, 29, 72, 0.2);

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 12px 30px rgba(0, 0, 0, 0.08);
  --shadow-glow-cyan: 0 0 20px rgba(2, 132, 199, 0.15);
  --shadow-glow-rose: 0 0 20px rgba(225, 29, 72, 0.15);

  color-scheme: light;
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.mono-text, .metric-value, .dose-val, .table-num, .rcp-timer-display {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
}

/* Enlaces y Utilidades */
a {
  color: var(--accent-cyan);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.text-muted { color: var(--text-muted) !important; }
.text-dim { color: var(--text-dim) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-rose { color: var(--accent-rose) !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-amber { color: var(--accent-amber) !important; }

/* Contenedor Principal (Pantalla Completa Clínica) */
.tool-layout {
  max-width: 1440px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
}

.tool-main-content {
  width: 100%;
  min-width: 0;
}

/* ==========================================================================
   1. CONSOLA Y TELEMETRÍA DEL PACIENTE (BARRA SUPERIOR)
   ========================================================================== */
.patient-control-bar {
  background: var(--bg-card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.patient-control-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.patient-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.patient-bar-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.patient-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  display: inline-block;
  animation: pulseBeacon 2s infinite ease-in-out;
}

@keyframes pulseBeacon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

.weight-presets-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-weight-preset {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-weight-preset:hover {
  background: var(--accent-cyan-glow);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-weight-preset.active-preset {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #070b12;
  font-weight: 700;
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.patient-controls-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr auto;
  gap: 1.25rem;
  align-items: end;
}

@media (max-width: 860px) {
  .patient-controls-grid {
    grid-template-columns: 1fr 1fr;
  }
  .patient-controls-grid > div:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 580px) {
  .patient-controls-grid {
    grid-template-columns: 1fr;
  }
  .patient-controls-grid > div:last-child {
    grid-column: span 1;
  }
}

/* Selector Segmentado de Especie */
.species-segmented-control {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.species-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.species-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.species-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #070b12;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--accent-cyan-glow);
}

[data-theme="light"] .species-btn.active {
  color: #ffffff;
}

/* Stepper de Peso Táctil */
.weight-stepper-container {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  height: 44px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.weight-stepper-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.btn-weight-step {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-weight-step:hover {
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
}

.btn-weight-step:active {
  transform: scale(0.92);
}

.weight-input-field {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.weight-unit-badge {
  padding-right: 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* ==========================================================================
   2. PESTAÑAS DE NAVEGACIÓN ESTILO CARPETAS CLÍNICAS REALES (SIN SCROLL EN DESKTOP)
   ========================================================================== */
.clinical-nav-tabs {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 10px 2px 0 2px;
  background: transparent;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.75rem;
  overflow: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  width: 100%;
}

.clinical-nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-module-tab {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.5rem 0.55rem;
  background: linear-gradient(180deg, var(--bg-card-elevated) 0%, rgba(13, 21, 36, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  border-radius: 9px 9px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 42px;
  user-select: none;
  margin-bottom: -2px;
  z-index: 1;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.nav-module-tab span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-module-tab svg {
  flex-shrink: 0;
}

/* Indicador de color de pestaña de archivador */
.nav-module-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 9px 9px 0 0;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-module-tab:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  z-index: 2;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.35);
}

.nav-module-tab:hover::before {
  background: rgba(255, 255, 255, 0.2);
}

/* Pestaña activa: se fusiona con el fondo de la carpeta inferior */
.nav-module-tab.active {
  background: var(--bg-card) !important;
  border-color: var(--border-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 2px solid var(--bg-card) !important; /* Rompe la línea inferior como una carpeta abierta */
  color: var(--text-main) !important;
  font-weight: 700;
  transform: translateY(-3px);
  z-index: 4;
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.45);
  padding-bottom: 0.75rem;
}

.nav-module-tab.active::before {
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.nav-module-tab.active svg {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 4px var(--accent-cyan-glow));
}

/* Colores temáticos de pestaña según módulo */
.nav-module-tab[data-module="emergencies"].active::before { background: var(--accent-rose); box-shadow: 0 0 10px var(--accent-rose-glow); }
.nav-module-tab[data-module="emergencies"].active svg { color: var(--accent-rose); filter: drop-shadow(0 0 4px var(--accent-rose-glow)); }

.nav-module-tab[data-module="anesthesia"].active::before { background: var(--accent-purple); box-shadow: 0 0 10px rgba(168, 85, 247, 0.35); }
.nav-module-tab[data-module="anesthesia"].active svg { color: var(--accent-purple); filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.35)); }

.nav-module-tab[data-module="fluids"].active::before { background: var(--accent-blue); box-shadow: 0 0 10px rgba(56, 189, 248, 0.35); }
.nav-module-tab[data-module="fluids"].active svg { color: var(--accent-blue); filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.35)); }

.nav-module-tab[data-module="cri"].active::before { background: #14b8a6; box-shadow: 0 0 10px rgba(20, 184, 166, 0.35); }
.nav-module-tab[data-module="cri"].active svg { color: #14b8a6; filter: drop-shadow(0 0 4px rgba(20, 184, 166, 0.35)); }

.nav-module-tab[data-module="scales"].active::before { background: var(--accent-amber); box-shadow: 0 0 10px var(--accent-amber-glow); }
.nav-module-tab[data-module="scales"].active svg { color: var(--accent-amber); filter: drop-shadow(0 0 4px var(--accent-amber-glow)); }

.nav-module-tab[data-module="toxicology"].active::before { background: #8b5cf6; box-shadow: 0 0 10px rgba(139, 92, 246, 0.35); }
.nav-module-tab[data-module="toxicology"].active svg { color: #8b5cf6; filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.35)); }

.nav-module-tab[data-module="lab"].active::before { background: var(--accent-emerald); box-shadow: 0 0 10px var(--accent-emerald-glow); }
.nav-module-tab[data-module="lab"].active svg { color: var(--accent-emerald); filter: drop-shadow(0 0 4px var(--accent-emerald-glow)); }

.nav-module-tab[data-module="vademecum"].active::before { background: var(--accent-cyan); box-shadow: 0 0 10px var(--accent-cyan-glow); }
.nav-module-tab[data-module="vademecum"].active svg { color: var(--accent-cyan); filter: drop-shadow(0 0 4px var(--accent-cyan-glow)); }

.nav-module-tab[data-module="hospital_sheet"].active::before { background: #f97316; box-shadow: 0 0 10px rgba(249, 115, 22, 0.35); }
.nav-module-tab[data-module="hospital_sheet"].active svg { color: #f97316; filter: drop-shadow(0 0 4px rgba(249, 115, 22, 0.35)); }

/* Tema Claro para pestañas de carpeta */
[data-theme="light"] .clinical-nav-tabs {
  border-bottom-color: #cbd5e1;
}

[data-theme="light"] .nav-module-tab {
  background: linear-gradient(180deg, #e2e8f0 0%, #edf2f7 100%);
  border-color: #cbd5e1;
  color: #475569;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-module-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .nav-module-tab.active {
  background: #ffffff !important;
  border-color: #94a3b8;
  border-bottom: 2px solid #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   3. COCKPIT INTERACTIVO DE RCP RECOVER 2.0
   ========================================================================== */
.rcp-dashboard-box {
  background: radial-gradient(circle at 50% 0%, rgba(255, 46, 99, 0.12), transparent 70%), var(--bg-card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 46, 99, 0.35);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-elevated), 0 0 35px rgba(255, 46, 99, 0.15);
  position: relative;
  overflow: hidden;
}

.rcp-dashboard-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-rose), transparent);
}

.rcp-header-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.rcp-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  color: var(--accent-rose);
}

.rcp-heading svg {
  filter: drop-shadow(0 0 8px var(--accent-rose));
}

.rcp-monitor-indicators {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Pulso Cardíaco Luminoso */
.cardiac-pulse-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card-elevated);
  border: 2px solid var(--border-color);
  transition: all 0.05s ease;
  z-index: 2;
}

.pulse-indicator.pulse-active {
  background: var(--accent-rose);
  border-color: #ffffff;
  box-shadow: 0 0 20px var(--accent-rose), 0 0 35px var(--accent-rose);
  transform: scale(1.35);
}

.cardiac-pulse-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-rose);
  opacity: 0;
  pointer-events: none;
}

.pulse-indicator.pulse-active + .cardiac-pulse-wave {
  animation: pulseRipple 0.5s ease-out;
}

@keyframes pulseRipple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Indicador de Ventilación Asistida */
.vent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.vent-badge.vent-cue-active {
  background: var(--accent-blue);
  border-color: #ffffff;
  color: #070b12;
  font-weight: 800;
  box-shadow: 0 0 25px var(--accent-blue);
  transform: scale(1.08);
  animation: ventFlash 0.6s ease-in-out infinite alternate;
}

@keyframes ventFlash {
  from { box-shadow: 0 0 15px var(--accent-blue); }
  to { box-shadow: 0 0 30px var(--accent-blue); }
}

/* Cronómetro Digital HUD y Tarjetas Deslizantes (Flip Clock) */
.rcp-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.25rem 0;
}

.rcp-flip-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  perspective: 1000px;
}

.rcp-digit-card {
  position: relative;
  display: block;
  width: 68px;
  height: 92px;
  background: linear-gradient(180deg, #131e30 0%, #0a111e 100%);
  border: 1px solid rgba(255, 46, 99, 0.4);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 20px rgba(255, 46, 99, 0.15);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

[data-theme="light"] .rcp-digit-card {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.rcp-digit-card.timer-warning-card {
  border-color: var(--accent-amber);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 158, 11, 0.4);
  animation: cardWarningPulse 0.6s infinite alternate;
}

@keyframes cardWarningPulse {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.rcp-digit-roller {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.38s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.rcp-digit-roller span {
  display: block;
  width: 100%;
  height: 92px;
  line-height: 92px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--accent-rose);
  text-shadow: 0 0 22px rgba(255, 46, 99, 0.55);
  user-select: none;
  box-sizing: border-box;
}

[data-theme="light"] .rcp-digit-roller span {
  color: #e11d48;
  text-shadow: none;
}

.rcp-colon-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 92px;
  line-height: 92px;
  font-family: var(--font-mono);
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--accent-rose);
  text-shadow: 0 0 22px rgba(255, 46, 99, 0.55);
  margin: 0 0.15rem;
  animation: colonPulse 1s infinite;
}

[data-theme="light"] .rcp-colon-separator {
  color: #e11d48;
  text-shadow: none;
}

@keyframes colonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Indicador de Cadencia BPM */
.bpm-pill-display {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-rose);
  background: rgba(255, 46, 99, 0.1);
  border: 1px solid rgba(255, 46, 99, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  min-width: 85px;
  text-align: center;
  display: inline-block;
}

@media (max-width: 520px) {
  .rcp-digit-card {
    width: 48px;
    height: 68px;
    border-radius: 8px;
  }
  .rcp-digit-roller span {
    height: 68px;
    line-height: 68px;
    font-size: 2.6rem;
  }
  .rcp-colon-separator {
    height: 68px;
    line-height: 68px;
    font-size: 2.6rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Barra de Progreso del Ciclo de 2 Minutos */
.rcp-cycle-progress-track {
  width: 100%;
  max-width: 500px;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.rcp-cycle-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent-rose), var(--accent-amber));
  box-shadow: 0 0 10px var(--accent-rose);
  border-radius: 999px;
  transition: width 1s linear;
}

/* Controles de RCP y Cadencia */
.rcp-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.rcp-cadence-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.bpm-quick-presets {
  display: flex;
  gap: 0.35rem;
}

.btn-bpm-chip {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-bpm-chip:hover, .btn-bpm-chip.active-bpm {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-rose-glow);
}

/* Asistente y Línea de Estado RECOVER */
.rcp-cycle-status-bar {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
}

.rcp-cycle-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rcp-cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-weight: 800;
  font-size: 0.9rem;
}

.rcp-action-hint {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   4. MATRIZ DE FÁRMACOS DE RESUCITACIÓN (ALTO CONTRASTE)
   ========================================================================== */
.card-clinical {
  background: var(--bg-card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-card);
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title-bar h2, .card-title-bar h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.clinical-table, .dose-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.6rem;
}

.clinical-table th, .dose-table th {
  text-align: left;
  padding: 0.85rem 1.15rem;
  background: var(--bg-card-elevated);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  font-weight: 700;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.clinical-table th:first-child, .dose-table th:first-child { 
  border-top-left-radius: var(--radius-md); 
  border-bottom-left-radius: var(--radius-md);
  border-left: 1px solid var(--border-color);
}
.clinical-table th:last-child, .dose-table th:last-child { 
  border-top-right-radius: var(--radius-md); 
  border-bottom-right-radius: var(--radius-md);
  border-right: 1px solid var(--border-color);
}

.clinical-table td, .dose-table td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  vertical-align: middle;
  transition: background 0.15s ease;
  line-height: 1.4;
}

.clinical-table tr:hover td, .dose-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.clinical-table tr:last-child td, .dose-table tr:last-child td {
  border-bottom: none;
}

/* Badges de Dosis y Números Monospaciados de Alto Impacto */
.mono-highlight, .dose-highlight {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(0, 240, 255, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 240, 255, 0.25);
  letter-spacing: -0.01em;
}

.mono-highlight.text-danger, .dose-highlight.dose-high-danger {
  color: var(--accent-rose) !important;
  background: rgba(255, 46, 99, 0.1) !important;
  border-color: rgba(255, 46, 99, 0.35) !important;
  text-shadow: 0 0 10px rgba(255, 46, 99, 0.3);
}

/* Vía de administración */
.badge-route {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-right: 0.35rem;
}

/* Subpestañas internas de módulos clínicos */
.urg-subtab-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.urg-subtab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--accent-rose);
}

.urg-subtab-btn.active {
  background: linear-gradient(135deg, rgba(255, 46, 99, 0.18), rgba(245, 158, 11, 0.08));
  border-color: var(--accent-rose);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 15px var(--accent-rose-glow);
}

[data-theme="light"] .urg-subtab-btn.active {
  background: #fee2e2;
  border-color: #e11d48;
  color: #9f1239;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.15);
}

/* Badges de Estado Clínico */
.badge-status, .badge-safety {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
}

.badge-status.badge-success, .badge-safety.badge-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
}

.badge-status.badge-warning, .badge-safety.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-amber);
  color: var(--accent-amber);
}

.badge-status.badge-danger, .badge-safety.badge-danger {
  background: rgba(255, 46, 99, 0.15);
  border: 1px solid var(--accent-rose);
  color: var(--accent-rose);
}

.badge-status.badge-secondary, .badge-safety.badge-secondary {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.badge-status.badge-info, .badge-safety.badge-info {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Tarjetas HUD de Desfibrilación y Ventilación */
.hud-metric-card {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.06), rgba(15, 23, 42, 0.4));
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: transform 0.2s, border-color 0.2s;
}

.hud-metric-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.hud-metric-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hud-metric-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin: 0.4rem 0;
}

/* ==========================================================================
   5. FLUIDOTERAPIA Y CÁMARA DE GOTEO HIPERREALISTA
   ========================================================================== */
.drip-chamber-wrapper {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  background: radial-gradient(circle at 0% 50%, rgba(56, 189, 248, 0.1), transparent 60%), var(--bg-card-elevated);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-top: 1.25rem;
}

.drip-chamber-visual {
  position: relative;
  width: 52px;
  height: 110px;
  border: 2.5px solid rgba(56, 189, 248, 0.6);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, rgba(56, 189, 248, 0.15) 100%);
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(56, 189, 248, 0.1), 0 0 20px rgba(56, 189, 248, 0.15);
  flex-shrink: 0;
}

.drip-nozzle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 14px;
  background: var(--accent-blue);
  border-radius: 0 0 4px 4px;
}

.drip-drop {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 11px;
  background: var(--accent-blue);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  opacity: 0;
}

.drip-drop.drop-falling {
  animation: realisticDrop 0.45s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes realisticDrop {
  0% { top: 14px; opacity: 1; transform: translateX(-50%) scale(0.7); }
  65% { top: 75px; opacity: 1; transform: translateX(-50%) scale(1.1); }
  90% { top: 86px; opacity: 0.8; transform: translateX(-50%) scale(1.4, 0.6); }
  100% { top: 90px; opacity: 0; transform: translateX(-50%) scale(1.8, 0.2); }
}

.drip-reservoir {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 22px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.3) 0%, rgba(56, 189, 248, 0.6) 100%);
  border-top: 1.5px solid var(--accent-blue);
}

.drip-reservoir::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   6. FORMULARIOS, INPUTS Y SELECTS MODERNOS
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.form-control, .form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.form-control:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* ==========================================================================
   7. BOTONERÍA CLÍNICA TÁCTIL
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-danger, .btn-warning, .btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary:active, .btn-secondary:active, .btn-danger:active, .btn-warning:active, .btn-success:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #070b12;
  box-shadow: 0 4px 15px var(--accent-cyan-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px var(--accent-cyan-glow);
  transform: translateY(-1px);
}
[data-theme="light"] .btn-primary {
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-emerald-glow);
}
.btn-success:hover {
  box-shadow: 0 6px 20px var(--accent-emerald-glow);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-rose), #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-rose-glow);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px var(--accent-rose-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-action-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-sm:hover, .btn-action-sm.active {
  background: var(--accent-cyan-glow);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ==========================================================================
   8. ALERTAS Y CAJAS DE INFORMACIÓN
   ========================================================================== */
.alert-box {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  border: 1px solid transparent;
}

.alert-info {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(56, 189, 248, 0.03));
  border-color: rgba(0, 240, 255, 0.25);
  color: #e0f2fe;
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.03));
  border-color: rgba(16, 185, 129, 0.25);
  color: #d1fae5;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.03));
  border-color: rgba(245, 158, 11, 0.25);
  color: #fef3c7;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(255, 46, 99, 0.08), rgba(220, 38, 38, 0.03));
  border-color: rgba(255, 46, 99, 0.25);
  color: #ffe4e6;
}

[data-theme="light"] .alert-info { color: #0369a1; }
[data-theme="light"] .alert-success { color: #047857; }
[data-theme="light"] .alert-warning { color: #b45309; }
[data-theme="light"] .alert-danger { color: #be123c; }

/* ==========================================================================
   9. TACÓMETRO DE RIESGO TOXICOLÓGICO
   ========================================================================== */
.gauge-container {
  background: var(--bg-card-elevated);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease, background 0.4s ease;
}

.progress-bar.bg-success { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-bar.bg-warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-bar.bg-danger { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.progress-bar.bg-critical { background: linear-gradient(90deg, #e11d48, #991b1b); }

/* ==========================================================================
   10. VADEMÉCUM AEMPS Y RESULTADOS
   ========================================================================== */
.vad-search-box {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.vad-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.vad-item-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.vad-item-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

.vad-item-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.vad-item-pact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--accent-cyan);
  margin-top: 0.5rem;
  font-weight: 600;
}

.vad-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   11. MODAL INSTITUCIONAL ACCESIBLE
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  line-height: 1.65;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   12. HOJA DE HOSPITALIZACIÓN E IMPRESIÓN A4
   ========================================================================== */
.hospital-sheet-printable {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.sheet-paper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.sheet-hospital-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.sheet-hospital-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sheet-box-badge {
  background: var(--accent-cyan);
  color: #070b12;
  border-radius: var(--radius-md);
  padding: 0.5rem 1.25rem;
  text-align: center;
}

.sheet-box-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sheet-box-id {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
}

.sheet-patient-banner {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.sheet-patient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem 1rem;
  font-size: 0.88rem;
}

.sheet-patient-grid .lbl {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sheet-diagnosis-row {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.88rem;
}

.sheet-diagnosis-row .lbl {
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.sheet-protocols-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sheet-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.sheet-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

.sheet-card-body {
  font-size: 0.85rem;
  line-height: 1.5;
}

.sheet-fluid-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.sheet-crash-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sheet-crash-grid div {
  display: flex;
  justify-content: space-between;
}

.sheet-card-crash {
  border-color: rgba(255, 46, 99, 0.3);
  background: rgba(255, 46, 99, 0.03);
}

.sheet-meds-section, .sheet-hourly-monitoring {
  margin-bottom: 1.25rem;
}

.sheet-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

.sheet-meds-table, .sheet-monitoring-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sheet-meds-table th, .sheet-monitoring-table th {
  background: var(--bg-card-elevated);
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.sheet-meds-table td, .sheet-monitoring-table td {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.sheet-monitoring-table td {
  height: 28px;
}

.checkbox-slot {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  padding: 4px;
  font-weight: bold;
}

.sheet-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.sheet-signatures {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.sheet-legal-badge {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Wake Lock en Barra de Telemetría Clínica */
.btn-wake-lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-wake-lock-pill:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.btn-wake-lock-pill.wake-lock-active {
  background: var(--accent-emerald) !important;
  border-color: var(--accent-emerald) !important;
  color: #070b12 !important;
  font-weight: 700;
  box-shadow: 0 0 10px var(--accent-emerald-glow);
}

/* Gestor Multi-box en cabecera de filiación */
.global-boxes-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.global-box-pill {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.global-box-pill:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.global-box-pill.active-box {
  background: var(--accent-cyan);
  color: #070b12;
  border-color: var(--accent-cyan);
  font-weight: 700;
}

/* Botones de box en hoja */
.btn-box-tab {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-box-tab:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.btn-box-tab.active {
  background: var(--accent-cyan);
  color: #070b12;
  border-color: var(--accent-cyan);
  font-weight: 700;
}

/* Alertas de seguridad felina */
.feline-safety-banner {
  background: rgba(255, 46, 99, 0.12);
  border: 1px solid var(--accent-rose);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: fadeIn 0.3s;
}

.safety-alert-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.safety-alert-text {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #fca5a5;
}

.safety-alert-text strong {
  color: #ffffff;
}

/* Tablas y tarjetas de Anestesiología */
.anes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.anes-table th {
  background: var(--bg-card-elevated);
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.anes-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.anes-highlight-vol {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-cyan);
  font-size: 1.05rem;
}

/* Lista interactiva de deshidratación */
.dehydration-radios-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dehy-radio-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-size: 0.82rem;
  transition: border-color 0.15s;
}

.dehy-radio-item:hover {
  border-color: var(--accent-cyan);
}

.dehy-radio-item input[type="radio"] {
  margin-top: 2px;
}

@media (max-width: 1180px) {
  .clinical-nav-tabs {
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: none;
    padding-bottom: 6px;
  }
  .nav-module-tab {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 160px;
    border-radius: var(--radius-md);
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 0.75rem;
  }
  .nav-module-tab.active {
    border-bottom: 1px solid var(--border-color) !important;
    transform: translateY(-2px);
  }
}

@media (max-width: 640px) {
  .nav-module-tab {
    flex: 1 1 calc(50% - 6px);
    min-width: 135px;
    font-size: 0.78rem;
    padding: 0.55rem 0.5rem;
  }
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header, .tools-ad-banner-section, .tool-ad-sidebar, .clinical-nav-tabs, .patient-control-bar, .fijate-footer, #btn-print-hospital-sheet, .no-print, .btn-icon-danger {
    display: none !important;
  }
  .tool-layout, .tool-main-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .hospital-sheet-printable {
    border: none !important;
    padding: 0 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }
  .sheet-header {
    border-bottom: 2px solid #000000 !important;
  }
  .sheet-hospital-title, .sheet-section-title, .sheet-card-title {
    color: #000000 !important;
  }
  .sheet-patient-banner, .sheet-card {
    background: #f8fafc !important;
    border: 1px solid #94a3b8 !important;
    color: #000000 !important;
  }
  .sheet-box-badge {
    background: #000000 !important;
    color: #ffffff !important;
  }
  .sheet-meds-table th, .sheet-monitoring-table th, .sheet-table th {
    background: #e2e8f0 !important;
    color: #000000 !important;
    border-bottom: 1px solid #000000 !important;
  }
  .sheet-meds-table td, .sheet-monitoring-table td, .sheet-table td {
    border-bottom: 1px solid #cbd5e1 !important;
    color: #000000 !important;
  }
  .checkbox-slot {
    border: 1.5px solid #000000 !important;
  }
}
