/**
 * css/style.css — Hoja de Estilos Principal de app.renac.com.ar
 * Tokens de diseño médico de alto contraste (WCAG AAA) inspirados en cursosanestesia.com/app
 * y el ecosistema visual de RENAC (DataViewer / Atlas).
 */

:root {
  /* Paleta Médica Quirúrgica (WCAG AAA) */
  --rm-color-primary: #0a4275;
  --rm-color-primary-dark: #072f54;
  --rm-color-accent: #0284c7;
  --rm-color-accent-hover: #0369a1;
  --rm-color-emerald: #059669;

  /* Aliases usados en vistas dinámicas */
  --brand-primary: #0a4275;
  --brand-primary-dark: #072f54;
  --brand-secondary: #0284c7;
  --brand-accent: #059669;

  /* Estados semánticos WCAG AAA */
  --status-green-bg: #dcfce7;
  --status-green-text: #064e3b;
  --status-green-border: #86efac;

  --status-amber-bg: #fef3c7;
  --status-amber-text: #78350f;
  --status-amber-border: #fcd34d;

  --status-red-bg: #fee2e2;
  --status-red-text: #7f1d1d;
  --status-red-border: #fca5a5;

  --status-blue-bg: #e0f2fe;
  --status-blue-text: #0c4a6e;
  --status-blue-border: #7dd3fc;

  --status-purple-bg: #f3e8ff;
  --status-purple-text: #581c87;
  --status-purple-border: #d8b4fe;

  --status-gray-bg: #f1f5f9;
  --status-gray-text: #334155;
  --status-gray-border: #cbd5e1;

  /* Superficies y Texto */
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --text-dark: #0f172a;
  --text-primary: #0f172a;
  --text-body: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-strong: #cbd5e1;
  --border-subtle: #e2e8f0;

  /* Geometría y Táctil */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --touch-min: 42px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  --switcher-height: 50px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.45;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   1. BARRA FLOTANTE "MODO PRUEBAS / PERSONA SWITCHER" (cursosanestesia.com/app)
   ========================================================================== */
.rm-persona-switcher {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 2px solid #38bdf8;
  padding: 7px 18px;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.rm-switcher-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rm-switcher-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rm-switcher-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rm-switcher-current-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.rm-switcher-view-text {
  color: #94a3b8;
  font-size: 12px;
}

.rm-switcher-user-name {
  color: #ffffff;
  font-weight: 700;
}

.rm-switcher-role-tag {
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.rm-switcher-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rm-switcher-select {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 36px;
  cursor: pointer;
}

.rm-switcher-select:focus {
  outline: 2px solid #38bdf8;
  border-color: transparent;
}

.rm-switcher-restore-btn {
  background: #f59e0b;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  transition: background 0.15s ease;
}

.rm-switcher-restore-btn:hover {
  background: #fbbf24;
}

/* ==========================================================================
   2. CABECERA PRINCIPAL Y SELECTOR MULTI-HOSPITAL
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, #0a4275 0%, #072f54 100%);
  color: #ffffff;
  padding: 12px 20px;
  box-shadow: var(--shadow-sm);
}

.app-header-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 42px;
  width: auto;
  border-radius: 8px;
  background: #ffffff;
  padding: 3px 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.brand-title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #bae6fd;
}

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

.hosp-context-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 6px 12px;
  border-radius: 10px;
}

.hosp-context-selector label {
  font-size: 12px;
  color: #e0f2fe;
  font-weight: 600;
  white-space: nowrap;
}

.hosp-context-selector select {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}

.hosp-context-selector select option {
  color: var(--text-dark);
  background: #ffffff;
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.36);
  padding: 5px 14px 5px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-secondary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta strong {
  font-size: 12.5px;
  color: #ffffff;
}

.user-meta span {
  font-size: 11px;
  color: #cbd5e1;
}

/* ==========================================================================
   3. NAVEGACIÓN PRINCIPAL ADAPTATIVA (.nav-tab + .nav-badge)
   ========================================================================== */
.app-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: var(--switcher-height, 50px);
  z-index: 950;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.app-nav-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 16px;
  min-height: 46px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--brand-primary);
  background: var(--bg-subtle);
}

.nav-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-secondary);
  background: rgba(2, 132, 199, 0.06);
  font-weight: 700;
}

