﻿    /* -- Variables de tema -------------------------------------------------- */
:root {
    --shl-bg: #0d1117;
    --shl-bg2: #161b22;
    --shl-bg3: #21262d;
    --shl-border: #30363d;
    --shl-text: #e6edf3;
    --shl-text2: #8b949e;
    --shl-text3: #6e7681;
    --shl-accent: #3B82F6;
    --shl-accent-dim: #1e3a5f;
    --shl-sidebar-w: 220px;
    --shl-text-muted: #8b949e;
    --shl-hover-bg: #1c2128;
    --shl-selected-bg: #1f2d3d;
    --shl-primary: #3B82F6;
    --shl-primary-rgb: 59, 130, 246;
    --shl-topbar-h: 52px;
    --shl-input-bg: #1f2937;
    --shl-input-border: #374151;
    --shl-text-primary: #f9fafb;
    --shl-card-bg: #111827;
}

body.shl-dark {
    --shl-bg: #0d1117;
    --shl-bg2: #161b22;
    --shl-bg3: #21262d;
    --shl-border: #30363d;
    --shl-text: #e6edf3;
    --shl-text2: #8b949e;
    --shl-text3: #6e7681;
    --shl-hover-bg: #1c2128;
    --shl-selected-bg: #1f2d3d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--shl-bg);
    color: var(--shl-text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* -- Auth layout -------------------------------------------------------- */
.auth-container {
    padding-top: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--shl-bg);
}

.auth-card {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 12px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
}

/* -- App shell ---------------------------------------------------------- */
.shl-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

/* -- Sidebar ------------------------------------------------------------ */
.shl-sidebar {
    width: var(--shl-sidebar-w);
    background: var(--shl-bg2);
    border-right: 1px solid var(--shl-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    transition: width 0.2s;
}

.shl-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--shl-border);
}

.shl-sidebar-brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.shl-brand-text {
    overflow: hidden;
}

.shl-sidebar-brand {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--shl-text);
    white-space: nowrap;
}

.shl-sidebar-ipress {
    display: block;
    font-size: 10px;
    color: var(--shl-text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shl-toggle-btn {
    background: none;
    border: none;
    color: var(--shl-text3);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

/* -- Nav ---------------------------------------------------------------- */
.shl-nav {
    flex: 1;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shl-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--shl-text2);
    text-decoration: none;
    border-radius: 6px;
    margin: 0 6px;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

    .shl-nav-item:hover,
    .shl-nav-item.active {
        background: var(--shl-bg3);
        color: var(--shl-text);
    }

    .shl-nav-item.active {
        color: var(--shl-accent);
    }

.shl-nav-divider {
    height: 1px;
    background: var(--shl-border);
    margin: 6px 14px;
}

/* -- Topbar ------------------------------------------------------------- */
.shl-topbar {
    height: var(--shl-topbar-h);
    background: var(--shl-bg2);
    border-bottom: 1px solid var(--shl-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.shl-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--shl-text2);
    cursor: pointer;
    padding: 6px;
}

.shl-topbar-left {
    display: flex;
    align-items: center;
}

.shl-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shl-topbar-user {
    font-size: 12px;
    color: var(--shl-text2);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* -- Main content ------------------------------------------------------- */
.shl-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.shl-content {
    flex: 1;
    padding: 24px;
}

/* -- Sidebar footer ----------------------------------------------------- */
.shl-sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--shl-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shl-footer-nombre {
    font-size: 12px;
    color: var(--shl-text);
    font-weight: 600;
}

.shl-footer-ipress {
    font-size: 10px;
    color: var(--shl-text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -- Responsive - consolidado al final del archivo ---------------------- */

/* -- Auth forms --------------------------------------------------------- */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--shl-text);
}

.auth-info {
    font-size: 12px;
    color: var(--shl-text2);
    margin-bottom: 16px;
    line-height: 1.5;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-label {
    display: block;
    font-size: 11px;
    color: var(--shl-text3);
    margin-bottom: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-input,
.auth-select {
    width: 100%;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 7px;
    padding: 9px 12px;
    color: var(--shl-text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

    .auth-input:focus,
    .auth-select:focus {
        border-color: var(--shl-accent);
    }

    .auth-input:disabled,
    .auth-select:disabled {
        opacity: 0.5;
    }

.auth-btn {
    width: 100%;
    background: var(--shl-accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.15s;
}

    .auth-btn:hover {
        opacity: 0.88;
    }

    .auth-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.auth-error {
    background: rgba(216, 90, 48, 0.12);
    border: 1px solid rgba(216, 90, 48, 0.4);
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 12px;
    color: #D85A30;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.auth-success {
    background: rgba(29, 158, 117, 0.12);
    border: 1px solid rgba(29, 158, 117, 0.4);
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 12px;
    color: var(--shl-accent);
    margin-bottom: 14px;
    line-height: 1.5;
}

.auth-footer-links {
    text-align: center;
    margin-top: 16px;
}

.auth-link {
    font-size: 12px;
    color: var(--shl-text3);
    text-decoration: none;
}

    .auth-link:hover {
        color: var(--shl-accent);
    }

.auth-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: shl-spin 0.7s linear infinite;
}

@keyframes shl-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.auth-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--shl-text3);
    margin: 0 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--shl-border);
}

.auth-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 7px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.auth-picker-item {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--shl-text);
    cursor: pointer;
}

    .auth-picker-item:hover {
        background: var(--shl-bg3);
        color: var(--shl-accent);
    }

/* -- Badge de vigencia (topbar) ----------------------------------------- */
.shl-vigencia-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

.badge-vigente {
    background: rgba(29, 158, 117, 0.15);
    color: #1d9e75;
    border: 1px solid rgba(29, 158, 117, 0.3);
}

.badge-proximo {
    background: rgba(186, 117, 23, 0.15);
    color: #BA7517;
    border: 1px solid rgba(186, 117, 23, 0.3);
}

.badge-vencido {
    background: rgba(216, 90, 48, 0.15);
    color: #D85A30;
    border: 1px solid rgba(216, 90, 48, 0.3);
}

/* -- Logout btn --------------------------------------------------------- */
.shl-logout-btn {
    color: var(--shl-text2);
    padding: 6px 8px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .shl-logout-btn:hover {
        background: var(--shl-bg3);
        color: var(--shl-text);
    }

/* -- Banner post-vencimiento -------------------------------------------- */
.shl-banner-vencido {
    background: rgba(216, 90, 48, 0.1);
    border-bottom: 1px solid rgba(216, 90, 48, 0.3);
    padding: 10px 20px;
    font-size: 13px;
    color: #D85A30;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .shl-banner-vencido a {
        color: var(--shl-accent);
        text-decoration: none;
        font-weight: 600;
    }

/* -- Bloqueo parcial ---------------------------------------------------- */
.shl-blocked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 24px;
    text-align: center;
}

    .shl-blocked h3 {
        font-size: 16px;
        color: var(--shl-text2);
        font-weight: 600;
    }

    .shl-blocked p {
        font-size: 13px;
        color: var(--shl-text3);
        max-width: 340px;
    }

/* -- Input con botón toggle (mostrar/ocultar contraseña) --------------- */
.auth-input-wrap {
    position: relative;
    display: flex;
}

    .auth-input-wrap .auth-input {
        padding-right: 72px;
    }

.auth-toggle-pass {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--shl-accent);
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
}

/* -- Footer links del auth ---------------------------------------------- */
.auth-link-sep {
    color: var(--shl-text3);
    font-size: 12px;
    margin: 0 4px;
}

/* ===========================================================
   F2 - Dashboard
   =========================================================== */

.shl-dashboard {
    padding: 1.5rem;
    max-width: 900px;
}

/* Encabezado saludo + turno */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-saludo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-saludo-icono {
    font-size: 2rem;
}

.dash-saludo-nombre {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--shl-text);
}

.dash-saludo-sub {
    font-size: 0.8rem;
    color: var(--shl-text2);
}

.dash-turno-selector {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-turno-label {
    font-size: 0.78rem;
    color: var(--shl-text3);
    margin-right: 0.25rem;
}

.dash-turno-btn {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    color: var(--shl-text2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .dash-turno-btn:hover {
        background: var(--shl-accent-dim);
        color: var(--shl-text);
    }

    .dash-turno-btn.activo {
        background: var(--shl-accent);
        color: #fff;
        border-color: var(--shl-accent);
    }

/* Métricas */
.dash-metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dash-metrica-card {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
}

.dash-metrica-valor {
    font-size: 2rem;
    font-weight: 700;
    color: var(--shl-accent);
    line-height: 1;
}

.dash-metrica-valor--sm {
    font-size: 1.15rem;
}

.dash-metrica-label {
    font-size: 0.82rem;
    color: var(--shl-text2);
    margin-top: 0.35rem;
}

.dash-metrica-sub {
    font-size: 0.75rem;
    color: var(--shl-text3);
    margin-top: 0.2rem;
}

/* Accesos rápidos */
.dash-accesos {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.dash-acceso-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    color: var(--shl-text);
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s;
}

    .dash-acceso-btn:hover {
        background: var(--shl-accent-dim);
    }

    .dash-acceso-btn.dash-acceso-primary {
        background: var(--shl-accent);
        border-color: var(--shl-accent);
        color: #fff;
        font-weight: 600;
    }

        .dash-acceso-btn.dash-acceso-primary:hover {
            opacity: 0.9;
        }

.dash-acceso-icono {
    font-size: 1rem;
}

/* Lista atenciones del día */
.dash-lista-titulo {
    font-size: 0.82rem;
    color: var(--shl-text3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.dash-lista {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-lista-item {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.dash-lista-nombre {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--shl-text);
}

.dash-lista-detalle {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--shl-text2);
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.dash-lista-obs {
    font-size: 0.78rem;
    color: var(--shl-text3);
    margin-top: 0.2rem;
    font-style: italic;
}

.dash-estado-msg {
    color: var(--shl-text2);
    font-size: 0.88rem;
    padding: 1rem 0;
}

.dash-estado-error {
    color: #f87171;
}

/* ===========================================================
   F2 - Página genérica (Perfil, Configuración)
   =========================================================== */

.shl-page {
    padding: 1.5rem;
    max-width: 860px;
}

.shl-page-header {
    margin-bottom: 1.5rem;
}

.shl-page-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--shl-text);
    margin: 0;
}

.shl-card {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.shl-card-titulo {
    font-size: 0.78rem;
    color: var(--shl-text3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.shl-estado-msg {
    color: var(--shl-text2);
    font-size: 0.88rem;
    padding: 1rem 0;
}

.shl-alerta {
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 0.9rem;
}

.shl-alerta--ok {
    background: #052e16;
    color: #4ade80;
    border: 1px solid #166534;
}

.shl-alerta--error {
    background: #2d0a0a;
    color: #f87171;
    border: 1px solid #7f1d1d;
}

/* -- Perfil -- */
.shl-perfil-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.shl-perfil-readonly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem 1.5rem;
    margin-bottom: 0.75rem;
}

.shl-perfil-campo {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.shl-perfil-campo-label {
    font-size: 0.72rem;
    color: var(--shl-text3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.shl-perfil-campo-valor {
    font-size: 0.9rem;
    color: var(--shl-text);
}

.shl-perfil-nota {
    font-size: 0.75rem;
    color: var(--shl-text3);
    font-style: italic;
}

/* -- Formulario -- */
.shl-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.shl-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
}

.shl-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

    .shl-form-group label {
        font-size: 0.78rem;
        color: var(--shl-text2);
    }

.shl-input {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--shl-text);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

    .shl-input:focus {
        outline: none;
        border-color: var(--shl-accent);
    }

/* -- Validación - estado error ------------------------------------------ */
.shl-input--error,
.shl-select--error {
    border-color: var(--shl-danger) !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.shl-input--warn {
    border-color: var(--shl-accent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--shl-accent) 25%, transparent);
}

.shl-campo-error {
    font-size: 0.72rem;
    color: var(--shl-danger);
    margin-top: 0.2rem;
    display: block;
}

.shl-campo-hint {
    font-size: 0.72rem;
    color: var(--shl-text3);
    margin-top: 0.15rem;
    display: block;
    font-style: italic;
}

.shl-form-acciones {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

/* -- Botones -- */
.shl-btn {
    padding: 0.5rem 1.1rem;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.15s, background 0.15s;
}

    .shl-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.shl-btn--primary {
    background: var(--shl-accent);
    color: #fff;
    border-color: var(--shl-accent);
}

    .shl-btn--primary:hover:not(:disabled) {
        opacity: 0.88;
    }

.shl-btn--secondary {
    background: var(--shl-bg3);
    color: var(--shl-text);
    border-color: var(--shl-border);
}

    .shl-btn--secondary:hover {
        background: var(--shl-accent-dim);
    }

.shl-btn--danger {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #991b1b;
}

    .shl-btn--danger:hover {
        background: #991b1b;
    }

.shl-btn--whatsapp {
    background: #14532d;
    color: #4ade80;
    border-color: #166534;
    text-decoration: none;
    display: inline-block;
}

    .shl-btn--whatsapp:hover {
        background: #166534;
    }

/* -- Configuración -- */
.shl-config-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.shl-config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--shl-border);
}

    .shl-config-item:last-child {
        border-bottom: none;
    }

.shl-config-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.shl-config-item-nombre {
    font-size: 0.88rem;
    color: var(--shl-text);
}

.shl-config-item-desc {
    font-size: 0.78rem;
    color: var(--shl-text3);
}

/* ===========================================================
   F3 - Pacientes
   =========================================================== */

/* Page header */
.shl-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.shl-page-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.shl-page-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shl-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--shl-text);
}

.shl-page-subtitle {
    font-size: 0.82rem;
    color: var(--shl-text2);
}

/* Search bar */
.shl-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.shl-search-input {
    flex: 1;
}

.shl-search-count {
    font-size: 0.82rem;
    color: var(--shl-text2);
    white-space: nowrap;
}

.shl-search-spinner {
    color: var(--shl-accent);
    font-size: 1.1rem;
}

/* Alert */
.shl-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.shl-alert-error {
    background: rgba(216, 90, 48, 0.12);
    border: 1px solid rgba(216, 90, 48, 0.35);
    color: #ff8080;
}

.shl-alert-success {
    background: rgba(29, 158, 117, 0.12);
    border: 1px solid rgba(29, 158, 117, 0.35);
    color: #6dff80;
}

/* Loading */
.shl-loading-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--shl-text2);
}

.shl-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--shl-border);
    border-top-color: var(--shl-accent);
    border-radius: 50%;
    animation: shl-spin 0.7s linear infinite;
}

@keyframes shl-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty state */
.shl-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem;
    color: var(--shl-text2);
    text-align: center;
}

.shl-empty-icon {
    width: 40px;
    height: 40px;
    color: var(--shl-text3);
    margin-bottom: 0.25rem;
}

/* Table */
.shl-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--shl-border);
}

