/* ===================================
   SEGUIMIENTO DE ENFERMERÍA — FULLSCREEN
   ===================================
   Panel paralelo a #config-tratamiento y #workspace-clinico.
   Reutiliza los tokens visuales del módulo hospitalizado
   (--ct-*) ya definidos en configTratamiento.css.
   Prefijo de clases: .se-*
   =================================== */

/* SweetAlert2 debe quedar SOBRE este panel y sobre otros paneles
   fullscreen del módulo (ct/ws usan z-index 10000 / swal 10001).
   Aquí elevamos un escalón para que sub-Swals (fe-erratas Fase 4)
   queden encima del panel cuando esté abierto. */
.se-panel-abierto .swal2-container {
  z-index: 10003 !important;
}

/* ── Panel principal ─────────────────────────────────────────────────────── */
#seguimiento-enfermeria {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  background: var(--ct-bg, #f4f6f9);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#seguimiento-enfermeria.se-activo {
  transform: translateY(0);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.se-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--ct-header, #1c2a3a);
  color: #fff;
  flex-shrink: 0;
  flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(28, 42, 58, 0.12);
}

.se-header-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.se-header-title > i {
  color: #5fb3ff;
}

.se-header-paciente {
  font-size: 13px;
  opacity: 0.85;
  white-space: nowrap;
}

.se-spacer {
  flex: 1;
}

.se-btn-cerrar {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.se-btn-cerrar:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Cuerpo: 2 columnas (sidebar + main) ─────────────────────────────────── */
.se-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar (timeline) ──────────────────────────────────────────────────── */
.se-sidebar {
  flex: 0 0 320px;
  width: 320px;
  display: flex;
  flex-direction: column;
  background: var(--ct-card-bg, #fff);
  border-right: 1px solid var(--ct-border, #dee2e6);
  min-height: 0;
}

.se-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f4fa;
  border-bottom: 1px solid var(--ct-border, #dee2e6);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ct-muted, #6c757d);
  flex-shrink: 0;
}

.se-sidebar-header > span > i {
  color: var(--ct-primary, #1a6fc4);
}

.se-sidebar-cuerpo {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Main (formulario) ───────────────────────────────────────────────────── */
.se-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--ct-card-bg, #fff);
}

/* ── Reglas básicas adelantadas (Fase 4 las completará) ──────────────────── */

/* Item del timeline (cada seguimiento previo en el sidebar) */
.se-timeline-item {
  background: var(--ct-card-bg, #fff);
  border: 1px solid var(--ct-border, #dee2e6);
  border-left: 3px solid var(--ct-primary, #1a6fc4);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.se-timeline-item:hover {
  background: #eef4ff;
  border-color: var(--ct-primary, #1a6fc4);
}

.se-timeline-item.activo {
  background: #eef4ff;
  border-color: var(--ct-primary, #1a6fc4);
  box-shadow: 0 1px 3px rgba(26, 111, 196, 0.18);
}

/* Card contenedora del formulario en el main */
.se-form-card {
  background: var(--ct-card-bg, #fff);
  border: 1px solid var(--ct-border, #dee2e6);
  border-radius: 8px;
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Spinner reutilizable dentro del panel */
.se-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  gap: 10px;
  color: var(--ct-muted, #6c757d);
  font-size: 14px;
}

/* Estado vacío genérico */
.se-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--ct-muted, #6c757d);
}

.se-vacio-icon {
  font-size: 48px;
  color: #c5d3e3;
  margin-bottom: 10px;
}

.se-vacio-texto {
  font-size: 13px;
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Tablets: sidebar más estrecho */
@media (max-width: 991.98px) {
  .se-sidebar {
    flex: 0 0 260px;
    width: 260px;
  }
}

/* Mobile: colapsa a 1 columna (sidebar arriba, main abajo) */
@media (max-width: 767.98px) {
  .se-body {
    flex-direction: column;
  }

  .se-sidebar {
    flex: 0 0 auto;
    width: 100%;
    max-height: 38vh;
    border-right: none;
    border-bottom: 1px solid var(--ct-border, #dee2e6);
  }

  .se-main {
    padding: 12px;
  }

  .se-header-paciente {
    width: 100%;
    order: 3;
  }
}

/* Pantallas grandes: centrar el contenido del main */
@media (min-width: 1600px) {
  .se-main {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

@media (min-width: 1920px) {
  .se-main {
    padding-left: 8rem;
    padding-right: 8rem;
  }
}

/* ===================================
   MINI-RESUMEN dentro de .ws-section-body
   (workspace clínico, sección Seguimiento de Enfermería)
   Se inyecta desde seguimientoEnfermeria.js → _cargarSeccionWs()
   tras guardar un seguimiento. Coherente con .ws-monetario-item /
   .ws-empty del workspaceClinico.css.
   =================================== */
.ws-seguimiento-resumen {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 4px;
}

.ws-seguimiento-resumen__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ct-muted, #6b7280);
  line-height: 1.35;
}

.ws-seguimiento-resumen__item > i {
  color: var(--ct-primary, #1a6fc4);
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.ws-seguimiento-resumen__item strong {
  color: var(--ct-header, #1f2937);
  font-weight: 600;
  margin-left: 2px;
}

.ws-seguimiento-resumen__nota {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.75rem;
  color: var(--ct-muted, #6b7280);
  font-style: italic;
  line-height: 1.3;
}

/* Mobile: ajuste suave para no apretar texto */
@media (max-width: 767.98px) {
  .ws-seguimiento-resumen {
    padding: 6px 2px;
    gap: 4px;
  }

  .ws-seguimiento-resumen__item {
    font-size: 0.8rem;
  }
}