.nav-badge {
  background: var(--status-blue-bg);
  color: var(--status-blue-text);
  border: 1px solid var(--status-blue-border);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.nav-tab.active .nav-badge {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.nav-tab-icon {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-tab-label-desktop {
  display: inline;
}

.nav-tab-label-mobile,
.nav-badge-mobile {
  display: none;
}

/* ==========================================================================
   4. CONTENEDOR PRINCIPAL, KPI GRID Y TARJETAS (.kpi-grid, .card)
   ========================================================================== */
.app-main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 18px 64px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1.15;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.card-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-primary);
}

.card-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-dark);
}

.card-subtitle {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.card-body {
  padding: 18px 20px;
}

/* ==========================================================================
   5. FILTROS Y PASTILLAS DE PRESET (.filter-bar, .preset-pills, .preset-pill)
   ========================================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
}

.card-body > .filter-bar {
  padding: 0;
}

.preset-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-pill {
  appearance: none;
  background: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  border-color: var(--brand-secondary);
  color: var(--brand-primary);
  background: #f0f9ff;
}

.preset-pill.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 6px rgba(10, 66, 117, 0.2);
}

.filter-input {
  flex: 1;
  min-width: 260px;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-dark);
  min-height: 38px;
}

.filter-select {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-dark);
  min-height: 38px;
  cursor: pointer;
}

.filter-input:focus,
.filter-select:focus {
  outline: 2px solid var(--brand-secondary);
  border-color: transparent;
}

/* ==========================================================================
   6. BANDEJA DIVIDIDA (SPLIT LAYOUT: LISTA IZQUIERDA + DETALLE DERECHA)
   ========================================================================== */
.split-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1080px) {
  .split-layout {
    grid-template-columns: 1fr;
  }
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inbox-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.inbox-item:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.inbox-item.selected {
  background: #f0f9ff;
  border-color: #7dd3fc;
  border-left: 5px solid var(--brand-primary);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

.inbox-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.inbox-hosp-code {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-primary);
}

.inbox-hosp-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 8px;
}

.inbox-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   7. PILL BADGES SEMÁNTICOS WCAG AAA (.pill, .pill-red, .pill-amber, etc.)
   ========================================================================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.pill-green {
  background: var(--status-green-bg);
  color: var(--status-green-text);
  border: 1px solid var(--status-green-border);
}

.pill-amber {
  background: var(--status-amber-bg);
  color: var(--status-amber-text);
  border: 1px solid var(--status-amber-border);
}

.pill-red {
  background: var(--status-red-bg);
  color: var(--status-red-text);
  border: 1px solid var(--status-red-border);
}

.pill-blue {
  background: var(--status-blue-bg);
  color: var(--status-blue-text);
  border: 1px solid var(--status-blue-border);
}

.pill-purple {
  background: var(--status-purple-bg);
  color: var(--status-purple-text);
  border: 1px solid var(--status-purple-border);
}

.pill-gray {
  background: var(--status-gray-bg);
  color: var(--status-gray-text);
  border: 1px solid var(--status-gray-border);
}

/* ==========================================================================
   8. BOTONES ERGONÓMICOS (.btn, .btn-primary, .btn-emerald, .btn-outline, etc.)
   ========================================================================== */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  min-height: 38px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand-primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--brand-primary-dark);
}

.btn-emerald {
  background: var(--brand-accent);
  color: #ffffff;
}
.btn-emerald:hover {
  background: #047857;
}

.btn-amber {
  background: #d97706;
  color: #ffffff;
}
.btn-amber:hover {
  background: #b45309;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.btn-danger:hover {
  background: #fecaca;
}