.shl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .shl-table thead th {
        background: var(--shl-bg2);
        color: var(--shl-text2);
        padding: 0.65rem 0.85rem;
        text-align: left;
        font-weight: 500;
        font-size: 0.8rem;
        text-transform: uppercase;
        border-bottom: 1px solid var(--shl-border);
    }

    .shl-table tbody tr {
        border-bottom: 1px solid var(--shl-border);
        transition: background 0.15s;
    }

        .shl-table tbody tr:hover {
            background: var(--shl-bg2);
        }

        .shl-table tbody tr:last-child {
            border-bottom: none;
        }

    .shl-table tbody td {
        padding: 0.6rem 0.85rem;
        color: var(--shl-text);
        vertical-align: middle;
    }

.shl-row-inactivo {
    opacity: 0.5;
}

.shl-th-actions, .shl-td-actions {
    text-align: right;
    white-space: nowrap;
}

.shl-pac-nombre {
    font-weight: 600;
    color: var(--shl-text);
}

.shl-pac-nombres2 {
    font-size: 0.82rem;
    color: var(--shl-text2);
}

.shl-badge-doc {
    font-size: 0.72rem;
    background: var(--shl-accent-dim);
    color: var(--shl-accent);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.3rem;
}

/* Action buttons - variantes F3 (single-dash) */
.shl-btn-primary {
    background: var(--shl-accent);
    color: #fff;
}

    .shl-btn-primary:hover {
        opacity: 0.85;
    }

.shl-btn-secondary {
    background: var(--shl-bg3);
    color: var(--shl-text);
    border: 1px solid var(--shl-border);
}

    .shl-btn-secondary:hover {
        background: var(--shl-border);
    }

.shl-btn-icon {
    background: transparent;
    border: 1px solid var(--shl-border);
    border-radius: 5px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 0.25rem;
    transition: background 0.15s;
}

    .shl-btn-icon:hover {
        background: var(--shl-bg3);
    }

.shl-btn-back {
    background: transparent;
    border: none;
    color: var(--shl-accent);
    cursor: pointer;
    font-size: 0.88rem;
    padding: 0;
    margin-bottom: 0.25rem;
}

    .shl-btn-back:hover {
        text-decoration: underline;
    }

.shl-btn-cerrar {
    background: transparent;
    border: none;
    color: var(--shl-text2);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

/* Historial overlay */
.shl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}
/* -- Modal genérico (editar paciente, etc.) ----------------------------- */
.shl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.shl-modal {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.shl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--shl-border);
}

.shl-modal-titulo {
    font-weight: 600;
    font-size: 1rem;
    color: var(--shl-text);
}

.shl-modal-sub {
    font-size: 0.8rem;
    color: var(--shl-text2);
    margin-top: 2px;
}

.shl-modal-cerrar {
    background: none;
    border: none;
    color: var(--shl-text2);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    font-size: 1.1rem;
}

    .shl-modal-cerrar:hover {
        background: var(--shl-bg3);
        color: var(--shl-text);
    }

.shl-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shl-modal-nota {
    font-size: 0.78rem;
    color: var(--shl-text2);
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
}

.shl-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--shl-border);
}
/* Override para modales centrados (no paneles laterales) */
.shl-overlay-center {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shl-historial-panel {
    width: min(520px, 95vw);
    max-width: 95vw;
    height: 100vh;
    background: var(--shl-bg2);
    border-left: 1px solid var(--shl-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shl-historial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--shl-border);
}

.shl-historial-nombre {
    font-weight: 600;
    font-size: 1rem;
    color: var(--shl-text);
}

.shl-historial-doc {
    font-size: 0.82rem;
    color: var(--shl-text2);
    margin-top: 0.15rem;
}

.shl-historial-count {
    padding: 0.5rem 1.25rem;
    font-size: 0.82rem;
    color: var(--shl-text2);
}

.shl-historial-lista {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.25rem 1.25rem;
}

.shl-historial-card {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 8px;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.shl-historial-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.shl-historial-fecha {
    font-weight: 600;
    color: var(--shl-accent);
}

.shl-historial-edad {
    font-size: 0.82rem;
    color: var(--shl-text2);
}

.shl-historial-eval {
    font-size: 0.82rem;
    color: var(--shl-text2);
    white-space: pre-line;
    margin-bottom: 0.4rem;
}

.shl-historial-diags {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.shl-diag-item {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.shl-diag-codigo {
    font-size: 0.78rem;
    background: var(--shl-accent-dim);
    color: var(--shl-accent);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    white-space: nowrap;
}

.shl-diag-desc {
    font-size: 0.88rem;
    color: var(--shl-text);
}

.shl-diag-tipo {
    font-size: 0.78rem;
    color: var(--shl-text2);
}

/* Formulario */
.shl-form-card {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 820px;
}

.shl-form-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--shl-text2);
    margin: 1.25rem 0 0.75rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--shl-border);
    padding-bottom: 0.4rem;
}

    .shl-form-section-title:first-child {
        margin-top: 0;
    }

.shl-form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.shl-form-group {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
}

.shl-form-group-sm {
    flex: 0 0 160px;
}

.shl-form-group-md {
    flex: 0 0 220px;
}

.shl-form-row-activo {
    align-items: center;
}

.shl-label {
    font-size: 0.82rem;
    color: var(--shl-text2);
    font-weight: 500;
}

.shl-required {
    color: #ff6060;
}

.shl-select, .shl-textarea {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    color: var(--shl-text);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}

    .shl-select:focus, .shl-textarea:focus {
        border-color: var(--shl-accent);
    }

    .shl-input:disabled, .shl-select:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.shl-textarea {
    resize: vertical;
}

.shl-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--shl-border);
}

.shl-merge-info {
    font-size: 0.82rem;
    color: var(--shl-text2);
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
}

/* -- Ubigeo dropdown --------------------------------------------------- */
.shl-ubigeo-dropdown {
    position: absolute;
    z-index: 100;
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    max-height: 220px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    top: calc(100% + 2px);
}

.shl-ubigeo-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--shl-text);
}

    .shl-ubigeo-item:hover {
        background: var(--shl-bg3);
    }

.shl-ubigeo-id {
    font-size: 0.75rem;
    color: var(--shl-text3);
}

.shl-ubigeo-sel {
    font-size: 0.8rem;
    color: var(--shl-accent);
    margin-top: 0.3rem;
}

/* F3.1 - DataCenter autocomplete */
.shl-merge-ok {
    border-color: #2a6b30;
    color: #6dff80;
    background: #1b2d1e;
}

.shl-merge-warn {
    border-color: #6b5a1e;
    color: #ffd666;
    background: #2d2610;
}

body.shl-light .shl-merge-ok {
    border-color: #16a34a;
    color: #15803d;
    background: #dcfce7;
}

body.shl-light .shl-merge-warn {
    border-color: #ca8a04;
    color: #92400e;
    background: #fef9c3;
}

/* F3.2 - DNI search button */
.shl-input-with-btn {
    display: flex;
    gap: 0.4rem;
}

    .shl-input-with-btn .shl-input {
        flex: 1;
    }

.shl-btn-buscar-doc {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0 0.65rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s;
    white-space: nowrap;
}

    .shl-btn-buscar-doc:hover:not(:disabled) {
        background: var(--shl-accent-dim);
    }

    .shl-btn-buscar-doc:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.shl-spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--shl-border);
    border-top-color: var(--shl-accent);
    border-radius: 50%;
    animation: shl-spin 0.7s linear infinite;
}

/* ===========================================================================
   F4 - Módulo Atención HIS
   =========================================================================== */

/* Layout principal two-column */
.shl-his-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.shl-his-main {
    flex: 1;
    min-width: 0;
}

.shl-his-panel {
    flex: 0 0 260px;
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: 1rem;
    position: sticky;
    top: calc(var(--shl-topbar-h) + 1rem);
}

/* -- Fase A: buscar ----------------------------------------------------- */
.shl-his-buscar-card {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: 1.75rem 1.5rem;
    max-width: 580px;
}

.shl-his-buscar-header {
    margin-bottom: 1.25rem;
}

.shl-his-buscar-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.shl-his-tipo-doc {
    flex: 0 0 130px;
}

.shl-his-nro-doc {
    flex: 1;
    min-width: 140px;
}

.shl-his-btn-buscar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

/* -- Fase B: formulario ------------------------------------------------- */
.shl-his-form {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
}

/* Header paciente read-only */
.shl-his-pac-header {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--shl-border);
}

.shl-his-pac-nombre {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--shl-text);
    margin-bottom: 0.35rem;
}

.shl-his-pac-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.88rem;
    color: var(--shl-text2);
}

.shl-his-sep {
    color: var(--shl-border);
}

/* Turno + fecha */
.shl-his-turno-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.shl-his-turno-label {
    font-size: 0.82rem;
    color: var(--shl-text2);
}

