/* ===================================
   DOCUMENTOS DE CONSENTIMIENTO — PANEL FULLSCREEN (lista de espera pabellón)
   Concepto portado de "Adjuntos del tratamiento" (hospitalizado). Prefijo .at-*
   Panel propio #adjuntos-pabellon. Self-contained (no depende de tokens --ct-*).
   =================================== */

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

#adjuntos-pabellon {
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10002; background: #f4f6f9;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
#adjuntos-pabellon.at-activo { transform: translateY(0); }

/* Header */
.at-header {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: #1c2a3a; color: #fff; flex-shrink: 0; flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(28, 42, 58, 0.12);
}
.at-header-title { font-size: 15px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; display: inline-flex; align-items: center; }
.at-header-title > i { color: #5fb3ff; }
.at-header-paciente { font-size: 13px; opacity: 0.85; white-space: nowrap; }
.at-spacer { flex: 1; }
.at-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; }
.at-btn-cerrar:hover { background: rgba(255, 255, 255, 0.25); }

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

.at-sidebar {
  flex: 0 0 320px; width: 320px; display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid #dee2e6; min-height: 0;
}
.at-sidebar-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px;
  background: #f0f4fa; border-bottom: 1px solid #dee2e6;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #6c757d; flex-shrink: 0;
}
.at-sidebar-header > span > i { color: #1a6fc4; }
.at-sidebar-cuerpo { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.at-main { flex: 1; min-width: 0; overflow-y: auto; padding: 16px; background: #fff; }

/* Selector de médico responsable */
.at-medico-wrap { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.at-medico-wrap label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #6c757d; margin: 0; }

/* Aviso de transferencia */
.at-aviso {
  background: #fff3cd; border: 1px solid #ffe69c; border-left: 3px solid #ffc107;
  border-radius: 6px; padding: 8px 10px; font-size: 12px; color: #664d03;
}
.at-aviso > i { color: #997404; margin-right: 4px; }

/* Botón "Agregar documento" */
.at-btn-sidebar {
  background: #198754; color: #fff; border: none; border-radius: 6px; padding: 8px 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;
}
.at-btn-sidebar:hover { background: #157347; }

/* Item de la lista */
.at-item {
  position: relative;
  background: #fff; border: 1px solid #dee2e6;
  border-left: 3px solid #1a6fc4; border-radius: 6px; padding: 8px 32px 8px 10px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.at-item:hover { background: #eef4ff; border-color: #1a6fc4; }
.at-item.activo { background: #eef4ff; border-color: #1a6fc4; box-shadow: 0 1px 3px rgba(26, 111, 196, 0.18); }
.at-item-titulo { font-size: 13px; font-weight: 600; color: #1c2a3a; }
.at-item-titulo > i { color: #1a6fc4; }
.at-item-meta { font-size: 11px; color: #6c757d; margin-top: 3px; }
.at-item-quitar {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; line-height: 1;
  border: none; border-radius: 4px; background: transparent; color: #b00020; cursor: pointer;
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.at-item-quitar:hover { background: #f8d7da; }

/* Toolbar + cuerpo del documento */
.at-doc-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; background: #fff; z-index: 1;
}
.at-doc-titulo { font-size: 16px; font-weight: 700; color: #1c2a3a; }
.at-btn-imprimir {
  background: #1a6fc4; color: #fff; border: none; border-radius: 6px; padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.at-btn-imprimir:hover { background: #14538f; }
.at-doc-cuerpo {
  max-width: 900px; margin: 0 auto; background: #fff; border: 1px solid #dee2e6;
  border-radius: 8px; padding: 8px;
}

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

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