.btn-outline {
  background: #ffffff;
  color: var(--text-dark);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: #94a3b8;
}

.btn-sm {
  min-height: 34px;
  padding: 5px 11px;
  font-size: 12.5px;
}

.btn-xs {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 11.5px;
  border-radius: 6px;
}

/* ==========================================================================
   9. ALERTAS DE CONTROL DE CALIDAD (.qc-alert)
   ========================================================================== */
.qc-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

.qc-alert-warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.qc-alert-ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.qc-alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ==========================================================================
   10. PANEL DE CODIFICACIÓN CIE-10 Y FORMULARIOS (.coding-box, .field-group)
   ========================================================================== */
.coding-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.coding-box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 12px;
}

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

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

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.field-group input,
.field-group select,
.field-group textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-dark);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  min-height: 36px;
  width: 100%;
}

.field-group textarea {
  min-height: 70px;
  resize: vertical;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: 2px solid var(--brand-secondary);
  border-color: transparent;
}

.field-hint {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.req-star {
  color: #dc2626;
  font-weight: 700;
}

/* Validación nativa post-interacción (:user-invalid de Modern Web Guidance) */
.field-group input:user-invalid,
.field-group select:user-invalid,
.field-group textarea:user-invalid,
.field-group input[aria-invalid="true"],
.field-group select[aria-invalid="true"],
.field-group textarea[aria-invalid="true"] {
  border-color: #d93025;
  background-color: #fce8e6;
}

.error-msg {
  display: none;
  color: #d93025;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 2px;
}

.field-group input:user-invalid + .error-msg,
.field-group select:user-invalid + .error-msg,
.field-group textarea:user-invalid + .error-msg,
.field-group input[aria-invalid="true"] + .error-msg {
  display: block;
}

.field-group input:required:user-valid {
  border-color: #188038;
}

.ne-toggle-btn {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.ne-toggle-btn:hover {
  background: #cbd5e1;
}

/* ==========================================================================
   11. HILOS DE CONVERSACIÓN CLÍNICA (.thread-box, .thread-msg)
   ========================================================================== */
.thread-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thread-msg {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.msg-hosp {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #64748b;
}

.msg-coord {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid var(--brand-secondary);
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

/* ==========================================================================
   12. TABLA DEL SEMÁFORO (.semaforo-table-wrap, .semaforo-table, .month-cell)
   ========================================================================== */
.semaforo-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.semaforo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.semaforo-table th,
.semaforo-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: middle;
}

.semaforo-table th {
  background: #f1f5f9;
  color: var(--brand-primary);
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.semaforo-table tbody tr:hover td {
  background: #f8fafc;
}

.month-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

.month-cell:hover {
  transform: scale(1.08);
}

.cell-si {
  background: var(--status-green-bg);
  color: var(--status-green-text);
  border: 1px solid var(--status-green-border);
}

.cell-no {
  background: var(--status-red-bg);
  color: var(--status-red-text);
  border: 1px solid var(--status-red-border);
}

.cell-na {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* ==========================================================================
   13. DIALOGS NATIVOS (<dialog closedby="any">) Y TOASTS
   ========================================================================== */
dialog.app-dialog {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 880px;
  width: calc(100% - 24px);
  max-height: 90vh;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
  background: var(--bg-card);
  color: var(--text-body);
}

dialog.app-dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-primary);
}

.dialog-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.toast-item {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 4px solid #38bdf8;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}


/* ==========================================================================
   14. GRILLA DE MESES DEL HOSPITAL Y MOBILE-FIRST RESPONSIVE (SIN DESBORDE)
   ========================================================================== */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.hosp-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hosp-months-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(74px, 1fr));
  gap: 8px;
}

.hosp-m-btn {
  appearance: none;
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.hosp-m-btn--si {
  background: var(--status-green-bg);
  color: var(--status-green-text);
  border-color: var(--status-green-border);
}

.hosp-m-btn--no {
  background: var(--status-red-bg);
  color: var(--status-red-text);
  border-color: var(--status-red-border);
}

.hosp-m-btn.is-selected {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
  box-shadow: 0 2px 8px rgba(10, 66, 117, 0.2);
}

.hosp-m-btn__label {
  font-size: 11.5px;
  font-weight: 700;
}

.hosp-m-btn__state {
  font-size: 11.5px;
  font-weight: 800;
}

.hosp-totals-bar {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

/* Ajustes específicos para Viewport Celular (Pixel 9 Pro / iPhone) */
@media (max-width: 768px) {
  .rm-persona-switcher {
    padding: 8px 12px;
  }

  .rm-switcher-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .rm-switcher-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .rm-switcher-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
  }

  .rm-switcher-restore-btn {
    width: 100%;
    justify-content: center;
  }

  .app-header {
    padding: 10px 12px;
  }

  .app-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand-title h1 {
    font-size: 15.5px;
    line-height: 1.25;
  }

  .brand-title p {
    font-size: 11px;
  }

  .header-context {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .hosp-context-selector {
    width: 100%;
    justify-content: space-between;
  }

  .hosp-context-selector select {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    text-overflow: ellipsis;
  }

  .user-profile-chip {
    width: 100%;
    border-radius: 10px;
  }

  .user-meta {
    min-width: 0;
  }

  .user-meta span {
    white-space: normal;
    word-break: break-word;
  }

  .app-nav {
    top: 0;
    position: relative;
  }

  .app-nav-inner {
    padding: 0 10px;
    gap: 2px;
  }

  .nav-tab {
    padding: 10px 12px;
    font-size: 12.5px;
  }

  .app-main {
    padding: 12px 10px 48px;
  }

  .card-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
  }

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

  .hosp-action-bar {
    width: 100%;
  }

  .hosp-action-bar .btn {
    flex: 1;
  }

  .hosp-months-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .hosp-m-btn {
    padding: 7px 4px;
  }

  .hosp-m-btn__label,
  .hosp-m-btn__state {
    font-size: 10.5px;
  }

  .hosp-totals-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .hosp-totals-bar .btn {
    width: 100%;
  }

  .coding-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .coding-grid > [style*="grid-column: span 2"] {
    grid-column: 1 / -1 !important;
  }
}

/* ==========================================================================
   15. PANTALLA DE LOGIN CON CONTRASEÑA (.login-screen, .login-card)
   ========================================================================== */
.rm-switcher-tour-btn,
.rm-switcher-login-btn {
  appearance: none;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rm-switcher-tour-btn:hover,
.rm-switcher-login-btn:hover {
  background: #334155;
  border-color: #94a3b8;
  color: #ffffff;
}

.rm-tour-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid #334155;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}

.rm-tour-toggle-label input {
  accent-color: #38bdf8;
  cursor: pointer;
}

.login-screen {
  min-height: calc(100vh - 46px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(145deg, #0a4275 0%, #0f172a 100%);
}

.login-card {
  width: 100%;
  max-width: 490px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  padding: 28px 28px 24px;
  border: 1px solid #e2e8f0;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.login-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0a4275 0%, #0284c7 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.login-brand h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--brand-primary);
}

.login-brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.login-welcome {
  font-size: 13px;
  color: var(--text-body);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid var(--brand-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 16px;
  line-height: 1.45;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-pass-wrap input {
  padding-right: 40px;
}

.login-eye-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: 6px;
}

.login-eye-btn:hover {
  background: #f1f5f9;
}

.login-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.login-submit-btn {
  width: 100%;
  min-height: 42px;
  font-size: 14px;
  margin-top: 4px;
}

.login-quick-test {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
}

.login-quick-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.login-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.login-quick-chip {
  appearance: none;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}

.login-quick-chip:hover {
  background: #f0f9ff;
  border-color: var(--brand-secondary);
  transform: translateY(-1px);
}

.login-quick-chip strong {
  font-size: 12px;
  color: var(--brand-primary);
}

.login-quick-chip span {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   16. TOUR INTERACTIVO DE BIENVENIDA (.tour-backdrop, .tour-card)
   ========================================================================== */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tour-card {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.35);
  border: 2px solid var(--brand-secondary);
  padding: 22px 24px;
  animation: tourFadeIn 0.18s ease-out;
}

@keyframes tourFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tour-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tour-step-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tour-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.tour-close-btn:hover {
  background: #f1f5f9;
  color: var(--text-dark);
}

.tour-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-primary);
}

.tour-desc {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-body);
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.tour-dont-show {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.tour-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   17. ESPÍRITU CONVERSACIONAL DE FORO Y MENOR CARGA COGNITIVA (.forum-*)
   ========================================================================== */
.forum-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.forum-top-bar__title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-primary);
}

.forum-top-bar__title p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.forum-top-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.forum-card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.forum-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #bae6fd;
}

.forum-avatar--coord {
  background: #0a4275;
  color: #ffffff;
  border-color: #073057;
}

.forum-Avatar--hosp,
.forum-avatar--hosp {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.forum-snippet {
  margin-top: 8px;
  padding: 7px 10px;
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.35;
}

.forum-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
}

.forum-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a4275 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.forum-conversation-panel {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.forum-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.forum-conversation-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--brand-primary);
}

.forum-posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.forum-post {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.forum-post--coord {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.forum-post--hosp {
  background: #ffffff;
  border-color: #cbd5e1;
}

.forum-post__body {
  flex: 1;
  min-width: 0;
}

.forum-post__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 12px;
}

.forum-post__meta strong {
  color: var(--text-dark);
}

.forum-post__meta span {
  color: var(--text-secondary);
  font-size: 11px;
}

.forum-post__text {
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--text-body);
}

.forum-quick-templates {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.forum-reply-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.forum-reply-box input {
  flex: 1;
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.forum-reply-box input:focus {
  outline: 2px solid var(--brand-secondary);
  border-color: transparent;
}

@media (max-width: 768px) {
  .login-quick-grid {
    grid-template-columns: 1fr;
  }
  .forum-reply-box {
    flex-direction: column;
    align-items: stretch;
  }
  .forum-reply-box .btn {
    width: 100%;
  }
}

/* Aliases de clases de plantilla en index.html y js/app.js */
.login-help-row {
  font-size: 12px;
  color: var(--text-secondary);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.4;
}

.login-help-row a {
  color: var(--brand-secondary);
  font-weight: 600;
  text-decoration: none;
}

.tour-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.tour-body {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-body);
}

.tour-auto-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.forum-top-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--brand-primary);
}

.forum-top-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.forum-avatar--lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a4275 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.forum-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--brand-primary);
  margin-bottom: 10px;
}