.shl-his-turno-sep {
    color: var(--shl-border);
    margin: 0 0.25rem;
}

.shl-his-turno-btn {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 5px;
    padding: 0.4rem 1rem;
    color: var(--shl-text2);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s;
}

    .shl-his-turno-btn.activo {
        background: var(--shl-accent);
        border-color: var(--shl-accent);
        color: #fff;
    }

.shl-his-fecha-input {
    width: 150px;
}

.shl-his-hora-input {
    width: 110px;
    font-size: 0.85rem;
}

/* -- Badges grupo etareo ---------------------------------------------- */
.shl-etareo-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
/* Grupo etareo - colores armoniosos con el tema oscuro SHL */
.shl-etareo--nino {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.shl-etareo--adolescente {
    background: rgba(99, 179, 237, 0.2);
    color: #63b3ed;
}

/* Adulto Joven (18-29 años) */
.shl-etareo--joven,
.shl-etareo--adulto-joven {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.shl-etareo--adulto {
    background: rgba(96, 165, 250, 0.18);
    color: #60a5fa;
    opacity: 1;
}

.shl-etareo--am {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
}

/* -- Tabla diagnósticos ------------------------------------------------- */
.shl-his-tabla-wrap {
    overflow: visible;
    border: 1px solid var(--shl-border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.shl-his-tabla-scroll {
    overflow-x: auto;
    border-radius: 8px;
}

.shl-his-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

    .shl-his-tabla thead th {
        background: var(--shl-bg3);
        color: var(--shl-text2);
        font-size: 0.78rem;
        font-weight: 600;
        text-transform: uppercase;
        padding: 0.5rem 0.6rem;
        text-align: left;
        white-space: nowrap;
        border-bottom: 1px solid var(--shl-border);
    }

    .shl-his-tabla tbody tr {
        border-bottom: 1px solid var(--shl-border);
    }

        .shl-his-tabla tbody tr:last-child {
            border-bottom: none;
        }

.shl-his-fila td {
    padding: 0.2rem 0.4rem;
    vertical-align: middle;
}

/* ── Celda número con botones siempre visibles ── */
.shl-his-orden-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 40px;
}

.shl-his-btn-orden {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 3px;
    color: var(--shl-text3);
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.shl-his-btn-orden:disabled {
    cursor: default;
    opacity: 0.12;
}

.shl-his-btn-orden:not(:disabled):hover {
    background: var(--shl-bg3);
    color: var(--shl-accent);
    opacity: 1;
}

.shl-his-fila:hover .shl-his-btn-orden:not(:disabled) {
    opacity: 0.75;
}

.shl-his-fila:hover {
    background: rgba(59,130,246,0.04);
}

/* Anchos de columnas */
.shl-his-col-num {
    width: 48px;
    text-align: center;
    color: var(--shl-text3);
    font-size: 0.8rem;
    white-space: nowrap;
}

.shl-his-col-cie {
    width: 110px;
}

.shl-his-col-desc {
    min-width: 180px;
}

.shl-his-col-tipo {
    width: 120px;
}

.shl-his-col-labs {
    width: 80px;
}

.shl-his-col-del {
    width: 32px;
    text-align: center;
}

/* Inputs inline de tabla */
.shl-his-input-cie {
    font-size: 0.85rem;
    padding: 0.15rem 0.4rem;
    height: 28px;
}

.shl-his-input-desc {
    font-size: 0.88rem;
    padding: 0.15rem 0.4rem;
    height: 28px;
    width: 100%;
}

.shl-his-input-lab {
    font-size: 0.82rem;
    padding: 0.15rem 0.35rem;
    height: 28px;
    width: 100%;
}

.shl-his-select-tipo {
    font-size: 0.88rem;
    padding: 0.15rem 0.35rem;
    height: 28px;
}

.shl-his-cie-cell {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.shl-his-btn-cie {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shl-his-btn-del {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--shl-text3);
}

    .shl-his-btn-del:hover {
        color: #ff6060;
        background: rgba(255,96,96,0.1);
    }

/* Fila agregar */
.shl-his-fila-add td {
    padding: 0.4rem 0.6rem;
}

.shl-his-btn-add {
    background: none;
    border: 1px dashed var(--shl-border);
    border-radius: 5px;
    padding: 0.3rem 0.75rem;
    color: var(--shl-text2);
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
    width: 100%;
    justify-content: center;
}

    .shl-his-btn-add:hover {
        border-color: var(--shl-accent);
        color: var(--shl-accent);
        background: var(--shl-accent-dim);
    }

/* -- Triaje colapsable -------------------------------------------------- */
.shl-his-triaje-section {
    margin-bottom: 1rem;
}

.shl-his-triaje-toggle {
    background: none;
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0.4rem 0.85rem;
    color: var(--shl-text2);
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s;
    width: 100%;
    margin-bottom: 0.6rem;
}

    .shl-his-triaje-toggle:hover {
        background: var(--shl-bg3);
    }

.shl-his-triaje-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 8px;
    padding: 0.85rem;
}

/* -- Campos HIS adicionales -------------------------------------------- */
.shl-his-campos-his {
    margin-bottom: 1rem;
}

/* -- Panel lateral estrategias ----------------------------------------- */
.shl-his-panel-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--shl-text2);
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.shl-his-panel-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.shl-his-tab-btn {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 5px;
    padding: 0.25rem 0.65rem;
    color: var(--shl-text2);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

    .shl-his-tab-btn.activo {
        background: var(--shl-accent-dim);
        border-color: var(--shl-accent);
        color: var(--shl-text);
    }

.shl-his-panel-lista {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.shl-his-panel-placeholder {
    font-size: 0.82rem;
    color: var(--shl-text3);
    text-align: center;
    padding: 1rem 0;
}

.shl-his-paquete-btn {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

    .shl-his-paquete-btn:hover {
        border-color: var(--shl-accent);
        background: var(--shl-accent-dim);
    }

.shl-his-paquete-nombre {
    font-size: 0.85rem;
    color: var(--shl-text);
}

.shl-his-paquete-count {
    font-size: 0.75rem;
    color: var(--shl-text3);
}

/* -- Modal CIE-10 ------------------------------------------------------- */
.shl-his-modal-cie {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 12px;
    padding: 1.25rem;
    width: 560px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shl-his-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shl-his-modal-title {
    font-weight: 600;
    color: var(--shl-text);
}

.shl-his-modal-search {
    width: 100%;
}

.shl-his-modal-resultados {
    overflow-y: auto;
    max-height: 340px;
    display: flex;
    flex-direction: column;
}

.shl-his-modal-empty {
    font-size: 0.85rem;
    color: var(--shl-text3);
    text-align: center;
    padding: 1.5rem 0;
}

.shl-his-modal-fila {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--shl-border);
    cursor: pointer;
    transition: background 0.12s;
}

    .shl-his-modal-fila:hover {
        background: var(--shl-bg3);
    }

    .shl-his-modal-fila:last-child {
        border-bottom: none;
    }

.shl-his-modal-codigo {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--shl-accent);
    min-width: 56px;
}

.shl-his-modal-desc {
    font-size: 0.85rem;
    color: var(--shl-text);
}

/* ===========================================================================
   UX/UI Fixes - Chat 5
   =========================================================================== */

/* Sidebar colapsado (desktop) */
.shl-sidebar.sidebar-toggled {
    width: 60px;
    overflow: hidden;
}

    .shl-sidebar.sidebar-toggled .shl-nav-text,
    .shl-sidebar.sidebar-toggled .shl-sidebar-ipress,
    .shl-sidebar.sidebar-toggled .shl-sidebar-brand,
    .shl-sidebar.sidebar-toggled .shl-brand-text,
    .shl-sidebar.sidebar-toggled .shl-footer-nombre,
    .shl-sidebar.sidebar-toggled .shl-footer-ipress {
        display: none;
    }

    .shl-sidebar.sidebar-toggled .shl-nav-item {
        justify-content: center;
        padding: 0.6rem;
    }

    .shl-sidebar.sidebar-toggled .shl-toggle-btn {
        margin: 0 auto;
    }

    .shl-sidebar.sidebar-toggled .shl-sidebar-brand-wrap {
        justify-content: center;
    }

/* Triaje - 6 campos en fila única en desktop (Peso, Talla, Hb, Fecha Hb, P.Cef, P.Abd) */
@media (min-width: 900px) {
    .shl-his-triaje-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .shl-his-triaje-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Select N/C/R compacto */
.shl-form-group-sm {
    flex: 0 0 150px;
}

/* Input fecha Hb en triaje */
.shl-his-input-fecha-hb {
    font-size: 0.82rem;
    padding: 0.25rem 0.35rem;
    height: 30px;
    width: 100%;
}

/* Hemoglobina - fila condicional bajo el triaje grid */
.shl-his-hb-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.85rem;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 7px;
    margin-top: 0.5rem;
}

.shl-his-hb-check-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--shl-text2);
    white-space: nowrap;
    user-select: none;
}

.shl-his-hb-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--shl-accent);
}

.shl-his-hb-campos {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}

.shl-his-input-hb {
    width: 100px;
}

.shl-his-input-fecha-hb {
    width: 150px;
}

/* ===========================================================================
   F4 FINAL - Triaje barra + Panel estrategias 3 niveles
   =========================================================================== */

/* Triaje - barra horizontal fija, siempre visible, estilo SH4 */
.shl-his-triaje-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin-bottom: 0.85rem;
}

.shl-his-triaje-campo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 90px;
}

.shl-his-triaje-label {
    font-size: 0.78rem;
    color: var(--shl-text2);
    font-weight: 500;
    white-space: nowrap;
}

.shl-his-triaje-input {
    min-height: 44px;
    height: auto;
    font-size: 0.9rem;
    padding: 0.2rem 0.35rem;
    width: 100%;
}

.shl-his-triaje-sep-v {
    width: 1px;
    height: 36px;
    background: var(--shl-border);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

/* Checkbox activador Hb */
.shl-his-triaje-campo--hb-toggle {
    min-width: unset;
    width: auto;
    flex: 0 0 auto;
    padding-right: 0.25rem;
}

.shl-his-triaje-label--check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
}

.shl-his-triaje-check {
    width: 15px;
    height: 15px;
    accent-color: var(--shl-accent);
    cursor: pointer;
}
/* Campos Hb deshabilitados - apariencia apagada */
.shl-his-triaje-input:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* Fila Hb - más compacta (3 elementos) */
.shl-his-triaje-bar--hb {
    margin-bottom: 0.4rem;
}
/* Fila medidas - 4 campos, siempre en una fila */
.shl-his-triaje-bar--medidas {
    margin-bottom: 0;
}
/* En móvil <=600px ambas barras pueden hacer wrap */
@media (max-width: 600px) {
    .shl-his-triaje-bar--hb,
    .shl-his-triaje-bar--medidas {
        flex-wrap: wrap;
    }
}

/* Segunda barra triaje - campos adicionales (DT-17) */
.shl-his-triaje-bar--extra {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--shl-border);
}

/* Post-guardar - acciones tras guardar exitosamente (DT-15) */
.shl-his-post-guardar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--shl-accent-dim);
    border: 1px solid var(--shl-accent);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.shl-his-post-guardar-id {
    flex: 1;
    font-size: 0.82rem;
    color: var(--shl-text2);
}

/* Countdown badge en botón Ir al Inicio */
.shl-btn--countdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.shl-countdown-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--shl-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    transition: background 0.3s;
}

