/* ===== Historias Clínicas — estética heredada del SISPA, modernizada ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    background: #e8eaed;
    color: #222;
}

/* ---------- LOGIN (réplica del form INI) ---------- */
body.login-body {
    background: linear-gradient(135deg, #143c6b 0%, #2a7fb8 48%, #34c3a6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 380px;
    max-width: 94vw;
    background: rgba(255,255,255,.97);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,.4);
    padding: 30px 30px 34px;
    text-align: center;
    animation: aparecer .4s ease-out;
}
@keyframes aparecer { from { opacity: 0; transform: translateY(16px) scale(.98);} to { opacity: 1; transform: none; } }
.login-logo-wrap {
    width: 138px; height: 138px; margin: 0 auto 14px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 6px 22px rgba(20,60,107,.28);
    border: 4px solid #eaf3ff;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.login-logo { width: 100%; height: 100%; object-fit: contain; }
.login-marca .sisp {
    font-family: "Segoe UI", Arial, sans-serif; font-weight: 800;
    font-size: 34px; color: #1a4e8a; letter-spacing: .5px; line-height: 1.05;
}
.login-marca .sub { font-size: 12.5px; color: #5a7391; margin-top: 3px; }
.login-lic {
    margin: 16px auto 20px; font-size: 12.5px; color: #5a7391; line-height: 1.5;
    border-top: 1px solid #e6ecf3; border-bottom: 1px solid #e6ecf3; padding: 10px 0;
}
.login-lic b { display: block; color: #1a4e8a; font-size: 13.5px; margin-top: 2px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { font-size: 13px; font-weight: 600; color: #33506e; text-align: left; }
.login-form input[type=password] {
    height: 48px; border: 2px solid #c9d6e5; border-radius: 12px;
    text-align: center; letter-spacing: 6px; font-size: 18px; color: #1a4e8a;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-form input[type=password]:focus { border-color: #2a7fb8; box-shadow: 0 0 0 4px rgba(42,127,184,.18); }
.login-btn {
    height: 48px; border: none; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, #1a4e8a, #2a7fb8); color: #fff;
    font-size: 15px; font-weight: 700; letter-spacing: .3px; margin-top: 2px;
    box-shadow: 0 8px 20px rgba(26,78,138,.35); transition: transform .1s, box-shadow .15s;
}
.login-btn:hover { box-shadow: 0 12px 28px rgba(26,78,138,.48); }
.login-btn:active { transform: translateY(1px); }
.btn {
    height: 34px; padding: 0 18px;
    font-weight: bold; font-size: 14px;
    border: 1px solid #888; border-radius: 6px;
    background: linear-gradient(#fdfdfd, #d7d7d7);
    cursor: pointer;
}
.btn:hover { background: linear-gradient(#fff, #e6e6e6); }
.btn:active { transform: translateY(1px); }
.btn-aceptar { color: #c00; }
.btn-cancelar { color: #00c; }
.login-error {
    margin: 10px auto 0;
    max-width: 420px;
    background: #fff3f3;
    border: 1px solid #d33;
    color: #a00;
    font-weight: bold;
    text-align: center;
    border-radius: 6px;
    padding: 8px 10px;
}
.login-bienvenida {
    color: #f33;
    background: #dff;
    border-radius: 4px;
    text-align: center;
    font-family: Georgia, serif;
    font-weight: bold;
    padding: 5px;
    margin: 0 18px 8px;
}

/* ---------- PANTALLA PRINCIPAL (TAPIZ + Barra11) ---------- */
.principal {
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.barra {
    display: flex;
    align-items: stretch;
    justify-content: safe center;   /* menú centrado; si no entra, alinea al inicio */
    gap: 2px;
    background: linear-gradient(#fbfbfb, #dfe3e8);
    border-bottom: 1px solid #b6bcc4;
    padding: 4px 6px;
    overflow-x: auto;
    flex-shrink: 0;
}
.barra .sep {
    width: 1px;
    background: #b9bfc7;
    margin: 4px 5px;
    flex-shrink: 0;
}
.boton-barra {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 64px;
    padding: 5px 7px 4px;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: #222;
    font-size: 11.5px;
    flex-shrink: 0;
}
.boton-barra img { width: 32px; height: 32px; object-fit: contain; transition: transform .15s; }
.boton-barra:not(.deshabilitado):hover img { transform: translateY(-2px) scale(1.08); }
.boton-barra.deshabilitado img { filter: grayscale(1) opacity(.55); }
.boton-barra:not(.deshabilitado):hover {
    border-color: #9db8d8;
    background: linear-gradient(#f4f9ff, #dcebff);
}
.boton-barra.deshabilitado {
    filter: grayscale(1);
    opacity: .38;
    pointer-events: none;
}
.boton-barra.activo {
    border-color: #7fa7d1;
    background: linear-gradient(#e8f2ff, #cfe3fb);
}
.tapiz {
    flex: 1;
    background: url('../img/fondo_estetoscopio.jpg') center / cover no-repeat #2f7ef0;
    position: relative;
    overflow: auto;
}
.contenido {
    background: rgba(255,255,255,.94);
    border: 1px solid #c6ccd4;
    border-radius: 10px;
    margin: 26px auto;
    padding: 26px 30px;
    max-width: 900px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
}
.estado {
    flex-shrink: 0;
    background: linear-gradient(#eceff3, #d8dde3);
    border-top: 1px solid #b6bcc4;
    padding: 5px 14px;
    font-size: 12px;
    color: #333;
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
}
.estado b { color: #06c; }

/* Barra de progreso de bienvenida (Timer1 + Shape3 del INI) */
.progreso-wrap {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.86);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 18px;
    z-index: 50;
}
.progreso-texto {
    color: #f55;
    background: #dff;
    font-family: Georgia, serif;
    font-weight: bold;
    font-size: 18px;
    padding: 6px 22px;
    border-radius: 4px;
}
.progreso-barra {
    width: 470px; max-width: 85vw; height: 16px;
    background: #222;
    border: 1px solid #555;
    border-radius: 8px;
    overflow: hidden;
}
.progreso-relleno {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #0a64c8, #64c8ff);
    transition: width .04s linear;
}

/* Módulo en construcción */
.modulo-titulo {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 10px;
}
.modulo-titulo img { width: 40px; height: 40px; }
.en-construccion { color: #666; font-style: italic; }

/* ---------- Módulo Pacientes ---------- */
.contenido-ancho { max-width: 1200px; }
.fila-acciones { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.btn-verde { color: #070; text-decoration: none; display: inline-flex; align-items: center; }
.btn-azul { color: #00c; }
.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.aviso-ok { background: #ebfaeb; border: 1px solid #2a2; color: #060; font-weight: bold; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }
.aviso-error { background: #fff0f0; border: 1px solid #d33; color: #a00; font-weight: bold; padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }
.subtitulo { font-size: 15px; color: #1a4e8a; border-bottom: 2px solid #9db8d8; padding-bottom: 4px; margin: 14px 0 8px; }
.tabla-scroll { max-height: 55vh; overflow: auto; border: 1px solid #b6bcc4; border-radius: 6px; }
.tabla-indice { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla-indice th {
    position: sticky; top: 0;
    background: linear-gradient(#f2f5f9, #dce3ea);
    border-bottom: 1px solid #b6bcc4;
    padding: 7px 10px; text-align: left; font-size: 12px; color: #1a4e8a;
}
.tabla-indice td { padding: 6px 10px; border-bottom: 1px solid #e4e8ee; white-space: nowrap; }
.tabla-indice tbody tr { cursor: pointer; }
.tabla-indice tbody tr:hover { background: #eaf3ff; }
.tabla-indice tbody tr:nth-child(even) { background: #f7f9fc; }
.tabla-indice tbody tr:nth-child(even):hover { background: #eaf3ff; }
.total-lista { font-size: 13px; color: #444; }

/* Ficha */
.grupo-campos { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.campo { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px; min-width: 150px; }
.campo.c-chico { flex: 0 1 160px; }
.campo.c-mini { flex: 0 1 80px; min-width: 70px; }
.campo.c-grande { flex: 2 1 340px; }
.campo label { font-size: 11.5px; font-weight: 600; color: #33506e; }
.campo input, .campo select {
    height: 32px; padding: 0 8px;
    border: 1px solid #aab4c0; border-radius: 5px;
    font-size: 13px; font-weight: 600; color: #123;
}
.campo input:focus { outline: none; box-shadow: 0 0 0 3px rgba(80,140,255,.35); border-color: #4a90d9; }
.solo-lectura, input.solo-lectura { background: #eef1f4; color: #567; }
.marco { border: 1px solid #b9c4d1; border-radius: 8px; padding: 10px 12px 4px; margin: 0 0 12px; }
.marco legend { font-size: 12px; font-weight: bold; color: #1a4e8a; padding: 0 6px; }
.pestanias { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 2px solid #9db8d8; }
.pestania {
    border: 1px solid #b6bcc4; border-bottom: none;
    border-radius: 7px 7px 0 0;
    background: linear-gradient(#f5f7fa, #e2e7ee);
    padding: 7px 18px; font-size: 13px; font-weight: 600; cursor: pointer; color: #456;
}
.pestania.activa { background: #fff; color: #1a4e8a; border-color: #9db8d8; position: relative; top: 2px; }
.tab.oculta { display: none; }

/* Select2 acorde al formulario */
.select2-container .select2-selection--single { height: 32px; border: 1px solid #aab4c0; border-radius: 5px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 30px; font-size: 13px; font-weight: 600; color: #123; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 30px; }
/* El panel desplegable NO se limita al ancho del campo: en columnas angostas
   las opciones salían cortadas ("Api…", "Ext…"). Así se leen completas en
   TODAS las pantallas del sistema. */
.select2-dropdown { min-width: 300px !important; }
.select2-results__option { white-space: normal; word-break: break-word; }

/* ---------- Módulo Ambulatorio ---------- */
.cabecera-paciente {
    display: flex; gap: 22px; flex-wrap: wrap;
    background: linear-gradient(#eef4fb, #dce8f5);
    border: 1px solid #9db8d8; border-radius: 8px;
    padding: 9px 14px; margin-bottom: 12px; font-size: 13px;
}
.cabecera-paciente span { color: #33506e; font-size: 11.5px; font-weight: 600; }
.cabecera-paciente b { color: #0a3d7a; }
.campo textarea {
    padding: 6px 8px;
    border: 1px solid #aab4c0; border-radius: 5px;
    font-size: 13px; font-weight: 600; color: #123;
    font-family: inherit; resize: vertical;
}
.campo textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(80,140,255,.35); border-color: #4a90d9; }
.grupo-checks {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px 16px; margin-bottom: 12px;
    border: 1px solid #b9c4d1; border-radius: 8px; padding: 12px;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #234; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: #1a4e8a; }
.ayuda { font-size: 12px; color: #667; font-style: italic; margin: 2px 0 8px; }

/* ---------- Historia Clínica: línea de tiempo ---------- */
.linea-tiempo { position: relative; padding-left: 8px; }
.linea-tiempo::before {
    content: ''; position: absolute; left: 86px; top: 0; bottom: 0;
    width: 3px; background: #c9d6e5; border-radius: 2px;
}
.lt-anio {
    position: relative; z-index: 1;
    display: inline-block; margin: 10px 0 6px 56px;
    background: #1a4e8a; color: #fff;
    font-weight: bold; font-size: 13px;
    padding: 3px 16px; border-radius: 14px;
}
.lt-evento {
    position: relative; display: flex; align-items: flex-start; gap: 10px;
    margin: 0 0 6px; cursor: pointer; border-radius: 8px; padding: 5px 6px;
}
.lt-evento:hover { background: #eaf3ff; }
.lt-fecha { width: 46px; text-align: right; font-size: 11.5px; font-weight: bold; color: #456; padding-top: 6px; flex-shrink: 0; }
.lt-punto {
    position: relative; z-index: 1;
    width: 34px; height: 34px; flex-shrink: 0;
    background: #fff; border: 2px solid #9db8d8; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.lt-cuerpo { padding-top: 2px; min-width: 0; }
.lt-titulo { font-size: 13px; font-weight: bold; color: #123; }
.lt-detalle { font-size: 12px; color: #567; }
.lt-receta .lt-punto { border-color: #67ab6b; }
.lt-laboratorio .lt-punto { border-color: #b08fd8; }
.lt-imagen .lt-punto { border-color: #d8a05f; }
.lt-ingreso .lt-punto, .lt-egreso .lt-punto { border-color: #d87f7f; }
.lt-turno .lt-punto { border-color: #7fb0d8; }
/* Orden de laboratorio impresa: grupos por categoría */
.grupos-imprimir { columns: 2; column-gap: 5mm; }
.grupo-imprimir { break-inside: avoid; margin-bottom: 2.5mm; border: 1px solid #c9d3df; border-radius: 2mm; padding: 1mm 2mm 1.5mm; }
.grupo-titulo {
    background: #1a4e8a; color: #fff;
    font-size: 8.5px; font-weight: bold; letter-spacing: .5px;
    border-radius: 1.5mm; padding: .8mm 2.5mm; margin-bottom: 1mm;
    display: inline-block;
}
.grupo-imprimir .med-linea { border-bottom: 1px dotted #d5dce4; font-size: 9.5px; padding: .8mm 0; display: block; }
.grupo-imprimir .med-linea:last-child { border-bottom: none; }
.casilla { font-size: 11px; }
@media print { .grupo-titulo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* Acciones rápidas por fila en el índice de pacientes */
.acciones-fila { white-space: nowrap; }
.acciones-fila a { text-decoration: none; font-size: 17px; padding: 2px 5px; border-radius: 5px; }
.acciones-fila a:hover { background: #d6e6fb; }
.tab-hoja.oculta { display: none; }
.pestanias-hojas .pestania { font-size: 14px; padding: 8px 26px; }

/* Modal (administración de usuarios) */
.modal-fondo { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-caja { background: #fff; border-radius: 12px; padding: 22px 26px; min-width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal-caja .subtitulo { margin-top: 0; }
.acciones-fila form { margin: 0; }

/* ================= RECETARIO estilo membrete del médico ================= */
body.pagina-imprimir { background: #9aa2ab; }
.rx-hoja {
    width: 210mm; min-height: 148mm;         /* mitad superior de A4 */
    margin: 14px auto; padding: 4mm 2mm;
    background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.35);
    display: flex; gap: 0;
}
.rx-mitad {
    flex: 1; position: relative;
    padding: 2mm 3mm;
    display: flex; flex-direction: column;
    min-width: 0;
}
.rx-mitad::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: url('../img/fondo_caduceo.png') center 58% / 40mm no-repeat;
    opacity: .18;                      /* marca de agua más tenue */
    pointer-events: none;
}
.rx-membrete, .rx-paciente, .rx-cuerpo, .rx-firma { position: relative; z-index: 1; }
.rx-corte {
    width: 8mm; flex-shrink: 0; position: relative;
    display: flex; align-items: center; justify-content: center;
    color: #999;
}
.rx-corte::before {
    content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
    border-left: 2px dashed #b0b0b0;
}
.rx-corte span { position: relative; background: #fff; padding: 1mm 0; }
.rx-corte span { transform: rotate(0deg); font-size: 13px; }

/* Membrete */
.rx-membrete {
    display: flex; align-items: center; gap: 3mm;
    border: 1.5px solid #d8b44a;
    background: linear-gradient(#fffdf3, #fbf0c9);
    border-radius: 3mm; padding: 2mm 3mm;
}
.rx-logo { width: 13mm; height: 13mm; object-fit: contain; }
.rx-datos-medico { flex: 1; text-align: center; line-height: 1.2; }
.rx-nombre { font-family: Georgia, serif; font-weight: bold; font-size: 14px; color: #1a3a6b; }
.rx-credencial { font-size: 7px; color: #555; letter-spacing: .3px; text-transform: uppercase; }
.rx-hospital { font-weight: bold; font-size: 9.5px; color: #b8352f; margin-top: .5mm; }
.rx-contacto { font-size: 7.5px; color: #444; }
.rx-ciudad { font-size: 7.5px; color: #444; font-weight: bold; }

/* Datos del paciente */
.rx-paciente { margin: 3mm 0 2mm; font-size: 10.5px; }
.rx-paciente span { color: #555; font-size: 9.5px; }
.rx-paciente > div { border-bottom: 1px dotted #999; padding: 1mm 0; }

/* Cuerpo Rp / Indicaciones */
.rx-cuerpo { flex: 1; position: relative; z-index: 1; }
.rx-rp { font-family: Georgia, serif; font-size: 20px; font-weight: bold; color: #1a3a6b; margin: 1mm 0 2mm; }
.rx-lista { margin: 0; padding-left: 6mm; }
.rx-lista li { margin-bottom: 2mm; font-size: 10.5px; }
.rx-med { }
.rx-cant { color: #b8352f; font-weight: bold; white-space: nowrap; margin-left: 4px; }
.rx-indica { font-size: 9.5px; color: #234; }
.rx-poso { font-size: 8.5px; color: #567; font-style: italic; }
.rx-obs { font-size: 9px; margin-top: 2mm; }

/* Firma */
.rx-firma { margin-top: auto; display: flex; justify-content: center; padding-top: 8mm; }
.rx-linea-firma { border-top: 1px solid #333; padding-top: 1mm; font-size: 9.5px; font-weight: bold; text-align: center; min-width: 55mm; }

.no-imprimir { text-align: center; margin: 14px 0; display: flex; gap: 10px; justify-content: center; }
@media print {
    @page { size: A4 portrait; margin: 0; }
    body.pagina-imprimir { background: #fff; }
    .no-imprimir { display: none; }
    .rx-hoja { width: 210mm; margin: 0; box-shadow: none; }
    .rx-membrete { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Editor de membrete */
.membrete-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.membrete-form .campo { margin-bottom: 10px; }
.membrete-preview { position: sticky; top: 10px; }
.preview-titulo { font-size: 12px; font-weight: bold; color: #1a4e8a; margin-bottom: 8px; letter-spacing: 1px; }
.membrete-preview .rx-membrete { display: flex; align-items: center; gap: 3mm; border: 1.5px solid #d8b44a; background: linear-gradient(#fffdf3, #fbf0c9); border-radius: 3mm; padding: 2mm 3mm; }
.membrete-preview .rx-logo { width: 15mm; height: 15mm; object-fit: contain; }
.membrete-preview .rx-datos-medico { flex: 1; text-align: center; line-height: 1.25; }
.membrete-preview .rx-nombre { font-family: Georgia, serif; font-weight: bold; font-size: 16px; color: #1a3a6b; }
.membrete-preview .rx-credencial { font-size: 8px; color: #555; text-transform: uppercase; }
.membrete-preview .rx-hospital { font-weight: bold; font-size: 11px; color: #b8352f; margin-top: 1mm; }
.membrete-preview .rx-contacto { font-size: 9px; color: #444; }
.membrete-preview .rx-ciudad { font-size: 9px; color: #444; font-weight: bold; }
@media (max-width: 800px) { .membrete-editor { grid-template-columns: 1fr; } }

/* ================= CERTIFICADO MÉDICO — hoja completa con membrete ================= */
.cert-hoja {
    width: 210mm; min-height: 297mm;
    margin: 14px auto; padding: 22mm 24mm 18mm;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,.35);
    position: relative;
    font-family: Georgia, 'Times New Roman', serif;
    color: #1a2a3a;
    overflow: hidden;
}
.cert-hoja::before {                 /* caduceo con alas, tono dorado, marca de agua */
    content: ''; position: absolute; left: 50%; top: 52%;
    width: 120mm; height: 150mm; transform: translate(-50%, -50%);
    background: url('../img/caduceo_dorado.jpeg') center / contain no-repeat;
    opacity: .38; z-index: 0; pointer-events: none;
}
.cert-hoja > * { position: relative; z-index: 1; }
.cert-cabecera { display: flex; align-items: center; justify-content: center; gap: 6mm; }
.cert-logo { width: 20mm; height: 20mm; object-fit: contain; }
.cert-cab-texto { text-align: center; }
.cert-hospital { font-size: 21px; font-weight: bold; color: #6f93c4; letter-spacing: .5px; }
.cert-ruc { font-size: 10px; color: #555; }
.cert-lugar { font-size: 10px; color: #555; }
.cert-fecha { text-align: right; font-size: 12px; font-style: italic; margin: 16mm 0 10mm; color: #8a2b2b; }
.cert-titulo { text-align: center; font-size: 20px; font-style: italic; font-weight: bold; letter-spacing: 1px; margin: 0 0 12mm; }
.cert-cuerpo { font-size: 13px; line-height: 1.9; position: relative; z-index: 1; }
.cert-cuerpo p { margin: 0 0 6mm; text-align: justify; }
.cert-atte { margin-top: 8mm !important; }
.cert-firma { margin-top: 22mm; }
.cert-firma-nombre { font-size: 13px; font-weight: bold; font-style: italic; color: #2e5c9a; }
.cert-firma-cred { font-size: 12px; font-weight: bold; }
.cert-firma-linea { font-size: 11px; }
.cert-pie {
    position: absolute; left: 24mm; right: 24mm; bottom: 12mm;
    border-top: 1px solid #c9a24a; padding-top: 2mm;
    font-size: 9.5px; color: #555; text-align: center;
}
@media print {
    @page { size: A4 portrait; margin: 0; }
    body.pagina-imprimir { background: #fff; }
    .no-imprimir { display: none; }
    .cert-hoja { margin: 0; box-shadow: none; }
}

/* ================= MÓDULO FORMULARIOS (hojas oficiales) ================= */
/* índice */
.grid-formularios { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 14px; opacity: .5; pointer-events: none; }
.grid-formularios.activo { opacity: 1; pointer-events: auto; }
.tarjeta-form { border: 1px solid #b9c4d1; border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; background: linear-gradient(#fbfcfe,#eef2f7); }
.tarjeta-form:hover { border-color: #4a90d9; box-shadow: 0 4px 14px rgba(74,144,217,.25); }
.tf-icono { font-size: 34px; }
.tf-nombre { font-weight: bold; font-size: 13px; color: #1a4e8a; margin-top: 4px; }
.tf-codigo { font-size: 11px; color: #667; }

/* hoja imprimible */
body.pagina-form { background: #9aa2ab; }
.fm-hoja {
    width: 210mm; min-height: 297mm; margin: 12px auto; padding: 8mm 10mm;
    background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.35);
    font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000;
    break-after: page;
}
/* cada FORMULARIO como bloque; en doble cara empieza al frente de una hoja nueva */
.fm-form { break-before: page; }
.fm-form:first-child { break-before: auto; }
body.doble-cara .fm-form { break-before: right; }
.fm-titulo-hospital { text-align: center; font-family: Georgia, serif; font-weight: bold; font-size: 18px; letter-spacing: 1px; margin-bottom: 3mm; }
.fm-encabezado { width: 100%; border-collapse: collapse; margin-bottom: 3mm; }
.fm-encabezado th { background: #d9d9d9; border: 1px solid #000; font-size: 8px; padding: 1mm; }
.fm-encabezado td { border: 1px solid #000; padding: 1.5mm; font-weight: bold; font-size: 11px; }
.fm-encabezado td.c { text-align: center; }
.fm-nhc { font-size: 15px !important; }

/* secciones tipo formulario MSP (barra amarilla) */
.fm-seccion { background: #ffff00; border: 1px solid #000; font-weight: bold; font-size: 10px; padding: 1mm 2mm; margin: 2mm 0 0; }
.fm-bloque { border: 1px solid #000; border-top: none; padding: 2mm; min-height: 12mm; }
.fm-campo-linea { display: flex; border-bottom: 1px solid #000; padding: 1mm 0; }
.fm-campo-linea .et { font-weight: bold; margin-right: 3mm; white-space: nowrap; }
.fm-tabla { width: 100%; border-collapse: collapse; }
.fm-tabla th, .fm-tabla td { border: 1px solid #000; padding: 1mm 1.5mm; font-size: 9.5px; vertical-align: top; }
.fm-tabla th { background: #eee; font-size: 8px; }
.fm-fila-signos { display: flex; gap: 0; }
.fm-fila-signos > div { flex: 1; border: 1px solid #000; border-left: none; padding: 1mm; }
.fm-fila-signos > div:first-child { border-left: 1px solid #000; }
.fm-fila-signos .et { font-size: 7.5px; font-weight: bold; color: #333; display: block; }
.fm-fila-signos .val { font-size: 12px; font-weight: bold; }
.fm-dato { min-height: 5mm; padding: 1mm 0; }
.fm-pie { display: flex; justify-content: space-between; font-size: 8px; margin-top: 2mm; border-top: 1px solid #000; padding-top: 1mm; }
.fm-barra-acciones {
    position: fixed; bottom: 18px; right: 18px; z-index: 300;
    display: flex; gap: 8px; align-items: center;
    background: rgba(255,255,255,.96); padding: 8px 12px;
    border: 1px solid #b9c4d1; border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.fm-nota { font-size: 8px; color: #444; font-style: italic; }
@media print {
    @page { size: A4 portrait; margin: 0; }
    body.pagina-form { background: #fff; }
    .fm-barra-acciones { display: none; }
    .fm-hoja { margin: 0; box-shadow: none; }
    .fm-seccion { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .fm-encabezado th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Barra de filtros de la línea de tiempo (todos los chips juntos) */
.barra-filtros {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: linear-gradient(#f4f7fb, #e8eef6);
    border: 1px solid #c3cfdd; border-radius: 10px;
    padding: 8px 12px; margin-bottom: 14px;
}
.bf-titulo { font-size: 11px; font-weight: bold; color: #1a4e8a; letter-spacing: .5px; margin-right: 4px; }
.filtro-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #c3cfdd; border-radius: 20px;
    padding: 4px 12px; font-size: 12px; font-weight: 600; color: #234; cursor: pointer;
    white-space: nowrap;
}
.filtro-chip:hover { border-color: #4a90d9; background: #f0f7ff; }
.filtro-chip input { width: 15px; height: 15px; accent-color: #1a4e8a; }

/* ===== Hoja media (orden de laboratorio, RX, informes) — restauradas ===== */
.hoja-doble {
    width: 210mm; min-height: 148mm; margin: 14px auto; padding: 8mm 10mm;
    background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.35);
    display: flex; gap: 0;
}
.receta-media { flex: 1; padding: 2mm 4mm; display: flex; flex-direction: column; min-width: 0; }
.receta-cabecera { display: flex; align-items: center; gap: 4mm; border-bottom: 3px double #1a4e8a; padding-bottom: 2mm; }
.receta-cabecera img { width: 16mm; height: 16mm; object-fit: contain; flex-shrink: 0; }
.receta-titulos { flex: 1; text-align: center; }
.receta-titulos h1 { margin: 0; font-size: 15px; color: #1a4e8a; }
.receta-titulos h2 { margin: 1px 0 0; font-size: 11px; letter-spacing: 2px; color: #444; }
.receta-numero { text-align: right; font-size: 10.5px; }
.receta-numero b { color: #c00; font-size: 13px; }
.receta-datos { display: flex; gap: 10px; flex-wrap: wrap; font-size: 10.5px; margin: 2mm 0; }
.receta-datos span { color: #555; font-size: 9.5px; }
.receta-items { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.receta-items th { border: 1px solid #000; background: #eee; text-align: left; padding: 1.2mm 2mm; font-size: 9px; color: #1a4e8a; }
.receta-items td { border: 1px solid #000; padding: 1.4mm 2mm; vertical-align: top; }
.receta-items .centro { text-align: center; }
.linea-corte { width: 8mm; flex-shrink: 0; position: relative; display: flex; align-items: center; justify-content: center; color: #999; }
.linea-corte::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px dashed #b0b0b0; }
.linea-corte span { position: relative; background: #fff; padding: 1mm 0; }
.media-libre { flex: 1; }
.receta-firma { margin-top: auto; display: flex; justify-content: center; padding-top: 8mm; }
.linea-firma { border-top: 1px solid #333; padding-top: 1.5mm; text-align: center; font-size: 10px; font-weight: bold; min-width: 60mm; }
.linea-firma small { font-weight: normal; color: #666; font-size: 8.5px; }
@media print {
    .hoja-doble { width: 210mm; margin: 0; box-shadow: none; }
}

/* ===== Hoja de exámenes de laboratorio (marcar con X) — RESTAURADA ===== */
.barra-pegajosa { position: sticky; top: 0; background: rgba(255,255,255,.97); z-index: 5; padding: 8px 0; border-bottom: 1px solid #d0d6dd; }
.hoja-examenes { column-width: 240px; column-gap: 12px; }
.cat-examenes {
    border: 1px solid #b9c4d1; border-radius: 8px;
    padding: 6px 10px 8px; margin: 0 0 12px;
    background: #fbfcfe;
    break-inside: avoid;
    display: inline-block; width: 100%;
}
.cat-examenes legend { font-size: 11.5px; font-weight: bold; color: #fff; background: #1a4e8a; border-radius: 4px; padding: 2px 10px; }
.examen-item {
    display: flex; align-items: flex-start; gap: 7px;
    font-size: 11.5px; line-height: 1.25; padding: 3px;
    cursor: pointer; border-radius: 4px;
}
.examen-item span { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.examen-item input { width: 15px; height: 15px; accent-color: #1a4e8a; flex-shrink: 0; margin-top: 1px; }
.examen-item:hover { background: #eaf3ff; }
.examen-item.marcado { background: #dff1de; font-weight: bold; }
.examen-item.marcado span::after { content: '  ✗'; color: #c00; font-weight: bold; }

/* Orden de laboratorio impresa: grupos por categoría */
.grupos-imprimir { columns: 2; column-gap: 5mm; }
.grupo-imprimir { break-inside: avoid; margin-bottom: 2.5mm; border: 1px solid #c9d3df; border-radius: 2mm; padding: 1mm 2mm 1.5mm; }
.grupo-titulo { background: #1a4e8a; color: #fff; font-size: 8.5px; font-weight: bold; letter-spacing: .5px; border-radius: 1.5mm; padding: .8mm 2.5mm; margin-bottom: 1mm; display: inline-block; }
.grupo-imprimir .med-linea { border-bottom: 1px dotted #d5dce4; font-size: 9.5px; padding: .8mm 0; display: block; }
.grupo-imprimir .med-linea:last-child { border-bottom: none; }
.casilla { font-size: 11px; }
@media print { .grupo-titulo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.boton-inicio { color: #1a4e8a; font-weight: bold; }
.boton-inicio:hover { border-color: #7fa7d1; background: linear-gradient(#e8f2ff, #cfe3fb) !important; }

/* Panel de Administración del Sistema */
.sis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 8px; }
.sis-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
    border: 1px solid #b9c4d1; border-radius: 12px; padding: 16px 12px;
    background: linear-gradient(#fbfcfe, #eef2f7); text-decoration: none; color: #1a4e8a;
    transition: all .15s;
}
.sis-card:hover { border-color: #4a90d9; box-shadow: 0 6px 18px rgba(74,144,217,.28); transform: translateY(-2px); }
.sis-ico { font-size: 34px; }
.sis-nom { font-weight: bold; font-size: 14px; }
.sis-num { font-size: 11px; color: #667; }

/* ===== Reportes — tarjetas de totales (RESTAURADO + mejorado) ===== */
.tarjetas-reporte { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tarjeta-reporte {
    border: 1px solid #c3cfdd; border-radius: 12px; padding: 14px 12px; text-align: center;
    background: linear-gradient(#ffffff, #eef3fa);
    box-shadow: 0 2px 8px rgba(30,70,130,.08);
}
.tarjeta-reporte .numero { font-size: 30px; font-weight: bold; color: #0a3d7a; line-height: 1.1; }
.tarjeta-reporte .etiqueta { font-size: 11.5px; color: #55657a; font-weight: 600; margin-top: 2px; }
.reporte-columnas { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; margin-top: 6px; }
@media (max-width: 800px) { .reporte-columnas { grid-template-columns: 1fr; } }

/* ===== Clases faltantes RESTAURADAS (badges, textos de impresión) ===== */
.sello-entregada { font-size: 12px; color: #070; background: #ebfaeb; border: 1px solid #2a2; border-radius: 5px; padding: 2px 9px; white-space: nowrap; }
.sello-pendiente { font-size: 12px; color: #a60; background: #fff6e5; border: 1px solid #d90; border-radius: 5px; padding: 2px 9px; white-space: nowrap; }
.certificado-texto { flex: 1; font-size: 11px; line-height: 1.7; padding: 2mm 4mm; }
.certificado-texto p { margin: 0 0 2.5mm; }
.examenes-lista h3 { margin: 0 0 1.5mm; font-size: 9.5px; color: #1a4e8a; border-bottom: 2px solid #1a4e8a; padding-bottom: 1mm; }
.examenes-columnas { columns: 2; column-gap: 6mm; }
.receta-observa { font-size: 9.5px; margin: 1mm 0; }
.tabla-resultados th { font-size: 8.5px; }
.tabla-resultados td { font-size: 10px; }

/* ===== Galería de imágenes del paciente ===== */
.galeria-img { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.img-card { border: 1px solid #c3cfdd; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(30,70,130,.1); }
.img-thumb { display: flex; align-items: center; justify-content: center; height: 150px; background: #0d1622; overflow: hidden; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-pdf { color: #fff; font-size: 20px; font-weight: bold; }
.img-info { padding: 8px 10px; }
.img-tipo { font-size: 11px; font-weight: bold; color: #fff; background: #1a4e8a; display: inline-block; border-radius: 4px; padding: 1px 8px; }
.img-desc { font-size: 12px; font-weight: 600; color: #234; margin-top: 4px; }
.img-fecha { font-size: 11px; color: #667; margin-top: 2px; }
.img-acciones { display: flex; gap: 6px; padding: 0 10px 10px; }

/* Formulario de subida de imágenes del paciente */
.subir-form { border: 2px dashed #7fa7d1; border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; background: #f6faff; }
.subir-titulo { font-weight: bold; font-size: 15px; color: #1a4e8a; margin-bottom: 10px; }
.input-file {
    width: 100%; border: 1px solid #aab4c0; border-radius: 6px;
    padding: 10px; font-size: 13px; background: #fff; cursor: pointer;
}
.input-file::file-selector-button {
    border: 1px solid #4a90d9; border-radius: 6px; background: linear-gradient(#eaf3ff,#cfe3fb);
    color: #1a4e8a; font-weight: bold; padding: 6px 14px; margin-right: 12px; cursor: pointer;
}

/* Visor de imágenes con zoom (lightbox propio — el zoom es SOLO la imagen) */
.img-thumb { position: relative; display: block; }
.img-lupa {
    position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.55);
    color: #fff; font-size: 13px; border-radius: 50%; width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s;
}
.img-thumb:hover .img-lupa { opacity: 1; }
.visor-img { position: fixed; inset: 0; background: rgba(8,12,20,.94); z-index: 400; display: none; flex-direction: column; }
.visor-img.abierto { display: flex; }
.visor-barra { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(0,0,0,.35); }
.visor-barra .v-cap { flex: 1; color: #eaf2ff; font-size: 14px; font-weight: 600; }
.visor-barra .v-nivel { color: #cfe0f5; font-size: 13px; min-width: 46px; text-align: center; }
.visor-btn {
    background: #1a4e8a; color: #fff; border: 1px solid #3a6ea5; border-radius: 6px;
    min-width: 38px; height: 34px; font-size: 16px; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; text-decoration: none; padding: 0 8px;
}
.visor-btn:hover { background: #2660a8; }
.visor-lienzo { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.visor-lienzo img {
    max-width: 94%; max-height: 100%; transform-origin: center center;
    cursor: grab; user-select: none; will-change: transform; -webkit-user-drag: none;
}
.visor-lienzo img:active { cursor: grabbing; }
.visor-ayuda { text-align: center; color: #9fb6d4; font-size: 12px; padding: 7px; background: rgba(0,0,0,.3); }

/* Calendario mensual de turnos */
.cal-cabecera { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.cal-titulo { flex: 1; text-align: center; font-size: 17px; font-weight: bold; color: #1a4e8a; }
.cal-total { font-size: 12px; font-weight: 600; color: #5a7391; margin-left: 8px; }
.cal-tabla { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-tabla th { background: linear-gradient(#1a4e8a,#2660a8); color: #fff; font-size: 12px; padding: 6px 4px; border: 1px solid #cdd6e0; }
.cal-tabla th.cal-finde { background: linear-gradient(#5a6b7d,#48586a); }
.cal-tabla td { border: 1px solid #d5dce4; vertical-align: top; height: 96px; width: 14.28%; padding: 0; }
.cal-vacio { background: repeating-linear-gradient(45deg,#f4f6f9,#f4f6f9 6px,#eef1f5 6px,#eef1f5 12px); }
.cal-dia { cursor: pointer; transition: background .12s; }
.cal-dia:hover { background: #eef6ff; }
.cal-num { font-weight: bold; color: #33506e; font-size: 13px; padding: 3px 6px; border-bottom: 1px solid #eef1f5; display: flex; justify-content: space-between; align-items: center; }
.cal-hoy .cal-num { background: #1a4e8a; color: #fff; }
.cal-hoy { outline: 2px solid #1a4e8a; outline-offset: -2px; }
.cal-badge { background: #e6491f; color: #fff; border-radius: 10px; font-size: 10px; padding: 0 6px; font-weight: bold; }
.cal-hoy .cal-badge { background: #fff; color: #1a4e8a; }
.cal-lista { padding: 3px 4px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-turno { font-size: 10.5px; line-height: 1.3; background: #eaf3ff; border-left: 3px solid #4a90d9; border-radius: 3px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-turno b { color: #1a4e8a; }
.cal-anulado { background: #f3e3e3; border-left-color: #c0392b; text-decoration: line-through; color: #8a5a5a; }
.cal-mas { font-size: 10px; color: #4a90d9; font-weight: 600; padding-left: 4px; }

/* Bandeja de laboratorio: resaltar órdenes pendientes */
.tabla-indice tr.fila-pendiente { background: #fff7e6; }
.tabla-indice tr.fila-pendiente:hover { background: #ffeecb; }
.tabla-indice tr.fila-pendiente td:first-child { border-left: 4px solid #e8a20c; font-weight: bold; }

/* Roles y permisos */
.rol-chip { display: inline-block; background: #eaf3ff; border: 1px solid #b9d4f2; color: #1a4e8a;
    border-radius: 12px; font-size: 11px; font-weight: 600; padding: 1px 9px; margin: 2px 3px 2px 0; }
.rol-cuenta { display: inline-block; background: #1a4e8a; color: #fff; border-radius: 10px;
    font-size: 11px; font-weight: bold; padding: 0 7px; margin-right: 6px; }

/* Roles: etiquetas base/personalizado y grilla de módulos */
.rol-base { display: inline-block; background: #eef1f5; color: #5a7391; border-radius: 8px; font-size: 10px; font-weight: 700; padding: 0 7px; margin-left: 6px; text-transform: uppercase; }
.rol-tag-custom { display: inline-block; background: #e6f7ea; color: #1f7a3d; border: 1px solid #a9dcb8; border-radius: 8px; font-size: 10px; font-weight: 700; padding: 0 7px; margin-left: 6px; text-transform: uppercase; }
.roles-modulos { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 8px 2px; }
.roles-modulos .filtro-chip { min-width: 150px; }

/* Vista previa de datos de la institución */
.inst-preview { border: 1px solid #b9c4d1; border-radius: 8px; padding: 14px 18px; text-align: center; background: #fbfdff; line-height: 1.5; }
.inst-preview .inst-nombre { font-size: 17px; font-weight: bold; color: #1a4e8a; }
.inst-preview .inst-lema { font-style: italic; color: #5a7391; margin-top: 4px; }

/* Etiqueta "HOY" para tomas de triaje del día */
.tag-hoy { display: inline-block; background: #1f7a3d; color: #fff; border-radius: 8px;
    font-size: 10px; font-weight: 700; padding: 0 7px; margin-left: 6px; vertical-align: middle; }

/* Nombre de la clínica en la pantalla de inicio (centro, un poco a la derecha) */
.marca-clinica {
    position: absolute; top: 32%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center; max-width: 80%;
    color: #fff; pointer-events: none;
    animation: aparecer .6s ease-out;
}
.marca-clinica .mc-nombre {
    font-family: Georgia, 'Times New Roman', serif; font-weight: bold;
    font-size: 46px; line-height: 1.15; letter-spacing: 1px;
    text-shadow: 0 3px 6px rgba(0,0,0,.85), 0 2px 22px rgba(0,0,0,.7), 0 0 3px rgba(0,0,0,.9);
}
.marca-clinica .mc-dir {
    font-family: Georgia, serif; font-size: 21px; font-weight: 600; margin-top: 9px;
    text-shadow: 0 2px 5px rgba(0,0,0,.9), 0 1px 14px rgba(0,0,0,.8), 0 0 2px rgba(0,0,0,1);
}

/* Paginación */
.paginacion { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.paginacion .pag-info { font-size: 13px; color: #33506e; }

/* (formularios 2026 ahora son PDF servidos directamente) */


/* Icono de formulario apaisado (hoja acostada) */
.ico-apaisada { display: inline-block; transform: rotate(90deg); }

/* Grupos de formularios por uso (hospitalización / ambulatorio) */
.grupo-forms { grid-column: 1 / -1; margin-bottom: 6px; }
.grupo-forms-tit {
    font-size: 13px; color: #1a4e8a; font-weight: bold; margin: 10px 0 8px;
    background: #eaf3ff; border-left: 4px solid #1a4e8a; padding: 6px 10px; border-radius: 0 6px 6px 0;
}

/* ===== Dashboard de inicio ===== */
.dash { max-width: 1180px; margin: 22px auto; padding: 0 18px; }
/* con imagen de fondo a la izquierda, el dashboard se corre a la derecha */
@media (min-width: 1000px) {
    .dash { width: min(880px, 70%); margin-left: auto; margin-right: 3%; }
}
.dash-hero {
    background: linear-gradient(135deg, rgba(20,60,107,.92), rgba(42,127,184,.88));
    color: #fff; border-radius: 16px; padding: 16px 24px 18px;
    box-shadow: 0 10px 30px rgba(20,60,107,.35);
}
.dh-fila { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.dh-saludo { font-size: 19px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.25); padding-top: 12px; }
.dh-fecha { font-size: 17px; font-weight: 700; opacity: .95; text-transform: capitalize; white-space: nowrap; }
.dh-clinica { display: flex; align-items: center; gap: 12px; text-align: left; }
.dh-clinica img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.dh-nom { font-weight: 800; font-size: 15px; letter-spacing: .3px; }
.dh-ciu { font-size: 12px; opacity: .85; }

.dash-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px; margin-top: 16px;
}
.dash-card {
    display: flex; align-items: center; gap: 14px; text-decoration: none;
    background: rgba(255,255,255,.95); border-radius: 14px; padding: 14px 16px;
    border: 1px solid rgba(198,204,212,.7); border-left: 5px solid var(--c);
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    transition: transform .15s, box-shadow .15s;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.2); }
.dash-card img { width: 46px; height: 46px; }
.dc-num { font-size: 28px; font-weight: 800; color: var(--c); line-height: 1; }
.dc-lbl { font-size: 13px; font-weight: 700; color: #24344a; margin-top: 2px; }
.dc-extra { font-size: 11px; color: #7185a0; }

.dash-acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.da-btn {
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
    background: rgba(255,255,255,.95); color: var(--c); font-weight: 700; font-size: 13.5px;
    border: 2px solid var(--c); border-radius: 999px; padding: 9px 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12); transition: all .15s;
}
.da-btn:hover { background: var(--c); color: #fff; transform: translateY(-2px); }

/* Logo flotante frente al médico (solo en el inicio) */
.dash-logo-flot {
    position: absolute; left: 33%; top: 5%;
    width: 230px; pointer-events: none;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.35));
    animation: flotar 4s ease-in-out infinite;
}
@keyframes flotar { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* en pantallas medianas se achica y se corre; si no hay espacio, se oculta */
@media (max-width: 1750px) { .dash-logo-flot { width: 180px; left: 28%; } }
@media (max-width: 1550px) { .dash-logo-flot { width: 140px; left: 24%; } }
@media (max-width: 1400px) { .dash-logo-flot { display: none; } }

/* ===== Odontograma ===== */
.odo-paleta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    background: #f6faff; border: 1px solid #b9d4f2; border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.odo-tit { font-weight: bold; color: #1a4e8a; }
.odo-op { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
    border: 2px solid var(--c); color: var(--c); border-radius: 999px; padding: 4px 12px; cursor: pointer; background: #fff; }
.odo-op:has(input:checked) { background: var(--c); color: #fff; }
.odo-op input { accent-color: var(--c); }
.odo-caja { display: flex; align-items: center; gap: 8px; justify-content: center;
    background: #fbfdff; border: 1px solid #c6ccd4; border-radius: 12px; padding: 14px 8px; overflow-x: auto; }
.odo-lado { writing-mode: vertical-rl; text-orientation: mixed; font-size: 10px; font-weight: bold; color: #7185a0; letter-spacing: 2px; }
.odo-filas { display: flex; flex-direction: column; gap: 8px; }
.odo-fila { display: flex; gap: 3px; justify-content: center; }
.odo-sep { width: 14px; border-left: 2px dashed #9db8d8; margin: 0 4px; }
.odo-linea { border-top: 2px solid #9db8d8; margin: 2px 30px; }
.dnt { width: 42px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dnt-num { text-align: center; font-size: 10.5px; font-weight: bold; color: #33506e; }
/* diente anatómico */
.dnt-anat { width: 38px; height: 74px; display: block; }
.pz-corona { fill: #fffdf4; stroke: #8a97a8; stroke-width: 1.6; }
.pz-raiz   { fill: #f3ecdd; stroke: #b3a98f; stroke-width: 1.4; }
.pz-surco  { stroke: #c9c2ae; stroke-width: 1.6; }
.dnt:hover .pz-corona { stroke: #1a4e8a; }
.e-ausente .pz-corona, .e-ausente .pz-raiz { opacity: .28; }
.e-endo .pz-raiz { fill: #c4b5fd; stroke: #7c3aed; }
/* cuadrito de superficies */
.dnt-zonas { width: 30px; height: 30px; display: block; }
.dnt-zonas [data-s] { stroke: #64748b; stroke-width: 1; }
.dnt-zonas [data-s]:hover { stroke: #1a4e8a; stroke-width: 2; }
@media print {
    .no-imprimir, .barra, .estado { display: none !important; }
    .odo-caja { border: 1px solid #000; }
}

/* Ficha gineco-obstétrica */
.gin-gpca { display: flex; gap: 12px; flex-wrap: wrap; }
.gin-dato { display: flex; flex-direction: column; align-items: center; gap: 3px;
    border: 2px solid var(--c); border-radius: 12px; padding: 8px 14px; min-width: 86px; background: #fff; }
.gin-dato label { font-size: 20px; font-weight: 800; color: var(--c); line-height: 1; }
.gin-dato label small { display: block; font-size: 9.5px; font-weight: 600; color: #7185a0; text-transform: uppercase; }
.gin-dato input { width: 64px; height: 32px; text-align: center; font-size: 16px; font-weight: bold;
    border: 1px solid #c9d6e5; border-radius: 8px; color: var(--c); }
.campo.c-mini { flex: 0 1 90px; min-width: 80px; }

/* Sello chino "老中" (El Chino) estampado sobre el médico del dashboard */
.sello-chino {
    position: absolute; left: 7%; top: 12%;
    writing-mode: vertical-rl;
    font-family: "KaiTi", "STKaiti", "SimSun", "Noto Serif CJK SC", serif;
    font-size: 40px; font-weight: bold; line-height: 1;
    color: #fff; background: linear-gradient(160deg, #c62828, #8e1b1b);
    padding: 14px 8px; border: 3px double #fff; border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 0 12px rgba(255,255,255,.15);
    transform: rotate(-8deg);
    opacity: .93; pointer-events: none; letter-spacing: 6px;
}
@media (max-width: 1100px) { .sello-chino { display: none; } }

/* ===== banner de licencia ===== */
.lic-banner { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9999;
  padding: 9px 22px; border-radius: 10px; font: 600 13px/1.35 'Segoe UI', sans-serif;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: min(92vw, 720px); text-align: center; }
.lic-aviso   { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.lic-vencida { background: #fee2e2; color: #991b1b; border: 1px solid #dc2626; }