.forum-post-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #bae6fd;
}

.forum-post--coord .forum-post-avatar {
  background: #0a4275;
  color: #ffffff;
  border-color: #073057;
}

.forum-post-content {
  flex: 1;
  min-width: 0;
}

.forum-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 12px;
}

.forum-post-text {
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--text-body);
}

/* Pestañas de método de ingreso (Contraseña vs OTP) y campo único OTP (sms-otp-form) */
.login-method-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border: 1px solid #cbd5e1;
}

.login-method-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.login-method-tab.active {
  background: #ffffff;
  color: var(--brand-primary);
  border-color: #bae6fd;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.otp-sent-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.field-group input.otp-single-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  color: var(--brand-primary);
}

.pwa-install-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
}

.pwa-header-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.pwa-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: #ffffff;
}

/* ==========================================================================
   17. ESTILO FORO CLÁSICO VBULLETIN (FOROS → LISTA DE TEMAS → TEMA SHOWTHREAD)
   ========================================================================== */
.vb-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #1e3a8a 0%, #0a4275 100%);
  border: 1px solid #073057;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 5px rgba(10, 66, 117, 0.14);
}

.vb-navbar-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vb-nav-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #e0f2fe;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.vb-nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.vb-nav-btn.active {
  background: #ffffff;
  color: #0a4275;
  border-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.vb-navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vb-search-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vb-search-inline input,