/* Barra de progreso countdown */
.shl-countdown-bar-wrap {
    height: 3px;
    background: var(--shl-accent-dim);
    border-radius: 0 0 8px 8px;
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.shl-countdown-bar {
    height: 100%;
    background: var(--shl-accent);
    border-radius: 0 0 8px 8px;
    transition: width 0.9s linear;
}

/* Tabla - columna DESCRIPCION ancha, CODIGO al final (igual SH4) */
.shl-his-col-desc {
    min-width: 200px;
}

.shl-his-col-cie {
    width: 100px;
}

/* Panel estrategias - 3 niveles */
.shl-his-panel-divider {
    height: 1px;
    background: var(--shl-border);
    margin: 0.6rem 0;
}

.shl-his-panel-sublabel {
    font-size: 0.75rem;
    color: var(--shl-text3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.shl-his-subpaquete-btn {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 5px;
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    text-align: left;
    font-size: 0.82rem;
    color: var(--shl-text2);
    transition: all 0.12s;
    width: 100%;
    margin-bottom: 0.25rem;
}

    .shl-his-subpaquete-btn:hover,
    .shl-his-subpaquete-btn.activo {
        border-color: var(--shl-accent);
        color: var(--shl-text);
        background: var(--shl-accent-dim);
    }

.shl-his-btn-aplicar {
    width: 100%;
    background: var(--shl-accent);
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: opacity 0.15s;
}

    .shl-his-btn-aplicar:hover {
        opacity: 0.88;
    }

    .shl-his-btn-aplicar:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Estado activo en estrategia seleccionada */
.shl-his-paquete-btn.activo {
    border-color: var(--shl-accent);
    background: var(--shl-accent-dim);
    color: var(--shl-text);
}

/* ======================================================================
   RESPONSIVE - Tablet (<= 1024px) y Móvil (<= 768px)
   UX4-1: tabla diagnósticos  |  UX4-2: input desc  |  UX4-5: sidebar tablet
   ====================================================================== */

/* UX4-5 - Sidebar colapso en tablet */
@media (max-width: 1024px) {
    .shl-sidebar {
        position: fixed;
        left: -240px;
        z-index: 100;
        transition: left 0.25s;
    }

    .shl-shell.mobile-open .shl-sidebar {
        left: 0;
    }

    .shl-shell.mobile-open .shl-sidebar-backdrop {
        display: block;
    }

    .shl-hamburger {
        display: flex;
    }
}

/* UX4-1 + UX4-2 - Tabla diagnósticos y inputs en móvil/tablet angosto - CONSOLIDADO */
@media (max-width: 768px) {

    /* Sidebar: drawer en tablet pequeño/móvil */
    .shl-sidebar {
        position: fixed;
        left: -240px;
        z-index: 100;
        transition: left 0.25s;
    }

    .shl-shell.mobile-open .shl-sidebar {
        left: 0;
    }

    .shl-shell.mobile-open .shl-sidebar-backdrop {
        display: block;
    }

    .shl-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }

    .shl-hamburger {
        display: flex;
    }

    /* Layout HIS: apila columna principal y panel estrategias */
    .shl-his-layout {
        flex-direction: column;
    }

    .shl-his-panel {
        width: 100%;
        max-height: 260px;
    }

    /* Tabla: ocultar columnas Lab en móvil para que quepa */
    .shl-his-col-labs,
    .shl-his-input-lab {
        display: none;
    }

    /* Columna descripción: ocupa todo el ancho disponible */
    .shl-his-col-desc {
        min-width: 0;
        width: auto;
    }

    .shl-his-input-desc {
        width: 100%;
        min-width: 0;
    }

    /* Barra triaje: wrap en móvil */
    .shl-his-triaje-bar {
        overflow-x: auto;
        flex-wrap: wrap;
        padding-bottom: 0.35rem;
    }

    /* Barra turno/fecha: wrap normal en móvil */
    .shl-his-turno-bar {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .shl-his-fecha-input {
        width: 100%;
    }

    /* Modal CIE: ocupa casi toda la pantalla en móvil */
    .shl-his-modal-cie {
        width: 95vw;
        max-height: 80vh;
    }

    /* Panel estrategias toggle */
    .shl-his-panel-toggle-btn {
        display: flex;
    }

    .shl-his-panel-cuerpo {
        display: none;
    }

        .shl-his-panel-cuerpo.abierto {
            display: block;
        }
}

/* ======================================================================
   UX4 Chat 6 - Cabecera última atención + Autocomplete + Panel móvil
   ====================================================================== */

/* UX4-3 - Cabecera última atención */
.shl-his-ultima-aten {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
    padding: 0.35rem 0.6rem;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--shl-text2);
}

.shl-his-ultima-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--shl-text3);
}

.shl-his-ultima-valor {
    color: var(--shl-accent);
    font-weight: 600;
}

.shl-his-ultima-obs {
    color: var(--shl-text2);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

/* UX4-4 - Autocomplete CIE inline */
.shl-his-desc-wrap {
    position: relative;
}
/* Versión antigua (ya no se usa, se mantiene por compatibilidad) */
.shl-his-autocomplete {
    display: none;
}
/* Versión flotante fixed - escapa cualquier overflow container */
.shl-his-autocomplete-fixed {
    position: fixed;
    transform: translateY(calc(-100% - 6px));
    z-index: 9999;
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
    max-height: 240px;
    overflow-y: auto;
    min-width: 320px;
}

.shl-his-auto-fila {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--shl-border);
    transition: background 0.1s;
}

    .shl-his-auto-fila:last-child {
        border-bottom: none;
    }

    .shl-his-auto-fila:hover {
        background: var(--shl-accent-dim);
    }

.shl-his-auto-codigo {
    font-weight: 600;
    color: var(--shl-accent);
    min-width: 52px;
    font-size: 0.78rem;
}

.shl-his-auto-desc {
    color: var(--shl-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* UX4-MOB - Panel estrategias colapsable en móvil */
.shl-his-panel-toggle-btn {
    display: none; /* visible solo en <=768px via media query */
    width: 100%;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 7px;
    padding: 0.55rem 0.85rem;
    color: var(--shl-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.shl-his-panel-cuerpo {
    /* visible por defecto en desktop */
}

/* ======================================================================
   UX4-B Chat 6 - Fixes CSS
   ====================================================================== */

/* Fix: botón lupa - SVG negro por falta de color */
.shl-his-btn-cie {
    color: var(--shl-text2);
}

    .shl-his-btn-cie:hover {
        color: var(--shl-accent);
    }

/* Fix: columna código más ancha para mostrar código completo + botón lupa */
.shl-his-col-cie {
    width: 140px;
}

.shl-his-input-cie {
    width: 90px;
}

/* Bloque paciente - sección independiente estilo MAUI */
.shl-his-pac-card {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.shl-his-pac-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.shl-his-pac-card-info {
    flex: 1;
    min-width: 0;
}

.shl-his-pac-card-actions {
    flex-shrink: 0;
}

.shl-btn-editar-pac {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid var(--shl-border);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    color: var(--shl-text2);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

    .shl-btn-editar-pac:hover {
        border-color: var(--shl-accent);
        color: var(--shl-accent);
    }

/* Ãšltima atención ampliada - card con diagnósticos */
.shl-his-ultima-card {
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-left: 3px solid var(--shl-accent);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    margin-top: 0.6rem;
}

.shl-his-ultima-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.shl-his-ultima-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--shl-text3);
}

.shl-his-ultima-card-fecha {
    color: var(--shl-accent);
    font-weight: 700;
    font-size: 0.9rem;
}

.shl-his-ultima-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--shl-text2);
    margin-bottom: 0.5rem;
}

.shl-his-ultima-card-eval {
    font-size: 0.78rem;
    color: var(--shl-text2);
    background: var(--shl-bg2);
    border-radius: 5px;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    white-space: pre-line;
}

/* Tabla de diagnósticos previos - compacta, read-only */
.shl-his-ultima-dx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

    .shl-his-ultima-dx-table thead th {
        background: var(--shl-bg2);
        color: var(--shl-text3);
        font-size: 0.72rem;
        font-weight: 600;
        text-transform: uppercase;
        padding: 0.25rem 0.4rem;
        text-align: left;
        border-bottom: 1px solid var(--shl-border);
    }

    .shl-his-ultima-dx-table tbody td {
        padding: 0.2rem 0.4rem;
        color: var(--shl-text);
        border-bottom: 1px solid var(--shl-border);
        vertical-align: middle;
    }

    .shl-his-ultima-dx-table tbody tr:last-child td {
        border-bottom: none;
    }

.shl-his-ultima-dx-cie {
    font-weight: 600;
    color: var(--shl-accent);
    font-size: 0.75rem;
    white-space: nowrap;
}

.shl-his-ultima-dx-tipo {
    font-size: 0.72rem;
    color: var(--shl-text2);
}

.shl-his-ultima-no-dx {
    font-size: 0.78rem;
    color: var(--shl-text3);
    font-style: italic;
    padding: 0.3rem 0;
}

/* ======================================================================
   UX4 - Labels de sección (bloques del formulario HIS)
   ====================================================================== */
.shl-his-seccion {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.25rem 0 0.6rem;
    user-select: none;
}

.shl-his-seccion-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--shl-text2);
    white-space: nowrap;
}

/* -- F6: Códigos Rápidos -- */
.shl-cr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

@media (max-width: 900px) {
    .shl-cr-layout {
        grid-template-columns: 1fr;
    }
}

.shl-cr-panel {
    padding: .75rem;
}

.shl-cr-panel--disabled {
    opacity: .45;
    pointer-events: none;
}

.shl-cr-panel-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.shl-cr-panel-title {
    font-weight: 700;
    font-size: .95rem;
}

.shl-cr-panel-sub {
    font-size: .75rem;
    color: var(--shl-text-muted);
}

.shl-cr-lista {
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: .75rem;
    border: 1px solid var(--shl-border);
    border-radius: .4rem;
}

.shl-cr-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .5rem .6rem;
    cursor: pointer;
    border-bottom: 1px solid var(--shl-border);
    transition: background .15s;
}

    .shl-cr-item:last-child {
        border-bottom: none;
    }

    .shl-cr-item:hover {
        background: var(--shl-hover-bg);
    }

    .shl-cr-item.seleccionado {
        background: var(--shl-selected-bg, rgba(var(--shl-primary-rgb), .12));
    }

.shl-cr-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .4rem;
    border-radius: .25rem;
    flex-shrink: 0;
}

.shl-cr-badge--personal {
    background: #d1fae5;
    color: #065f46;
}

.shl-cr-badge--general {
    background: #dbeafe;
    color: #1e3a8a;
}

.shl-cr-item-info {
    display: flex;
    flex-direction: column;
}

.shl-cr-item-nombre {
    font-size: .85rem;
    font-weight: 600;
}

.shl-cr-item-desc {
    font-size: .75rem;
    color: var(--shl-text-muted);
}

.shl-cr-form-crear {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.shl-cr-actividades-lista {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: .75rem;
}

.shl-cr-form-actividad {
    border-top: 1px solid var(--shl-border);
    padding-top: .75rem;
    margin-top: .5rem;
}

.shl-btn--xs {
    padding: .1rem .35rem;
    font-size: .7rem;
}

/* tabs */
.shl-tabs {
    display: flex;
    gap: .5rem;
    border-bottom: 2px solid var(--shl-border);
}

.shl-tab-btn {
    background: none;
    border: none;
    padding: .5rem 1rem;
    cursor: pointer;
    font-size: .9rem;
    color: var(--shl-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

    .shl-tab-btn.activo {
        color: var(--shl-primary);
        border-bottom-color: var(--shl-primary);
        font-weight: 600;
    }

/* -- Patch Chat8d - Layout de página y componentes -- */

.shl-page-reporte {
    padding: 1.5rem;
    max-width: 1400px;
}

.shl-rep-page-header {
    margin-bottom: 1.25rem;
}

.shl-rep-page-titulo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--shl-text);
}

.shl-rep-page-sub {
    font-size: .85rem;
    color: var(--shl-text2);
    margin-top: .15rem;
}

.shl-reporte-card-filtros {
    margin-bottom: 1rem;
}

.shl-reporte-filtros-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.shl-reporte-filtros-btns {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-left: auto;
}

.shl-reporte-resumen {
    font-size: .82rem;
    color: var(--shl-text2);
    margin-bottom: .75rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--shl-border);
}

