/* ============================================================================
   Anamnesis Remota — componente global (panel inline) · prefijo ar-
   TODO vive dentro de un solo editor Quill. Tono sobrio.
   ========================================================================== */

.ar-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    font-size: 0.88rem;
    color: #1f2937;
}

/* Encabezado (toggle) */
.ar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background .15s ease;
}
.ar-header:hover,
.ar-header:focus { background: #f2f4f7; outline: none; }
.ar-header:focus-visible { box-shadow: inset 0 0 0 2px rgba(26, 111, 196, 0.4); }
.ar-card.ar-collapsed .ar-header { border-bottom: none; }

.ar-header-icono { font-size: 1.15rem; color: #1a6fc4; line-height: 1; flex-shrink: 0; }
.ar-header-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.ar-titulo { margin: 0; font-size: 0.98rem; font-weight: 700; color: #1f2937; }
.ar-meta { font-size: 0.75rem; font-weight: 400; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-meta:empty { display: none; }
.ar-chevron { font-size: 1.3rem; color: #9ca3af; line-height: 1; flex-shrink: 0; margin-left: auto; transition: color .15s ease; }
.ar-header:hover .ar-chevron { color: #6b7280; }

.ar-body { padding: 14px 16px 16px; }
.ar-body[hidden] { display: none; }

/* ── Editor Quill (todo el documento) ───────────────────────────────────────── */
.ar-editor { background: #fff; }
/* Altura acotada + scroll: el documento crece pero el editor no empuja la card.
   Aplica a todas las instancias (ficha, hospitalizado, pabellón). */
.ar-editor .ql-editor {
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto !important;
    font-size: 0.9rem;
    line-height: 1.55;
}
.ar-editor .ql-toolbar.ql-snow,
.ar-editor .ql-container.ql-snow { border-color: #d1d5db; }
.ar-editor .ql-toolbar.ql-snow { border-top-left-radius: 6px; border-top-right-radius: 6px; }
.ar-editor .ql-container.ql-snow { border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
/* El sello (negrita) que separa cada registro se ve con aire */
.ar-editor .ql-editor p strong { color: #1f2937; }

.ar-editor-pie {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ar-btn-agregar {
    background: #1a6fc4;
    color: #fff;
    border: 1px solid #1a6fc4;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.ar-btn-agregar:hover,
.ar-btn-agregar:focus { background: #145390; border-color: #145390; outline: none; box-shadow: 0 2px 6px -1px rgba(20, 83, 144, 0.35); }
.ar-btn-agregar:disabled,
.ar-btn-agregar[disabled] { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.ar-btn-agregar .mdi { font-size: 1rem; line-height: 1; }

.ar-btn-versiones {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    background: #eef2f7;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    margin-right: auto;   /* Guardar queda a la derecha */
    transition: background .15s ease, box-shadow .15s ease;
}
.ar-btn-versiones:hover,
.ar-btn-versiones:focus { background: #e2e8f2; outline: none; box-shadow: 0 1px 4px -1px rgba(71, 85, 105, .3); }
.ar-btn-versiones .mdi { font-size: 0.95rem; }

/* Botones solo-ícono: Imprimir / Enviar al tutor */
.ar-btn-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #1a6fc4;
    background: #fff;
    border: 1px solid #c9d8f5;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, box-shadow .15s ease;
}
.ar-btn-ico:hover,
.ar-btn-ico:focus { background: #eef4ff; outline: none; box-shadow: 0 1px 4px -1px rgba(26, 111, 196, .3); }
.ar-btn-ico .mdi { font-size: 1.1rem; line-height: 1; }

/* En pantallas chicas los botones del pie envuelven ordenadamente */
@media (max-width: 640px) {
    .ar-editor-pie { flex-wrap: wrap; }
    .ar-btn-versiones { margin-right: 0; }
}

/* ── Visor de versiones (Swal) ──────────────────────────────────────────────── */
.ar-vers-list { text-align: left; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.ar-vers-vacio { color: #9ca3af; font-size: 0.85rem; text-align: center; padding: 16px 0; }
.ar-vers-item {
    border: 1px solid #e5e7eb;
    border-left: 3px solid #cbd5e1;
    border-radius: 8px;
    background: #fcfcfd;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.ar-vers-meta { font-size: 0.72rem; color: #6b7280; margin-bottom: 6px; }
.ar-vers-cuerpo { font-size: 0.82rem; line-height: 1.45; color: #374151; word-break: break-word; }
.ar-vers-cuerpo p { margin: 0 0 4px; }
.ar-vers-cuerpo p:last-child { margin-bottom: 0; }

/* Responsive */
@media (max-width: 575px) {
    .ar-editor .ql-editor { min-height: 160px; max-height: 260px; }
}