.vb-search-inline select {
  background: #ffffff;
  border: 1px solid #93c5fd;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 12px;
  color: #0f172a;
}

.vb-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  margin-bottom: 12px;
}

.vb-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.vb-crumb-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  color: #0369a1;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vb-crumb-link:hover {
  color: #0a4275;
}

.vb-crumb-sep {
  color: #64748b;
  font-weight: 700;
}

.vb-crumb-current {
  font-weight: 800;
  color: #0f172a;
}

.vb-category-box {
  border: 1px solid #94a3b8;
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.vb-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #0c4a6e 0%, #075985 100%);
  color: #ffffff;
  padding: 10px 14px;
  border-bottom: 2px solid #0369a1;
}

.vb-cat-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.vb-cat-sub {
  font-size: 11.5px;
  color: #bae6fd;
  margin-top: 2px;
}

.vb-table-wrap {
  container-type: inline-size;
  overflow-x: auto;
  max-width: 100%;
}

.vb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.vb-table thead th {
  background: #e2e8f0;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 12px;
  border-bottom: 1px solid #cbd5e1;
  text-align: left;
}

.vb-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.vb-row {
  cursor: pointer;
  background: #ffffff;
  transition: background-color 0.12s ease;
}

.vb-row:nth-child(even) {
  background: #f8fafc;
}