.shl-alert {
    padding: .5rem .75rem;
    border-radius: .4rem;
    font-size: .82rem;
}

.shl-alert--ok {
    background: rgba(29, 158, 117, 0.12);
    color: #1d9e75;
    border: 1px solid rgba(29, 158, 117, 0.35);
}

.shl-alert--error {
    background: rgba(216, 90, 48, 0.1);
    color: #D85A30;
    border: 1px solid rgba(216, 90, 48, 0.3);
}

.shl-success-msg {
    color: #4ade80;
    font-size: .8rem;
}

.shl-error-msg {
    color: #f87171;
    font-size: .8rem;
}

.shl-mt-sm {
    margin-top: .5rem;
}

.shl-empty-msg {
    text-align: center;
    color: var(--shl-text-muted, #8b949e);
    font-size: .82rem;
    padding: 1rem .5rem;
}

.shl-loading-sm {
    text-align: center;
    color: var(--shl-text-muted, #8b949e);
    font-size: .82rem;
    padding: .75rem .5rem;
}

.shl-btn--sm {
    padding: .35rem .75rem;
    font-size: .8rem;
}

.shl-table--compact thead th {
    padding: .4rem .6rem;
    font-size: .78rem;
}

.shl-table--compact tbody td {
    padding: .35rem .6rem;
    font-size: .82rem;
}

/* ===========================================================
   Módulo F5 - Reporte HIS
   =========================================================== */

/* -- Botones de turno -- */
.shl-his-turno-grupo {
    display: flex;
    gap: .35rem;
}

.shl-his-turno-btn {
    padding: .35rem .85rem;
    border-radius: .4rem;
    border: 1px solid var(--shl-border);
    background: var(--shl-bg3);
    color: var(--shl-text2);
    font-size: .82rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

    .shl-his-turno-btn:hover {
        background: var(--shl-accent-dim);
        color: var(--shl-text);
    }

    .shl-his-turno-btn.activo {
        background: var(--shl-accent);
        color: #fff;
        border-color: var(--shl-accent);
    }

/* -- Card y wrap de tabla -- */
.shl-reporte-tabla-card {
    padding: 0;
    overflow: hidden;
}

.shl-reporte-tabla-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* -- Tabla principal -- */
.shl-reporte-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
    white-space: nowrap;
}

    .shl-reporte-tabla thead tr {
        background: var(--shl-bg3);
        border-bottom: 2px solid var(--shl-border);
    }

    .shl-reporte-tabla thead th {
        padding: .55rem .7rem;
        text-align: left;
        font-weight: 600;
        font-size: .75rem;
        color: var(--shl-text2);
        letter-spacing: .03em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .shl-reporte-tabla tbody tr {
        border-bottom: 1px solid var(--shl-border);
        transition: background .1s;
    }

        .shl-reporte-tabla tbody tr:hover {
            background: var(--shl-bg2);
        }

        .shl-reporte-tabla tbody tr:last-child {
            border-bottom: none;
        }

.shl-rep-row-alt {
    background: rgba(255,255,255,.018);
}

/* -- Celdas específicas -- */
.shl-reporte-tabla td {
    padding: .55rem .7rem;
    vertical-align: top;
    color: var(--shl-text);
}

.shl-rep-num {
    width: 2rem;
    text-align: center;
    color: var(--shl-text2);
    font-size: .78rem;
}

.shl-rep-nombre {
    min-width: 160px;
    font-weight: 500;
    white-space: normal;
}

.shl-rep-fecha {
    width: 88px;
    color: var(--shl-text2);
    font-size: .78rem;
}

.shl-rep-edad {
    min-width: 90px;
    white-space: normal;
    font-size: .8rem;
}

.shl-rep-sexo {
    width: 40px;
    text-align: center;
}

.shl-rep-hc {
    width: 70px;
    font-family: monospace;
    font-size: .8rem;
}

.shl-rep-fin {
    width: 60px;
    font-size: .78rem;
}

.shl-rep-dist {
    min-width: 90px;
    white-space: normal;
    font-size: .8rem;
}

.shl-rep-cefa {
    min-width: 70px;
    font-size: .78rem;
}

.shl-rep-eval {
    min-width: 80px;
    font-size: .78rem;
}

.shl-rep-dx {
    min-width: 160px;
    white-space: normal;
}

/* -- Items de diagnóstico -- */
.shl-rep-dx-item {
    display: flex;
    align-items: baseline;
    gap: .3rem;
    margin-bottom: .18rem;
    flex-wrap: wrap;
}

.shl-rep-dx-cod {
    font-family: monospace;
    font-size: .8rem;
    color: var(--shl-accent);
    font-weight: 600;
    flex-shrink: 0;
}

.shl-rep-dx-tipo {
    font-size: .72rem;
    color: var(--shl-text2);
    background: var(--shl-bg3);
    padding: .05rem .28rem;
    border-radius: .2rem;
    flex-shrink: 0;
}

.shl-rep-dx-lab {
    font-size: .72rem;
    color: var(--shl-text2);
    flex-shrink: 0;
}

/* -- Texto dim -- */
.shl-text-dim {
    color: var(--shl-text2);
}

/* -- Responsive: tablet y móvil -- */
@media (max-width: 768px) {
    .shl-reporte-filtros-bar {
        gap: .6rem;
    }

    .shl-reporte-filtros-btns {
        margin-left: 0;
        width: 100%;
    }

        .shl-reporte-filtros-btns .shl-btn {
            flex: 1;
            justify-content: center;
        }

    .shl-reporte-tabla {
        font-size: .78rem;
    }

        .shl-reporte-tabla thead th {
            padding: .4rem .5rem;
            font-size: .7rem;
        }

        .shl-reporte-tabla td {
            padding: .45rem .5rem;
        }

    .shl-rep-nombre {
        min-width: 120px;
    }

    .shl-rep-dist {
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .shl-page-reporte {
        padding: .75rem;
    }

    .shl-his-turno-btn {
        padding: .3rem .6rem;
        font-size: .78rem;
    }

    .shl-reporte-tabla {
        font-size: .73rem;
    }
}

/* ===========================================================
   REGISTRO - Secciones con card interna
   =========================================================== */
.reg-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 16px 16px 8px;
    margin-bottom: 14px;
}

.reg-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--shl-accent);
    text-transform: uppercase;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .reg-section-title .reg-section-badge {
        font-size: 9px;
        font-weight: 400;
        color: var(--shl-text2, #888);
        text-transform: none;
        letter-spacing: 0;
    }

/* ===========================================================
   FAB WhatsApp - botón flotante de soporte
   =========================================================== */
.fab-whatsapp {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,211,102,0.4);
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
}

    .fab-whatsapp:hover {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(37,211,102,0.55);
    }

/* ===========================================================
   RESPONSIVE SIDEBAR - tablet y móvil usan hamburguesa
   =========================================================== */

/* TABLET + MÓVIL (max-width: 1024px): hamburguesa, sidebar flotante */
@media (max-width: 1024px) {
    /* Sidebar: oculta fuera de pantalla por defecto */
    .shl-sidebar {
        position: fixed !important;
        left: -240px !important;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 220px !important;
        transition: left 0.28s ease !important;
        overflow-y: auto;
    }

    /* Sidebar entra cuando mobile-open */
    .shl-shell.mobile-open .shl-sidebar {
        left: 0 !important;
    }

    /* Backdrop visible cuando mobile-open */
    .shl-shell.mobile-open .shl-sidebar-backdrop {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Mostrar hamburguesa */
    .shl-hamburger {
        display: flex !important;
        align-items: center;
    }

    /* Sidebar abierta: textos y textos del nav visibles */
    .shl-nav-text,
    .shl-brand-text,
    .shl-sidebar-brand,
    .shl-sidebar-ipress,
    .shl-footer-nombre,
    .shl-footer-ipress {
        display: block !important;
    }

    /* Items del nav alineados a la izquierda con padding normal */
    .shl-nav-item {
        justify-content: flex-start !important;
        padding: 0.6rem 0.75rem !important;
    }

    /* Ocultar botón toggle (ese es solo para desktop) */
    .shl-toggle-btn {
        display: none !important;
    }
}
/* -- Backdrop sidebar - base global -- */
.shl-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    pointer-events: none;
}

/* ====================================================
   FIX PACK - UX/UI mejoras generales
   ==================================================== */

/* FIX 2 - Reporte HIS: estado vacío compacto y discreto */
.shl-reporte-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    color: var(--shl-text3);
    font-size: 0.85rem;
    opacity: 0.7;
}

    .shl-reporte-vacio svg {
        width: 28px;
        height: 28px;
    }

    .shl-reporte-vacio p {
        margin: 0;
    }

/* FIX 3 - Tabla diagnósticos: LAB N1/N2/N3 visibles en tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .shl-his-col-labs,
    .shl-his-input-lab {
        display: table-cell !important;
    }

    /* Columna código + lupa: asegurar que se vea completa */
    .shl-his-col-cie {
        min-width: 130px !important;
    }

    .shl-his-input-cie {
        min-width: 70px !important;
    }
}

/* FIX 4 - Tabla diagnósticos: LAB N1/N2/N3 visibles en móvil (son críticos) */
@media (max-width: 767px) {
    .shl-his-col-labs,
    .shl-his-input-lab {
        display: table-cell !important;
    }

    /* Labs más compactos en móvil */
    .shl-his-col-labs {
        width: 38px !important;
        min-width: 38px !important;
        padding: 0.2rem 0.15rem !important;
    }

    .shl-his-input-lab {
        width: 34px !important;
        min-width: 0 !important;
        padding: 0.15rem 0.1rem !important;
        font-size: 0.75rem !important;
        text-align: center;
    }

    /* Columna código + lupa: visible y con tamaño mínimo */
    .shl-his-col-cie {
        min-width: 110px !important;
        width: 110px !important;
    }

    .shl-his-input-cie {
        min-width: 60px !important;
        width: 60px !important;
        font-size: 0.75rem !important;
    }

    /* Botones lupa y X: siempre visibles */
    .shl-his-btn-lupa,
    .shl-his-btn-del {
        display: inline-flex !important;
        padding: 0.2rem 0.3rem !important;
        min-width: 24px;
    }

    /* Descripción: truncar para que no rompa layout */
    .shl-his-col-desc {
        max-width: 90px !important;
        overflow: hidden;
    }

    .shl-his-input-desc {
        width: 80px !important;
        min-width: 0 !important;
        font-size: 0.75rem !important;
    }
}

/* FIX 5 - Topbar en móvil: badge + usuario en una línea, sin salto */
@media (max-width: 767px) {
    /* Fix topbar-right nowrap */
    .shl-topbar-right {
        flex-wrap: nowrap;
        min-width: 0;
    }

    .shl-topbar-user {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
    }

    .shl-vigencia-badge {
        font-size: 9px;
        padding: 1px 5px;
    }

    .shl-logout-btn {
        padding: 4px 6px;
    }
}

/* FIX 6 - Atención HIS: panel estrategias flotante en móvil - z-index correcto */
@media (max-width: 767px) {
    .shl-his-panel-flotante {
        z-index: 500 !important;
        bottom: 48px;
    }
}

/* ============================================================
   BOTTOM SHEET - Estrategias/Paquetes en tablet y móvil
   ============================================================ */

/* FAB: oculto en desktop */
.shl-his-fab-estrategias {
    display: none;
}

/* FAB visible en tablet y móvil */
@media (max-width: 1024px) {
    .shl-his-fab-estrategias {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        background: var(--shl-bg3);
        border: 1px solid var(--shl-border);
        border-radius: 8px;
        padding: 0.55rem 1.1rem;
        color: var(--shl-text);
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        margin-top: 1rem;
        transition: background 0.15s;
    }

        .shl-his-fab-estrategias:hover {
            background: var(--shl-accent-dim);
            color: var(--shl-accent);
        }

    /* Panel lateral: ocultar en tablet/móvil - lo reemplaza el sheet */
    .shl-his-panel {
        display: none !important;
    }
}

