/* ===================================
   EVOLUCIÓN CLÍNICA — FULLSCREEN (workspace hospitalizado)
   Panel paralelo a #workspace-clinico / #seguimiento-enfermeria.
   Reutiliza tokens --ct-* del módulo hospitalizado. Prefijo .ec-*
   =================================== */

.ec-panel-abierto .swal2-container { z-index: 10003 !important; }

/* ── Panel ─────────────────────────────────────────────────────────────── */
#evolucion-clinica {
  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;
}
#evolucion-clinica.ec-activo { transform: translateY(0); }

/* ── Header ────────────────────────────────────────────────────────────── */
.ec-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);
}
.ec-header-title { font-size: 15px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; display: inline-flex; align-items: center; }
.ec-header-title > i { color: #5fb3ff; }
.ec-header-paciente { font-size: 13px; opacity: 0.85; white-space: nowrap; }
.ec-spacer { flex: 1; }
.ec-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;
}
.ec-btn-cerrar:hover { background: rgba(255, 255, 255, 0.25); }

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

.ec-sidebar {
  flex: 0 0 460px; width: 460px;
  display: flex; flex-direction: column;
  background: var(--ct-card-bg, #fff);
  border-right: 1px solid var(--ct-border, #dee2e6);
  min-height: 0;
}
.ec-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;
}
.ec-sidebar-header > span > i { color: var(--ct-primary, #1a6fc4); }
.ec-sidebar-cuerpo { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

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

/* ── Botón "Imprimir todas" en el sidebar ──────────────────────────────── */
.ec-btn-sidebar {
  background: #1a6fc4; color: #fff; border: none; border-radius: 6px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; width: 100%; justify-content: center; margin-bottom: 4px;
}
.ec-btn-sidebar:hover { background: #14538f; }
.ec-btn-sidebar--nueva { background: #198754; }
.ec-btn-sidebar--nueva:hover { background: #146c43; }

/* ── Item del timeline (tarjeta clickeable) ────────────────────────────── */
.ec-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, box-shadow 0.15s;
}
.ec-timeline-item:hover { background: #f5f9ff; border-color: #b9d4f0; }
.ec-timeline-item:focus-visible { outline: 2px solid var(--ct-primary, #1a6fc4); outline-offset: 1px; }
.ec-timeline-item.activo {
  background: #eef4ff; border-color: var(--ct-primary, #1a6fc4);
  box-shadow: inset 3px 0 0 var(--ct-primary, #1a6fc4);
}
.ec-item-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 3px; color: #1c2a3a; }
.ec-item-perfil { font-size: 10px; color: #6c757d; text-transform: uppercase; letter-spacing: 0.3px; }
.ec-item-autor { font-size: 11px; color: #6c757d; }
.ec-badge-editado {
  display: inline-block; background: #fff3cd; color: #856404; border: 1px solid #ffeeba;
  border-radius: 10px; padding: 1px 7px; font-size: 10px; font-weight: 700; margin-left: 4px;
}
.ec-item-nota {
  margin-top: 5px; font-size: 12px; color: #1c2a3a; line-height: 1.4;
  border: 1px solid #eef2f7; border-radius: 5px; padding: 6px 8px; background: #fafbfc;
}
.ec-item-nota p { margin: 0 0 4px; }
/* Vista previa en el sidebar: recortada a 3 líneas (la lectura va en el main). */
.ec-item-nota--preview {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Botones de acción (vista de lectura en el main) ───────────────────── */
.ec-mini-btn {
  border: 1px solid #cdd5df; background: #fff; color: #1a6fc4; border-radius: 5px;
  padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.ec-mini-btn:hover { background: #eef4ff; }
.ec-mini-btn--print { color: #475569; }

/* ── Vista de lectura de una nota en el main ───────────────────────────── */
.ec-lectura-card {
  background: var(--ct-card-bg, #fff); border: 1px solid var(--ct-border, #dee2e6);
  border-radius: 8px; padding: 16px 20px; max-width: 1000px; margin: 0 auto;
}
.ec-lectura-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0;
}
.ec-lectura-fecha { font-size: 18px; color: #1c2a3a; font-weight: 700; }
.ec-lectura-autor { font-size: 12px; color: #6c757d; margin-top: 2px; }
.ec-lectura-autor > i { color: var(--ct-primary, #1a6fc4); }
.ec-lectura-editado { color: #856404; margin-left: 4px; }
.ec-lectura-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.ec-lectura-cuerpo { font-size: 15px; line-height: 1.7; color: #1c2a3a; overflow-wrap: anywhere; word-break: break-word; }
.ec-lectura-cuerpo p { margin: 0 0 10px; }

/* ── Card del formulario (editor) ──────────────────────────────────────── */
.ec-form-card {
  background: var(--ct-card-bg, #fff); border: 1px solid var(--ct-border, #dee2e6);
  border-radius: 8px; padding: 16px; max-width: 1000px; margin: 0 auto;
}
.ec-form-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; }
.ec-form-kicker { font-size: 11px; color: #6c757d; text-transform: uppercase; font-weight: 700; letter-spacing: 0.4px; }
.ec-form-title { font-size: 17px; color: #1c2a3a; font-weight: 700; }
.ec-edit-banner { font-size: 12px; color: #856404; background: #fff3cd; border: 1px solid #ffeeba; border-radius: 6px; padding: 6px 10px; }
.ec-link-cancel { background: none; border: none; color: #1a6fc4; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0 0 0 6px; font-size: 12px; }
.ec-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid #e2e8f0; }
.ec-btn-guardar {
  background: #198754; color: #fff; border: none; border-radius: 6px;
  padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.ec-btn-guardar:disabled { opacity: 0.7; cursor: default; }

/* ── Spinner / vacío ───────────────────────────────────────────────────── */
.ec-spinner-wrap { display: flex; align-items: center; justify-content: center; padding: 30px; gap: 10px; color: var(--ct-muted, #6c757d); font-size: 14px; }
.ec-vacio { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; color: var(--ct-muted, #6c757d); }
.ec-vacio-icon { font-size: 48px; color: #c5d3e3; margin-bottom: 10px; }
.ec-vacio-texto { font-size: 13px; margin: 0; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) { .ec-sidebar { flex: 0 0 380px; width: 380px; } }
@media (max-width: 767.98px) {
  .ec-body { flex-direction: column; }
  .ec-sidebar { flex: 0 0 auto; width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--ct-border, #dee2e6); }
  .ec-main { padding: 12px; }
  .ec-header-paciente { width: 100%; order: 3; }
}

/* ===================================
   MINI-RESUMEN dentro de .ws-section-body (card del workspace)
   =================================== */
.ws-evolucion-resumen { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; }
.ws-evolucion-resumen__item { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ct-muted, #6b7280); line-height: 1.35; }
.ws-evolucion-resumen__item > i { color: var(--ct-primary, #1a6fc4); font-size: 0.9rem; flex-shrink: 0; width: 14px; text-align: center; }
.ws-evolucion-resumen__item strong { color: var(--ct-header, #1f2937); font-weight: 600; margin-left: 2px; }
.ws-evolucion-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; }