.vb-row:hover {
  background: #eff6ff;
}

.vb-row--highlight {
  background: #fffbeb !important;
}

.vb-row--highlight:hover {
  background: #fef3c7 !important;
}

.vb-cell-icon {
  text-align: center;
  width: 46px;
}

.vb-cell-main {
  min-width: 240px;
}

.pill-white {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.vb-forum-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.vb-forum-icon--unread {
  background: #dbeafe;
  border-color: #60a5fa;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.18);
}

.vb-forum-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.vb-forum-title {
  font-size: 14px;
  font-weight: 800;
  color: #0a4275;
  text-decoration: underline;
  text-decoration-color: rgba(10, 66, 117, 0.3);
  text-underline-offset: 2px;
}

.vb-row:hover .vb-forum-title {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
}

.vb-code-tag {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.vb-forum-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
}

.vb-cell-stats {
  text-align: center;
  font-size: 12px;
  color: #334155;
  background: rgba(241, 245, 249, 0.55);
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.vb-cell-lastpost {
  font-size: 12px;
  background: rgba(248, 250, 252, 0.8);
}

.vb-lastpost-title {
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 2px;
  line-height: 1.3;
}

.vb-lastpost-title:hover {
  text-decoration: underline;
}

.vb-lastpost-meta {
  font-size: 11px;
  color: #64748b;
}

/* Vista de Tema Abierto (vBulletin showthread posts) */
.vb-posts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: #e2e8f0;
}

.vb-post-card {
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
}

.vb-post-card--coord {
  border-color: #0284c7;
}

.vb-post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
}

.vb-post-card--coord .vb-post-top {
  background: linear-gradient(180deg, #0369a1 0%, #0a4275 100%);
}

.vb-post-num {
  color: #bae6fd;
  font-weight: 800;
}

.vb-post-layout {
  display: grid;
  grid-template-columns: 195px 1fr;
  min-height: 110px;
}

.vb-post-user {
  background: #f1f5f9;
  border-right: 1px solid #cbd5e1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.vb-post-username {
  font-size: 13px;
  font-weight: 800;
  color: #0a4275;
  margin-top: 4px;
}

.vb-post-usemeta {
  font-size: 11px;
  color: #475569;
  line-height: 1.3;
}

.vb-post-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
}

.vb-post-message {
  font-size: 13.5px;
  line-height: 1.5;
  color: #0f172a;
}

.vb-attachment-box {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
  color: #334155;
}

/* Pie sutil para pedido de material físico en papel (des-destacado) */
.hosp-subtle-footer {
  margin-top: 18px;
  padding: 10px 14px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #64748b;
}