/* Overlay oscuro */
.shl-his-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    transition: opacity 0.25s ease;
    opacity: 0;
}

    .shl-his-sheet-overlay.abierto {
        display: block;
        opacity: 1;
    }

/* Bottom sheet - sube desde abajo */
.shl-his-bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: var(--shl-bg2);
    border-top: 1px solid var(--shl-border);
    border-radius: 16px 16px 0 0;
    padding: 0.75rem 1.25rem 1.5rem;
    max-height: 82vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

    .shl-his-bottom-sheet.abierto {
        transform: translateY(0);
    }

/* Handle visual */
.shl-his-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--shl-border);
    border-radius: 2px;
    margin: 0 auto 0.75rem;
}

/* Header del sheet */
.shl-his-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.shl-his-sheet-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--shl-text);
}

/* Botón cerrar del sheet */
.shl-his-sheet-close {
    background: transparent;
    border: none;
    color: var(--shl-text2);
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background 0.15s;
}

    .shl-his-sheet-close:hover {
        background: var(--shl-bg3);
        color: var(--shl-text);
    }

/* ============================================================
   TEMA CLARO - body.shl-light
   ============================================================ */

body.shl-light {
    --shl-bg: #f5f6f8;
    --shl-bg2: #ffffff;
    --shl-bg3: #edf0f3;
    --shl-border: #d0d7de;
    --shl-text: #1c2128;
    --shl-text2: #57606a;
    --shl-text3: #8c959f;
    --shl-accent: #3B82F6;
    --shl-accent-dim: #dbeafe;
    --shl-hover-bg: #eaf1fb;
    --shl-selected-bg: #dbeafe;
    --shl-input-bg: #ffffff;
    --shl-input-border: #d1d5db;
    --shl-text-primary: #111827;
    --shl-text-muted: #6b7280;
    --shl-card-bg: #ffffff;
}

    body.shl-light .shl-sidebar {
        background: #1e2a3b;
        border-right-color: #2d3f55;
    }

        body.shl-light .shl-sidebar .shl-nav-item {
            color: #c9d8e8;
        }

            body.shl-light .shl-sidebar .shl-nav-item:hover {
                background: rgba(255, 255, 255, 0.08);
                color: #ffffff;
            }

            body.shl-light .shl-sidebar .shl-nav-item.active {
                background: rgba(59, 130, 246, 0.25);
                color: #93c5fd;
            }

        body.shl-light .shl-sidebar .shl-footer-nombre,
        body.shl-light .shl-sidebar .shl-footer-ipress,
        body.shl-light .shl-sidebar .shl-sidebar-brand,
        body.shl-light .shl-sidebar .shl-sidebar-ipress {
            color: #c9d8e8;
        }

    body.shl-light .shl-topbar {
        background: #ffffff;
        border-bottom-color: #d0d7de;
    }

    body.shl-light .shl-vigencia-badge.badge-vigente {
        background: rgba(22, 163, 74, 0.12);
        color: #16a34a;
        border-color: rgba(22, 163, 74, 0.3);
    }

    body.shl-light .fab-whatsapp {
        box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
    }

/* ============================================================
   FIX PACK v2 - UX mejoras generales
   ============================================================ */

/* Labs en historial de pacientes */
.shl-diag-labs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

.shl-diag-lab-item {
    font-size: 0.72rem;
    background: var(--shl-bg);
    border: 1px solid var(--shl-border);
    color: var(--shl-text2);
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    white-space: nowrap;
}

/* FAB Estrategias dentro del formulario */
.shl-his-fab-estrategias {
    display: none;
}

@media (max-width: 1024px) {
    .shl-his-fab-estrategias {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        background: var(--shl-accent-dim);
        border: 1px solid var(--shl-accent);
        border-radius: 8px;
        padding: 0.55rem 1.1rem;
        color: var(--shl-accent);
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 0.75rem;
        width: 100%;
        justify-content: center;
        transition: background 0.15s;
    }

        .shl-his-fab-estrategias:hover {
            background: var(--shl-accent);
            color: #fff;
        }
}

/* Tema claro - fix sidebar toggle */
body.shl-light .shl-toggle-btn {
    color: #c9d8e8;
}

    body.shl-light .shl-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

/* Tema claro - inputs y cards */
body.shl-light .shl-card,
body.shl-light .shl-form-card,
body.shl-light .dash-metrica-card,
body.shl-light .dash-lista-item {
    border-color: var(--shl-border);
}

body.shl-light .shl-input,
body.shl-light .shl-select,
body.shl-light select.shl-input,
body.shl-light .shl-textarea {
    background: var(--shl-input-bg);
    border-color: var(--shl-input-border);
    color: var(--shl-text-primary);
}

body.shl-light .shl-his-tabla thead th {
    background: var(--shl-bg3);
    color: var(--shl-text2);
}

body.shl-light .shl-his-tabla tbody tr:hover {
    background: var(--shl-hover-bg);
}

/* Overlay historial - full height garantizada */
.shl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
}

/* -- Grupo etáreo - overrides tema claro -- */
body.shl-light .shl-etareo--nino {
    background: #e2e8f0;
    color: #475569;
}

body.shl-light .shl-etareo--adolescente {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Adulto Joven (18-29 años) */
body.shl-light .shl-etareo--joven,
body.shl-light .shl-etareo--adulto-joven {
    background: #d1fae5;
    color: #065f46;
}

body.shl-light .shl-etareo--adulto {
    background: #e0f2fe;
    color: #0369a1;
    opacity: 1;
}

body.shl-light .shl-etareo--am {
    background: #fef3c7;
    color: #92400e;
}

body.shl-light .shl-his-ultima-card {
    background: #f0f4f8;
    border-color: #d0d7de;
    border-left-color: #3B82F6;
}

body.shl-light .shl-his-ultima-card-title {
    color: #57606a;
}

body.shl-light .shl-his-ultima-dx-table thead th {
    background: #edf0f3;
    color: #57606a;
}

body.shl-light .shl-his-triaje-bar {
    background: #f0f4f8;
    border-color: #d0d7de;
}

body.shl-light .shl-his-post-guardar {
    background: #dbeafe;
    border-color: #3B82F6;
}

body.shl-light .shl-form-section-title {
    color: #1c2128;
    border-bottom-color: #d0d7de;
}

body.shl-light .shl-his-fab-estrategias {
    background: #dbeafe;
    border-color: #3B82F6;
    color: #1d4ed8;
}

    body.shl-light .shl-his-fab-estrategias:hover {
        background: #3B82F6;
        color: #ffffff;
    }

/* -- HIS rediseño UX - integración con shl-form-card -- */
.shl-his-form-rediseno {
    max-width: 100%;
}

/* -- HIS rediseño UX - integración con shl-form-card -- */
.shl-his-pac-inner {
    margin-bottom: 0.5rem;
}

    .shl-his-pac-inner .shl-his-pac-nombre {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--shl-text);
        margin-bottom: 0.3rem;
    }

    .shl-his-pac-inner .shl-his-pac-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        font-size: 0.88rem;
        color: var(--shl-text2);
    }

/* Card paciente - separación visual del formulario */
.shl-his-form-rediseno {
    max-width: 100%;
    margin-bottom: 1rem;
}

/* Card formulario atención */
.shl-his-form-atencion {
    max-width: 100%;
}

/* =======================================================================
   MÓDULO ADMIN USUARIOS
   ======================================================================= */
.shl-admin-resumen {
    display: flex;
    gap: .75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.shl-admin-resumen-item {
    flex: 1 1 70px;
    background: var(--shl-card-bg);
    border: 1px solid var(--shl-border);
    border-radius: 10px;
    padding: .6rem .75rem;
    text-align: center;
}

.shl-admin-resumen-item--warn {
    border-color: #f59e0b;
}

.shl-admin-resumen-item--danger {
    border-color: var(--shl-danger, #ef4444);
}

.shl-admin-resumen-num {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--shl-text);
}

.shl-admin-resumen-label {
    font-size: .72rem;
    color: var(--shl-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Cards de usuario */
.shl-admin-user-card {
    background: var(--shl-card-bg);
    border: 1px solid var(--shl-border);
    border-left: 4px solid var(--shl-border);
    border-radius: 10px;
    padding: .9rem 1rem;
    margin-bottom: .6rem;
    transition: box-shadow .15s;
}

    .shl-admin-user-card.activo {
        border-left-color: var(--shl-success, #22c55e);
    }

    .shl-admin-user-card.alerta {
        border-left-color: #f59e0b;
    }

    .shl-admin-user-card.vencido {
        border-left-color: var(--shl-danger, #ef4444);
    }

    .shl-admin-user-card.bloqueado {
        border-left-color: #8b5cf6;
    }

    .shl-admin-user-card.baja {
        border-left-color: var(--shl-text-muted);
        opacity: .7;
    }

.shl-admin-user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .4rem;
}

.shl-admin-user-nombre {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    color: var(--shl-text);
}

.shl-admin-user-sub {
    display: block;
    font-size: .78rem;
    color: var(--shl-text-muted);
}

.shl-admin-user-ipress {
    display: block;
    font-size: .75rem;
    color: var(--shl-text-muted);
    margin-top: .1rem;
}

.shl-admin-user-vigencia {
    font-size: .8rem;
    color: var(--shl-text-muted);
    margin-bottom: .6rem;
}

.shl-admin-user-acciones {
    display: flex;
    gap: .4rem;
}

.shl-admin-user-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
    flex-shrink: 0;
}

/* Badges de estado */
.shl-admin-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--shl-border);
    color: var(--shl-text-muted);
}

.shl-admin-badge--activo {
    background: rgba(34,197,94,.15);
    color: #16a34a;
}

.shl-admin-badge--alerta {
    background: rgba(245,158,11,.15);
    color: #b45309;
}

.shl-admin-badge--vencido {
    background: rgba(239,68,68,.15);
    color: #dc2626;
}

.shl-admin-badge--bloqueado {
    background: rgba(139,92,246,.15);
    color: #7c3aed;
}

.shl-admin-badge--baja {
    background: var(--shl-border);
    color: var(--shl-text-muted);
}

.shl-admin-badge--nivel {
    background: rgba(99,102,241,.12);
    color: #4f46e5;
}

/* Botón sm */
.shl-btn--sm {
    padding: .3rem .75rem;
    font-size: .82rem;
}

/* Panel de gestión (slide desde abajo en móvil, lateral en desktop) */
.shl-admin-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--shl-card-bg);
    border-top: 1px solid var(--shl-border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.18);
    z-index: 1100;
    padding-bottom: env(safe-area-inset-bottom, 1rem);
}

.shl-admin-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 1rem .75rem;
    border-bottom: 1px solid var(--shl-border);
    position: sticky;
    top: 0;
    background: var(--shl-card-bg);
    z-index: 1;
}

.shl-admin-panel-nombre {
    font-weight: 700;
    font-size: 1rem;
    color: var(--shl-text);
}

.shl-admin-panel-sub {
    font-size: .78rem;
    color: var(--shl-text-muted);
}

.shl-admin-panel-body {
    padding: 1rem;
}

@media (min-width: 768px) {
    .shl-admin-panel {
        position: relative;
        left: auto;
        bottom: auto;
        top: auto;
        right: auto;
        transform: none;
        width: 420px;
        max-height: 90vh;
        border-radius: 14px;
        border: 1px solid var(--shl-border);
        box-shadow: 0 8px 40px rgba(0,0,0,.22);
    }
}

/* Ítem admin en sidebar */
.shl-nav-item--admin {
    color: var(--shl-accent) !important;
}

/* Tema claro - overrides admin */
body.shl-light .shl-admin-badge--activo {
    background: rgba(22,163,74,.12);
    color: #15803d;
}

body.shl-light .shl-admin-badge--alerta {
    background: rgba(202,138,4,.12);
    color: #92400e;
}

