:root {
  --eism-ink: #14323c;
  --eism-primary: #0f5c6b;
  --eism-primary-dark: #0c4a56;
  --eism-bg: #eef3f4;
  --eism-card: #ffffff;
  --eism-line: #d5e1e6;
  --eism-muted: #52656d;
  --eism-soft: #f4f8f9;
}

body {
  background: var(--eism-bg);
  color: var(--eism-ink);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--eism-primary);
}

.navbar-eism {
  background: var(--eism-primary);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

.navbar-eism .navbar-brand,
.navbar-eism .nav-link {
  color: rgba(255, 255, 255, .9);
}

.navbar-eism .nav-link.active,
.navbar-eism .navbar-brand {
  color: #fff;
  font-weight: 700;
}

.navbar-eism .nav-link {
  border-radius: 999px;
  padding: .35rem .75rem;
}

.navbar-eism .nav-link:hover,
.navbar-eism .nav-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.marca {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: .4rem;
  background: #fff;
  display: inline-block;
  position: relative;
  margin-right: .45rem;
  vertical-align: -3px;
}

.marca::before,
.marca::after {
  content: "";
  position: absolute;
  background: var(--eism-primary);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.marca::before { width: 2px; height: 11px; }
.marca::after { width: 11px; height: 2px; }

main { padding: 1.5rem 0 3rem; }

.eyebrow {
  margin: 0 0 .2rem;
  color: var(--eism-primary);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.page-head { margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.85rem; margin: 0; }
.page-head p { color: var(--eism-muted); margin: .35rem 0 0; }

.card-eism {
  border: 1px solid var(--eism-line);
  border-radius: 14px;
  background: var(--eism-card);
  box-shadow: 0 1px 2px rgba(15, 50, 60, .04);
}

.card-eism > .card-header {
  background: var(--eism-soft);
  border-bottom: 1px solid var(--eism-line);
  color: var(--eism-ink);
  font-weight: 700;
  border-radius: 14px 14px 0 0;
}

.btn-primary {
  --bs-btn-bg: var(--eism-primary);
  --bs-btn-border-color: var(--eism-primary);
  --bs-btn-hover-bg: var(--eism-primary-dark);
  --bs-btn-hover-border-color: var(--eism-primary-dark);
  --bs-btn-active-bg: #0a3e48;
  --bs-btn-active-border-color: #0a3e48;
}

.btn-outline-primary {
  --bs-btn-color: var(--eism-primary);
  --bs-btn-border-color: #9ec5ce;
  --bs-btn-hover-bg: var(--eism-primary);
  --bs-btn-hover-border-color: var(--eism-primary);
}

.kpi {
  background: #fff;
  border: 1px solid var(--eism-line);
  border-radius: 14px;
  padding: .95rem 1rem;
  height: 100%;
}

.kpi strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--eism-primary);
}

.kpi span { color: var(--eism-muted); font-size: .92rem; }
.kpi-critico strong { color: #7f1d1d; }

.series { display: grid; gap: .85rem; }
.serie-top, .serie {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
}
.serie { flex-wrap: wrap; }
.serie-top { width: 100%; font-size: .95rem; }
.serie-pct { color: var(--eism-muted); font-size: .82rem; min-width: 3.5rem; text-align: right; }

.barra {
  flex: 1 1 100%;
  height: .55rem;
  background: #e6eef0;
  border-radius: 999px;
  overflow: hidden;
}

.barra-fill {
  height: 100%;
  border-radius: inherit;
  max-width: 100%;
}

.paciente-card {
  border: 1px solid var(--eism-line);
  border-left: 6px solid #9aabb2;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
}

.paciente-card[data-triage="ROJO"] { border-left-color: #b42318; }
.paciente-card[data-triage="NARANJA"] { border-left-color: #c2410c; }
.paciente-card[data-triage="AMARILLO"] { border-left-color: #eab308; }
.paciente-card[data-triage="VERDE"] { border-left-color: #15803d; }
.paciente-card[data-triage="AZUL"] { border-left-color: #1d4ed8; }

.paciente-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.paciente-top h3 { font-size: 1rem; margin: 0; }

.resumen-sticky {
  background: #fff;
  border: 1px solid var(--eism-line);
  border-radius: 14px;
  padding: 1rem;
}

@media (min-width: 992px) {
  .resumen-sticky { position: sticky; top: 1rem; }
}

.resumen-sticky h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.resumen-sticky h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--eism-muted); margin: 1rem 0 .4rem; }
.resumen-total strong { font-size: 1.8rem; color: var(--eism-primary); }
.resumen-duracion, .resumen-nota { color: var(--eism-muted); margin-bottom: .25rem; }

.alerta-turno {
  background: #fff7ed;
  color: #9a3412;
  border-radius: 8px;
  padding: .5rem .7rem;
  font-size: .9rem;
}

.conteo { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.conteo li { display: flex; align-items: center; gap: .5rem; }
.conteo strong { margin-left: auto; }

.punto {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  display: inline-block;
}

#conteo-triage [data-clave="ROJO"] .punto { background: #b42318; }
#conteo-triage [data-clave="NARANJA"] .punto { background: #c2410c; }
#conteo-triage [data-clave="AMARILLO"] .punto { background: #eab308; }
#conteo-triage [data-clave="VERDE"] .punto { background: #15803d; }
#conteo-triage [data-clave="AZUL"] .punto { background: #1d4ed8; }

.badge-triage, .badge-destino {
  display: inline-block;
  border-radius: 999px;
  padding: .15rem .55rem;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.badge-triage[data-triage="ROJO"] { background: #b42318; }
.badge-triage[data-triage="NARANJA"] { background: #c2410c; }
.badge-triage[data-triage="AMARILLO"] { background: #f5d061; color: #422006; }
.badge-triage[data-triage="VERDE"] { background: #15803d; }
.badge-triage[data-triage="AZUL"] { background: #1d4ed8; }

.badge-destino[data-destino="ALTA_MEDICA"] { background: #0f766e; }
.badge-destino[data-destino="INTERNACION_SALA_COMUN"] { background: #1d4ed8; }
.badge-destino[data-destino="UTI_SHOCKROOM"] { background: #b45309; }
.badge-destino[data-destino="DERIVACION_TRASLADO"] { background: #6d28d9; }
.badge-destino[data-destino="OBITO"] { background: #7f1d1d; }

.tabla-eism thead th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--eism-muted);
  white-space: nowrap;
}

.opciones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .35rem .75rem;
}

.opcion {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0;
  padding: .35rem .15rem;
}

.opcion input { margin-top: .2rem; }

.leyenda { color: var(--eism-muted); font-size: .85rem; }
.obligatorio { color: #b42318; }

.pie {
  border-top: 1px solid var(--eism-line);
  color: var(--eism-muted);
  font-size: .85rem;
  padding: 1rem 0 1.4rem;
}

.filtros { background: #fff; }

@media (max-width: 991.98px) {
  .col-opcional { display: none; }
}

@media print {
  body::before, .navbar, .pie, .no-print, .btn { display: none !important; }
  body, .card-eism, .paciente-card { background: #fff; }
  .col-opcional { display: table-cell !important; }
  main { padding: 0; }
  a { color: inherit; text-decoration: none; }
}