.vb-subtle-link-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 2px 4px;
}

.vb-subtle-link-btn:hover {
  color: #0a4275;
}

/* Responsive Container Query para Tablas vBulletin en móvil (responsive-table) */
@container (width < 640px) {
  .vb-table thead {
    display: none;
  }
  .vb-table,
  .vb-table tbody,
  .vb-table tr,
  .vb-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .vb-table tr.vb-row {
    padding: 10px 12px;
    border-bottom: 2px solid #cbd5e1;
  }
  .vb-table td {
    padding: 4px 0;
    border: none;
  }
  .vb-cell-icon {
    display: none !important;
  }
  .vb-cell-stats,
  .vb-cell-lastpost {
    text-align: left;
    background: transparent;
    border: none;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px dashed #e2e8f0 !important;
  }
}

@media (max-width: 680px) {
  .vb-post-layout {
    grid-template-columns: 1fr;
  }
  .vb-post-user {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid #cbd5e1;
    padding: 8px 12px;
  }
  .vb-post-username {
    margin-top: 0;
  }
}

/* ==========================================================================
   19. UTILIDAD ACCESIBLE (.visually-hidden), SELLO RÁPIDO CON FOTO Y MENSAJERÍA INTERNA
   ========================================================================== */

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

.vb-attachment-box-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

/* Banner de confirmación rápida 1-click "Recibido, está todo ok" con foto de Paz o Pablo */
.quick-ack-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid #6ee7b7;
  border-left: 5px solid #059669;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}

.quick-ack-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}

.quick-ack-photo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #059669;
  background: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.2);
}

.quick-ack-title {
  font-size: 13px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 2px;
}

.quick-ack-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #064e3b;
  line-height: 1.4;
}

.quick-ack-meta {
  font-size: 11.5px;
  color: #047857;
  margin-top: 3px;
}

.quick-ok-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.22);
}

/* Sistema de Mensajería Interna entre Participantes (.dm-*) */
.dm-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 480px;
  background: #ffffff;
}

.dm-sidebar {
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

.dm-thread-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 460px;
}

.dm-thread-item {
  appearance: none;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
  display: flex;
  width: 100%;
}

.dm-thread-item:hover {
  background: #eff6ff;
}

.dm-thread-item.active {
  background: #e0f2fe;
  border-left: 4px solid var(--brand-secondary);
}

.dm-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
}

.dm-main-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dm-messages {
  flex: 1;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 340px;
  background: #f8fafc;
}

.dm-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.dm-bubble--theirs {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

.dm-bubble--mine {
  align-self: flex-end;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #0c4a6e;
}

.dm-bubble-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: #475569;
  margin-bottom: 4px;
}

.dm-bubble-text {
  white-space: pre-line;
}

.dm-compose {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  background: #ffffff;
}

@media (max-width: 780px) {
  .dm-layout {
    grid-template-columns: 1fr;
  }
  .dm-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .dm-thread-list {
    max-height: 200px;
  }
}

/* ==========================================================================
   21. TARJETAS MENSUALES EPIDEMIOLÓGICAS (VERDE / AMARILLO EN CURSO / ROJO VENCIDO)
       CON MINI-MÉTRICAS (CASOS · NAC. · PREV. %), SEMÁFORO AMPLIADO Y TABLA DE ENVÍOS
   ========================================================================== */

.hosp-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 8px;
}

.hosp-m-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  min-height: 66px;
}

.hosp-m-btn--curso {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  color: #92400e;
}

.hosp-m-btn--curso .hosp-m-btn__label {
  color: #78350f;
}

.hosp-m-btn--curso .hosp-m-btn__state,
.hosp-m-btn--curso .hosp-m-btn__status {
  background: #fde68a;
  color: #92400e;
  border: 1px solid #f59e0b;
}

/* Sub-tabs institucionales (.subtab-bar / .subtab-btn), píldoras y contenedores responsivos */
.subtab-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.subtab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.subtab-btn:hover {
  color: var(--brand-primary);
  background: rgba(255, 255, 255, 0.7);
}