body.shl-light .shl-admin-badge--vencido {
    background: rgba(220,38,38,.1);
    color: #b91c1c;
}

body.shl-light .shl-admin-badge--bloqueado {
    background: rgba(124,58,237,.1);
    color: #6d28d9;
}

body.shl-light .shl-admin-badge--nivel {
    background: rgba(79,70,229,.1);
    color: #4338ca;
}
/* Admin panel ? alinear con modal est?ndar */
.shl-admin-panel {
    background: var(--shl-bg2) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.4) !important;
}

.shl-admin-panel-header {
    background: var(--shl-bg2) !important;
    padding: 1.25rem 1.25rem 1rem !important;
}

.shl-admin-panel-body {
    padding: 1.25rem !important;
}

/* ===============================================================
   INDICACIÓN POR FILA - tabla diagnósticos Atención HIS
   Chat 11 - 10/05/2026
   =============================================================== */
.shl-his-fila-indicacion td {
    padding: 0.15rem 0.5rem 0;
    border-bottom: none;
}

.shl-his-indicacion {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.74rem;
    color: var(--shl-text2);
    background: var(--shl-bg3);
    border-left: 2px solid var(--shl-accent);
    border-radius: 0 4px 4px 0;
    padding: 0.25rem 0.5rem;
    line-height: 1.4;
}
/* -- Lab con asterisco -- */
.shl-his-input-lab.shl-his-lab--asterisco {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.08) !important;
    color: #f59e0b !important;
}

body.shl-light .shl-his-input-lab.shl-his-lab--asterisco {
    border-color: #d97706 !important;
    background: rgba(217, 119, 6, 0.08) !important;
    color: #92400e !important;
}
/* -- Subpaquete row con botón lupa -- */
.shl-his-subpaquete-row {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

    .shl-his-subpaquete-row .shl-his-subpaquete-btn {
        flex: 1;
        margin-bottom: 0;
    }

.shl-his-subpaquete-preview-btn {
    flex-shrink: 0;
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 5px;
    color: var(--shl-text3);
    cursor: pointer;
    padding: 0 0.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}

    .shl-his-subpaquete-preview-btn:hover {
        border-color: var(--shl-accent);
        color: var(--shl-accent);
        background: var(--shl-accent-dim);
    }
/* -- Dialog Preview Paquete -- */
.shl-his-preview-paquete {
    background: var(--shl-bg2);
    border: 1px solid var(--shl-border);
    border-radius: 12px;
    width: min(640px, 95vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

.shl-his-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.shl-his-preview-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--shl-border);
}

.shl-his-preview-item {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--shl-border);
    margin-bottom: 0.35rem;
    flex-shrink: 0;
}

.shl-his-preview-indicacion {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    font-size: 0.73rem;
    color: var(--shl-text2);
    background: var(--shl-bg3);
    border-left: 2px solid var(--shl-accent);
    padding: 0.25rem 0.6rem;
    line-height: 1.4;
}

.shl-his-preview-fila {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    flex-wrap: wrap;
    background: var(--shl-bg2);
}

.shl-his-preview-orden {
    font-size: 0.72rem;
    color: var(--shl-text3);
    min-width: 20px;
    flex-shrink: 0;
}

.shl-his-preview-desc {
    flex: 1;
    font-size: 0.82rem;
    color: var(--shl-text);
    min-width: 0;
}

    .shl-his-preview-desc.asterisco {
        color: #f59e0b;
    }

body.shl-light .shl-his-preview-desc.asterisco {
    color: #92400e;
}

.shl-his-preview-meta {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.shl-his-preview-tipo {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--shl-accent);
    background: var(--shl-accent-dim);
    border-radius: 3px;
    padding: 1px 5px;
}

    .shl-his-preview-tipo.asterisco {
        color: #f59e0b;
        background: rgba(245,158,11,0.08);
        border: 1px solid #f59e0b;
    }

body.shl-light .shl-his-preview-tipo.asterisco {
    color: #92400e;
    background: rgba(217,119,6,0.08);
    border-color: #d97706;
}

.shl-his-preview-lab {
    font-size: 0.72rem;
    color: var(--shl-text2);
    background: var(--shl-bg3);
    border: 1px solid var(--shl-border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: monospace;
}

    .shl-his-preview-lab.asterisco {
        color: #f59e0b;
        border-color: #f59e0b;
        background: rgba(245,158,11,0.08);
    }

body.shl-light .shl-his-preview-lab.asterisco {
    color: #92400e;
    border-color: #d97706;
    background: rgba(217,119,6,0.08);
}

.shl-his-preview-cie {
    font-size: 0.72rem;
    color: var(--shl-text3);
    font-family: monospace;
    background: var(--shl-bg3);
    border-radius: 3px;
    padding: 1px 5px;
}

    .shl-his-preview-cie.asterisco {
        color: #f59e0b;
        background: rgba(245,158,11,0.08);
        border: 1px solid #f59e0b;
    }

body.shl-light .shl-his-preview-cie.asterisco {
    color: #92400e;
    background: rgba(217,119,6,0.08);
    border-color: #d97706;
}

@media (max-width: 480px) {
    .shl-his-preview-paquete {
        border-radius: 12px 12px 0 0;
        max-height: 90vh;
    }
}

/* ===============================================================
   FIX UX - Dialog Preview + Números de fila
   Chat 11 - 10/05/2026
   =============================================================== */

/* -- Header del preview: padding que faltaba -- */
.shl-his-preview-paquete .shl-his-modal-header {
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid var(--shl-border);
    align-items: flex-start;
}

/* -- Body: más respiro entre items -- */
.shl-his-preview-body {
    padding: 1rem 1.1rem;
    gap: 0.5rem;
}

/* -- Item: más aire interno -- */
.shl-his-preview-fila {
    padding: 0.5rem 0.75rem;
    gap: 0.6rem;
}

/* -- Indicación dentro del preview: más padding -- */
.shl-his-preview-indicacion {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.4rem;
}

/* -- Footer: padding más cómodo -- */
.shl-his-preview-footer {
    padding: 0.9rem 1.25rem;
}

/* -- Descripción en preview: no tan comprimida -- */
.shl-his-preview-desc {
    font-size: 0.84rem;
    line-height: 1.35;
}

/* -- Números de fila (#) en tabla diagnósticos --
   Color acento suave: azul primario tenue con peso.
   Destaca sin romper jerarquía visual.                 */
.shl-his-num-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--shl-accent);
    opacity: 0.7;
    letter-spacing: 0.02em;
}

body.shl-light .shl-his-num-label {
    color: var(--shl-accent);
    opacity: 0.85;
}

/* -- Número de orden en preview también destacado -- */
.shl-his-preview-orden {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--shl-accent);
    opacity: 0.7;
    min-width: 22px;
}

/* ===============================================================
   TOOLTIP Indicación en número de fila + Fix dialog preview
   Chat 11 - 10/05/2026
   =============================================================== */

/* -- Tooltip en número de fila -- */
.shl-his-num-label {
    position: relative;
    cursor: default;
}

    .shl-his-num-label.shl-has-tooltip {
        cursor: help;
    }

.shl-his-num-tooltip-box {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    width: 260px;
    background: var(--shl-bg2);
    border: 1px solid var(--shl-accent);
    border-radius: 7px;
    padding: 0.5rem 0.7rem;
    font-size: 0.73rem;
    font-weight: 400;
    color: var(--shl-text);
    line-height: 1.45;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    z-index: 500;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

    /* Flecha izquierda del tooltip */
    .shl-his-num-tooltip-box::before {
        content: '';
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-50%);
        border: 5px solid transparent;
        border-right-color: var(--shl-accent);
    }

.shl-his-num-label.shl-has-tooltip:hover .shl-his-num-tooltip-box {
    display: block;
    opacity: 1;
}

/* -- Fix dialog preview: items no cortados -- */
.shl-his-preview-item {
    min-height: unset;
    break-inside: avoid;
}

.shl-his-preview-indicacion {
    border-left-width: 3px;
}

    /* Ícono info en preview - color neutral que funciona en ambos temas */
    .shl-his-preview-indicacion svg,
    .shl-his-indicacion svg {
        stroke: var(--shl-accent);
        opacity: 1;
    }

/* -- FIX tooltip dirección: baja desde el número (evita clip overflow-x) -- */
.shl-his-num-tooltip-box {
    left: 0;
    top: 100%;
    transform: none;
    margin-left: 0;
    margin-top: 6px;
    width: 280px;
}

    .shl-his-num-tooltip-box::before {
        right: auto;
        left: 10px;
        top: auto;
        bottom: 100%;
        transform: none;
        border-right-color: transparent;
        border-bottom-color: var(--shl-accent);
    }

/* -- Indicación inline en columna descripción -- */
.shl-his-desc-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.shl-his-indicacion-inline {
    position: relative;
    flex-shrink: 0;
    color: var(--shl-accent);
    opacity: 0.8;
    cursor: help;
    display: flex;
    align-items: center;
    line-height: 1;
}

.shl-his-indicacion-tooltip {
    display: none !important; /* Manejado por #shl-tooltip-fixed via JS */
}

.shl-his-indicacion-inline:hover .shl-his-indicacion-tooltip {
    display: none !important;
}
/* -- Fix: input descripción cede espacio al ícono de indicación -- */
.shl-his-desc-wrap .shl-his-input-desc {
    flex: 1;
    min-width: 0;
    width: auto;
}

/* -- Asterisco en descripcion, cie y tipo-dx -- */
.shl-his-input-desc.shl-his-lab--asterisco {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.08) !important;
    color: #f59e0b !important;
}

body.shl-light .shl-his-input-desc.shl-his-lab--asterisco {
    border-color: #d97706 !important;
    background: rgba(217, 119, 6, 0.08) !important;
    color: #92400e !important;
}

.shl-his-input-cie.shl-his-lab--asterisco {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.08) !important;
    color: #f59e0b !important;
}

body.shl-light .shl-his-input-cie.shl-his-lab--asterisco {
    border-color: #d97706 !important;
    background: rgba(217, 119, 6, 0.08) !important;
    color: #92400e !important;
}

.shl-his-select-tipo.shl-his-lab--asterisco {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.08) !important;
    color: #f59e0b !important;
}

body.shl-light .shl-his-select-tipo.shl-his-lab--asterisco {
    border-color: #d97706 !important;
    background: rgba(217, 119, 6, 0.08) !important;
    color: #92400e !important;
}

/* -- Indicacion icon info (ambar) -- */
.shl-his-indicacion-icon-info {
    color: #f59e0b;
    flex-shrink: 0;
    cursor: default;
}

body.shl-light .shl-his-indicacion-icon-info {
    color: #d97706;
}

/* -- Indicacion icon link (azul clickeable) -- */
.shl-his-indicacion-icon-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: #60a5fa;
    text-decoration: none;
    border-radius: 3px;
    transition: color 0.15s, opacity 0.15s;
}

.shl-his-indicacion-icon-link:hover {
    color: #93c5fd;
    opacity: 0.85;
}

body.shl-light .shl-his-indicacion-icon-link {
    color: #2563eb;
}

body.shl-light .shl-his-indicacion-icon-link:hover {
    color: #1d4ed8;
}

/* -- Fix opacidad icono indicacion en modo oscuro -- */
.shl-his-indicacion-inline {
    opacity: 1;
}

.shl-his-indicacion-inline .shl-his-indicacion-icon-info {
    opacity: 0.85;
}

.shl-his-indicacion-inline .shl-his-indicacion-icon-link {
    opacity: 1;
}

/* -- Fix color icono info: usa accent igual que el tooltip -- */
.shl-his-indicacion-icon-info {
    color: var(--shl-accent) !important;
    opacity: 0.9;
}

.shl-his-indicacion-icon-link {
    color: var(--shl-accent) !important;
    opacity: 0.9;
}

.shl-his-indicacion-icon-link:hover {
    opacity: 1;
    text-decoration: underline;
}