.subtab-btn.active {
  background: #ffffff;
  color: var(--brand-primary);
  border-color: #bae6fd;
  box-shadow: 0 1px 3px rgba(10, 66, 117, 0.1);
}

.pill-emerald {
  background: var(--status-green-bg);
  color: var(--status-green-text);
  border: 1px solid var(--status-green-border);
}

.qc-alert-info {
  background: #f0f9ff;
  color: #0c4a6e;
  border: 1px solid #bae6fd;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.atlas-layout-grid {
  display: grid;
  grid-template-columns: minmax(260px, 295px) 1fr;
  gap: 18px;
  align-items: start;
}

.hosp-m-btn__metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1.2;
  padding-top: 5px;
  border-top: 1px dashed rgba(15, 23, 42, 0.14);
  color: #1e293b;
  font-family: var(--font-sans);
}

.hosp-m-btn__metrics strong {
  font-family: var(--font-mono);
  font-weight: 800;
}

/* Semáforo Nacional con Casos, Nacimientos y Prevalencia (%) en cada celda mensual */
.sem-cell-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 4px 5px;
  border-radius: 7px;
  line-height: 1.15;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.sem-cell-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

.cell-curso {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.sem-cell-top {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.sem-cell-metrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.15;
  opacity: 0.95;
}

.sem-cell-metrics strong {
  font-family: var(--font-mono);
  font-weight: 800;
}

.sem-cell-prev {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 9.5px;
  margin-top: 1px;
}

.sem-cell-metrics--empty {
  font-size: 9px;
  opacity: 0.8;
}

/* Barra de gestión de Planilla Excel del mes */
.excel-manager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--brand-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

/* Sistema de Consulta Ordenable para Envíos de Datos (Solapa 1 de Pablo y Paz) */
.envios-query-table thead th {
  background: #0f172a;
  color: #f8fafc;
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

.sort-th-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sort-th-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #38bdf8;
}

.envios-query-row:hover td {
  background: #f0f9ff;
}

/* ==========================================================================
   MENÚ DE NAVEGACIÓN INFERIOR EN MÓVIL (ESTILO CURSOSANESTESIA.COM/APP)
   ========================================================================== */
@media (max-width: 767.98px) {
  .rm-persona-switcher {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .rm-switcher-inner {
    gap: 6px;
  }

  .rm-switcher-view-text {
    display: none;
  }

  .atlas-layout-grid {
    grid-template-columns: 1fr !important;
  }

  .app-main {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 14px)) !important;
  }

  .app-nav {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-bottom: none !important;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08) !important;
  }

  .app-nav-inner {
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 8px)) 6px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
  }

  .app-nav-inner::-webkit-scrollbar {
    display: none !important;
  }

  .nav-tab {
    flex: 1 0 60px !important;
    max-width: 86px !important;
    min-inline-size: 0 !important;
    min-height: 48px !important;
    padding: 4px 3px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    position: relative !important;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  }

  .nav-tab-icon {
    font-size: 19px !important;
    line-height: 1 !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  }

  .nav-tab-label-desktop,
  .nav-badge-desktop {
    display: none !important;
  }

  .nav-tab-label-mobile {
    display: block !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    max-width: 100% !important;
    text-align: center !important;
  }

  .nav-badge-mobile {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 2px !important;
    right: 6px !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 4px !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    border: 1.5px solid #ffffff !important;
    border-radius: 9999px !important;
    line-height: 1 !important;
  }

  .nav-tab.active {
    background: #e0f2fe !important;
    border: none !important;
  }

  .nav-tab.active .nav-tab-icon {
    transform: scale(1.15) !important;
  }

  .nav-tab.active .nav-tab-label-mobile {
    color: #0a4275 !important;
    font-weight: 800 !important;
  }

  .toast-container {
    bottom: calc(74px + env(safe-area-inset-bottom, 8px)) !important;
  }
}