body.shl-light .shl-his-indicacion-icon-info {
    color: var(--shl-accent) !important;
    opacity: 0.85;
}

body.shl-light .shl-his-indicacion-icon-link {
    color: var(--shl-accent) !important;
    opacity: 0.85;
}

body.shl-light .shl-his-indicacion-icon-link:hover {
    opacity: 1;
}



.shl-paq-id {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--shl-text-muted, #9ca3af);
    margin-right: 0.35rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.shl-his-subpaquete-btn {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Inputs clínicos triaje */

.ant-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ant-unit {
    position: absolute;
    right: 0.85rem;
    font-size: .72rem;
    opacity: .72;
    pointer-events: none;
}

.ant-no-spin::-webkit-inner-spin-button,
.ant-no-spin::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ant-no-spin {
    -moz-appearance: textfield;
    padding-right: 2.6rem;
}

.ant-warn-msg {
    display: block;
    margin-top: .2rem;
    font-size: .68rem;
    color: #d9a441;
    line-height: 1.2;
}

.ant-input-wrap--warn .ant-input {
    border-color: #d9a441 !important;
    box-shadow: 0 0 0 1px rgba(217,164,65,.15);
}

/* ── Ícono de ayuda contextual ──────────────────────────────────────────── */
.shl-help-icon {
    cursor: pointer;
    color: var(--shl-primary, #1976d2);
    margin-left: 8px;
    vertical-align: middle;
    opacity: .75;
    transition: opacity .15s;
    flex-shrink: 0;
}
.shl-help-icon:hover { opacity: 1; }

/* ── Modal de ayuda con rangos de referencia ─────────────────────────────── */
.shl-modal-ayuda-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
.shl-modal-ayuda {
    background: var(--shl-surface, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    padding: 1.5rem 1.75rem 1.25rem;
    min-width: 320px;
    max-width: 480px;
    width: 92vw;
}
.shl-modal-ayuda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: .5rem;
}
.shl-modal-ayuda-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--shl-text1, #1a1a1a);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.shl-modal-ayuda-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    margin-bottom: .75rem;
}
.shl-modal-ayuda-table th {
    text-align: left;
    font-weight: 600;
    color: var(--shl-text2, #444);
    padding: .3rem .5rem;
    border-bottom: 1px solid var(--shl-border, #e0e0e0);
}
.shl-modal-ayuda-table td {
    padding: .3rem .5rem;
    color: var(--shl-text1, #1a1a1a);
    border-bottom: 1px solid var(--shl-border-light, #f0f0f0);
}
.shl-modal-ayuda-note {
    font-size: .78rem;
    color: var(--shl-text3, #888);
    margin-top: .5rem;
}
.shl-modal-ayuda-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--shl-text3, #888);
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background .15s;
}

/* ── Filtros de paquetes — toggles ─────────────────────────────────── */
.shl-filter-bar {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem 0.3rem;
    flex-wrap: wrap;
}
.shl-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--shl-text-muted, #6b7280);
    background: var(--shl-bg-alt, #f3f4f6);
    border: 1px solid var(--shl-border, #e5e7eb);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.shl-filter-toggle input[type="checkbox"] {
    display: none;
}
.shl-filter-toggle.activo {
    background: var(--shl-accent, #2563eb);
    color: #fff;
    border-color: var(--shl-accent, #2563eb);
}
.shl-filter-toggle:hover:not(.activo) {
    border-color: var(--shl-accent, #2563eb);
    color: var(--shl-accent, #2563eb);
}
.shl-modal-ayuda-close:hover { background: var(--shl-hover, #f5f5f5); }

/* Reemplaza los estilos de shl-filter-toggle con toggle switch real */
.shl-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--shl-border, #e5e7eb);
    margin-bottom: 0.25rem;
}
.shl-filter-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--shl-text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.1rem;
}
.shl-toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
}
.shl-toggle-switch input[type="checkbox"] {
    display: none;
}
.shl-toggle-track {
    position: relative;
    width: 2rem;
    height: 1.1rem;
    background: var(--shl-border, #d1d5db);
    border-radius: 999px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.shl-toggle-thumb {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 0.8rem;
    height: 0.8rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.shl-toggle-switch input:checked ~ .shl-toggle-track {
    background: var(--shl-accent, #2563eb);
}
.shl-toggle-switch input:checked ~ .shl-toggle-track .shl-toggle-thumb {
    transform: translateX(0.9rem);
}
.shl-toggle-text {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--shl-text-secondary, #4b5563);
}

/* Override ant-warn con CSS vars para soporte dark mode */
.ant-warn-msg {
    color: var(--shl-warning, #d97706) !important;
}
.ant-input-wrap--warn .ant-input {
    border-color: var(--shl-warning, #d97706) !important;
    box-shadow: 0 0 0 1px rgba(217,164,65,.15);
}

/* Fix hardcoded warning colors - dark mode safe */
.ant-warn-msg {
    color: var(--shl-warning, #d97706) !important;
}
.ant-input-wrap--warn .ant-input {
    border-color: var(--shl-warning, #d97706) !important;
    box-shadow: 0 0 0 1px rgba(217,164,65,.15);
}

/* -- Boton toggle de tema en topbar */
.shl-theme-toggle-btn {
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: var(--shl-text3, #888);
    padding: 4px 6px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}
.shl-theme-toggle-btn:hover {
    color: var(--shl-text);
    background-color: var(--shl-bg3);
}
body.shl-light .shl-theme-toggle-btn {
    color: var(--shl-text2, #57606a);
}
body.shl-light .shl-theme-toggle-btn:hover {
    color: var(--shl-text);
    background-color: var(--shl-bg3);
}

/* ── ReporteHIS — Columna acciones ───────────────────────── */
.shl-rep-th-acciones {
    width: 72px;
    min-width: 72px;
    text-align: center;
}
.shl-rep-acciones {
    text-align: center;
    white-space: nowrap;
}
.shl-rep-btn-accion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin: 0 2px;
}
.shl-rep-btn-editar {
    color: var(--shl-accent);
    border-color: color-mix(in srgb, var(--shl-accent) 30%, transparent);
}
.shl-rep-btn-editar:hover {
    background: color-mix(in srgb, var(--shl-accent) 12%, transparent);
}
.shl-rep-btn-anular {
    color: var(--shl-danger, #e05252);
    border-color: color-mix(in srgb, var(--shl-danger, #e05252) 30%, transparent);
}
.shl-rep-btn-anular:hover {
    background: color-mix(in srgb, var(--shl-danger, #e05252) 12%, transparent);
}
/* ── Modal anulación ──────────────────────────────────────── */
.shl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.shl-modal-card {
    background: var(--shl-bg2);
    border-radius: 12px;
    width: min(440px, 94vw);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}
.shl-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--shl-border, #e5e7eb);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--shl-danger, #e05252);
}
.shl-modal-body {
    padding: 18px 20px;
}
.shl-modal-paciente {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 14px;
    color: var(--shl-text);
}
.shl-textarea-motivo {
    resize: vertical;
    min-height: 72px;
}
.shl-field-error {
    display: block;
    color: var(--shl-danger, #e05252);
    font-size: 0.78rem;
    margin-top: 4px;
}
.shl-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--shl-border, #e5e7eb);
}
.shl-btn--danger {
    background: var(--shl-danger, #e05252);
    color: #fff;
    border: none;
}
.shl-btn--danger:hover:not(:disabled) {
    background: color-mix(in srgb, var(--shl-danger, #e05252) 85%, #000);
}
.shl-required {
    color: var(--shl-danger, #e05252);
}

/* ── Modal anulación: header fix (evita conflicto con .shl-modal-header global) */
.shl-modal-anular-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--shl-border);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--shl-danger, #e05252);
}

/* ── Dashboard reloj tiempo real ───────────────────────────────────────── */
/* -- Wrapper derecho: reloj arriba, turno abajo -- */
.dash-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.dash-reloj {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.15;
}

.dash-reloj-hora {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--shl-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.dash-reloj-fecha {
    font-size: 0.72rem;
    color: var(--shl-text3);
    text-transform: capitalize;
}

@media (max-width: 700px) {
    .dash-header-right {
        width: 100%;
        align-items: flex-start;
        order: 3;
        padding-top: 0.25rem;
        border-top: 1px solid var(--shl-border);
    }
    .dash-reloj {
        flex-direction: row;
        align-items: baseline;
        gap: 0.5rem;
    }
    .dash-reloj-hora {
        font-size: 1.1rem;
    }
    .dash-reloj-fecha {
        font-size: 0.7rem;
    }
    .dash-turno-selector {
        justify-content: flex-start;
    }
}

/* ── Registro: chips sugerencia nickname ───────────────────────────────── */
.reg-nickname-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.reg-nickname-chip {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--shl-accent);
    background: var(--shl-accent-dim);
    color: var(--shl-accent);
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.15s;
}

    .reg-nickname-chip:hover {
        background: var(--shl-accent);
        color: #fff;
    }

/* ── shl-alert overrides tema claro ──────────────────────────────────── */
body.shl-light .shl-alert-error {
    color: #c0392b;
}
body.shl-light .shl-alert-success {
    color: #1a7a40;
}

/* ── Estrategia row: botón selección + botón fuente PDF ─────────────── */
.shl-his-paquete-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.shl-his-paquete-row > .shl-his-paquete-btn {
    flex: 1;
    min-width: 0;
    width: auto;
}
.shl-his-fuente-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--shl-border);
    color: var(--shl-text3);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
    .shl-his-fuente-btn:hover {
        background: var(--shl-accent-dim);
        color: var(--shl-accent);
        border-color: var(--shl-accent);
    }

/* ── Estrategias — headers de categoría (F-config-A) ────────────────── */
.shl-his-categoria-header {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--shl-text3);
    padding: 0.55rem 0 0.25rem;
    border-bottom: 1px solid var(--shl-border);
    margin-bottom: 0.15rem;
    margin-top: 0.1rem;
}
.shl-his-panel-lista > .shl-his-categoria-header:first-child {
    padding-top: 0.1rem;
}

/* ── Registro desktop — layout 2 columnas ───────────────────────────── */
.reg-card {
    max-width: 820px;
    padding: 36px 40px;
}

.reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
    align-items: start;
}

.reg-col {
    display: flex;
    flex-direction: column;
}

@media (max-width: 640px) {
    .reg-card {
        padding: 28px 20px;
    }
    .reg-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ── Registro móvil — fix padding lateral ────────────────────────────── */
@media (max-width: 640px) {
    .auth-page {
        padding: 16px 12px;
        align-items: flex-start;
    }

    .auth-card {
        border-radius: 10px;
    }

    .reg-card {
        padding: 24px 18px;
    }
}

/* ── Auth container móvil — fix padding lateral ─────────────────────── */
@media (max-width: 640px) {
    .auth-container {
        padding: 16px 12px;
        align-items: flex-start;
        box-sizing: border-box;
    }
}

/* ── Auth container — flex-col para centrar card + WhatsApp juntos ── */
.auth-container {
    flex-direction: column;
    gap: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOOLTIP FIXED — escapa de overflow:auto/hidden de cualquier contenedor
   Gestionado íntegramente por JS (shl-interop.js)
   ═══════════════════════════════════════════════════════════════════════════════ */
#shl-tooltip-fixed {
    display: none;
    position: fixed;
    width: 300px;
    max-width: calc(100vw - 16px);
    background: var(--shl-bg2);
    border: 1px solid var(--shl-accent);
    border-radius: 7px;
    padding: 0.5rem 0.7rem;
    font-size: 0.73rem;
    color: var(--shl-text);
    line-height: 1.45;
    box-shadow: 0 4px 18px rgba(0,0,0,0.38);
    z-index: 99999;
    white-space: normal;
    pointer-events: none;
    word-break: break-word;
}

#shl-tooltip-fixed.shl-tooltip-fixed-visible {
    display: block;
}
