@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Open+Sans:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Poppins:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   PACI Core — Tema Profesional (igual a imagen de referencia)
   Variables sobrescritas vía #paci-dynamic-styles desde backend
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Colores primarios ── */
    --paci-primary: #2563eb;
    --paci-primary-rgb: 37, 99, 235;
    --paci-primary-hover: #1d4ed8;
    --paci-secondary: #1e40af;
    --paci-secondary-rgb: 30, 64, 175;

    /* ── Sidebar (degradado configurable desde backend) ── */
    --paci-sidebar-bg-start: #1e3a8a;
    --paci-sidebar-bg-end: #1e40af;
    --paci-sidebar-gradient: linear-gradient(180deg, var(--paci-sidebar-bg-start) 0%, var(--paci-sidebar-bg-end) 100%);
    --paci-sidebar-text: #ffffff;
    --paci-sidebar-text-muted: rgba(255, 255, 255, 0.65);
    --paci-sidebar-hover-bg: rgba(255, 255, 255, 0.1);
    --paci-sidebar-active-bg: rgba(255, 255, 255, 0.18);
    --paci-sidebar-active-border: rgba(255, 255, 255, 0.35);

    /* ── Íconos del sidebar (color configurable) ── */
    --paci-icon-color: rgba(255, 255, 255, 0.82);
    --paci-icon-color-hover: #ffffff;

    /* ── Tipografía (configurable desde backend) ── */
    --paci-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --paci-font-size-base: 14px;

    /* ── Fondos ── */
    --paci-bg: #f1f5f9;
    --paci-card-bg: #ffffff;
    --paci-modal-bg: #ffffff;
    --paci-topbar-bg: #ffffff;

    /* ── Texto oscuro (como en la imagen) ── */
    --paci-text-color: #334155;
    --paci-text-muted: #64748b;
    --paci-text-heading: #1e293b;

    /* ── Bordes ── */
    --paci-border: #cbd5e1;
    --paci-border-dark: #94a3b8;
    --paci-border-width: 1px;
    --paci-border-radius-sm: 8px;
    --paci-border-radius: 10px;
    --paci-border-radius-lg: 16px;

    /* ── Sombras (para inputs, modales, cards) ── */
    --paci-input-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    --paci-input-focus-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    --paci-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --paci-card-hover-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.03);
    --paci-modal-shadow: 0 25px 60px rgba(0, 0, 0, 0.12), 0 10px 20px rgba(0, 0, 0, 0.06);
    --paci-modal-border-radius: 16px;

    /* ── Transiciones ── */
    --paci-transition: all 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET / CONTENEDOR PRINCIPAL
   ═══════════════════════════════════════════════════════════════════════════ */
#paci-core-app * {
    box-sizing: border-box;
}

#paci-core-app {
    font-family: var(--paci-font-family);
    font-size: var(--paci-font-size-base);
    display: flex;
    height: 90vh;
    min-height: 600px;
    background: var(--paci-bg);
    color: var(--paci-text-color);
    border-radius: var(--paci-border-radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR — Azul con degradado (configurable), igual a la imagen
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--paci-sidebar-gradient);
    color: var(--paci-sidebar-text);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    transition: width 0.24s ease, min-width 0.24s ease, transform 0.24s ease, opacity 0.2s ease;
}

/* Pestaña para restaurar menú colapsado */
.paci-sidebar-restore {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 12;
    width: 34px;
    min-height: 88px;
    padding: 10px 6px;
    border: none;
    border-radius: 0 10px 10px 0;
    background: var(--paci-sidebar-gradient);
    color: #fff;
    cursor: pointer;
    box-shadow: 4px 0 14px rgba(0, 0, 0, 0.18);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--paci-transition);
}

.paci-sidebar-restore:hover {
    width: 38px;
    filter: brightness(1.06);
}

.paci-sidebar-restore-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.paci-sidebar-restore-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.paci-sidebar-collapse-btn {
    width: 100%;
    margin: 0;
    flex-shrink: 0;
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--paci-transition);
}

.paci-sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.paci-sidebar-collapse-icon {
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.95;
}

.paci-sidebar-collapse-label {
    letter-spacing: 0.01em;
}

.paci-sidebar-inst-name {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
    word-break: break-word;
}

@media (min-width: 769px) {
    #paci-core-app.paci-nav-collapsed .paci-sidebar {
        width: 0;
        min-width: 0;
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        box-shadow: none;
    }

    #paci-core-app.paci-nav-collapsed .paci-sidebar-restore {
        display: flex;
    }

    #paci-core-app.paci-nav-collapsed .paci-main {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* Patrón decorativo de ondas sutiles en el sidebar */
.paci-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 50%, rgba(255, 255, 255, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 20%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 85%, rgba(0, 0, 0, 0.08) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.paci-sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    background:
        radial-gradient(ellipse at 25% 100%, rgba(255, 255, 255, 0.04) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 100%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Header del sidebar — logo + nombre */
.paci-sidebar-header {
    padding: 22px 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    font-weight: 700;
    font-size: 1.08rem;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}

.paci-sidebar-header-top {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-width: 0;
}

.paci-sidebar-header img {
    height: 36px;
    width: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Menú de navegación */
.paci-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 14px 8px 14px 11px;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.55) rgba(255, 255, 255, 0.12);
}

/* Título de grupo (CONFIGURACIÓN BÁSICA) */
.paci-menu-group-title {
    padding: 0 14px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--paci-sidebar-text-muted);
    margin: 18px 0 8px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: var(--paci-transition);
}

.paci-menu-group-title:hover {
    color: rgba(255, 255, 255, 0.88);
}

.paci-menu-group-title .paci-chevron {
    font-size: 0.6rem;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.paci-menu-group-title .paci-chevron.collapsed {
    transform: rotate(-90deg);
}

/* Ítem del menú */
.paci-menu-item {
    padding: 10px 14px;
    margin: 2px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--paci-sidebar-text);
    transition: var(--paci-transition);
    font-size: 0.87rem;
    border-radius: 10px;
    border: 1px solid transparent;
    position: relative;
    font-weight: 400;
    text-decoration: none;
}

/* Barra indicadora izquierda del ítem activo */
.paci-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #ffffff;
    border-radius: 0 3px 3px 0;
    transition: height 0.25s ease;
    opacity: 0.7;
}

.paci-menu-item:hover {
    background: var(--paci-sidebar-hover-bg);
    color: #ffffff;
}

/* Enlaces personalizados del menú lateral (OTRAS HERRAMIENTAS) */
.paci-sidebar-menu a.paci-menu-link,
.paci-sidebar-menu a.paci-menu-link:visited,
.paci-sidebar-menu a.paci-menu-link:hover,
.paci-sidebar-menu a.paci-menu-link:active,
.paci-sidebar-menu a.paci-menu-link:focus {
    color: #ffffff;
    text-decoration: none;
    display: block;
}

/* Radio buttons — Reportar Asistencia */
.paci-asist-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    min-width: 320px;
}

.paci-asist-radio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}

.paci-asist-radio input[type="radio"] {
    margin: 0;
    accent-color: var(--paci-primary, #2563eb);
}

.paci-asist-radio:has(input:checked) {
    border-color: var(--paci-primary, #2563eb);
    background: #eff6ff;
    font-weight: 500;
}

.paci-asist-table td {
    vertical-align: middle;
}

.paci-asist-row-alert td {
    background-color: #fef2f2 !important;
    color: #b91c1c;
}

.paci-asist-row-alert td.paci-asist-estado-cell {
    font-weight: 600;
}

/* Avance EPJA / CINDEA */
.epja-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}
.epja-resumen-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}
.epja-resumen-card span {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 4px;
}
.epja-resumen-card strong {
    font-size: 1.1rem;
    color: #0f172a;
}
.epja-alertas {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px 16px;
}
.epja-alerta-item {
    font-size: 0.88rem;
    color: #92400e;
    margin-bottom: 8px;
}
.epja-alerta-item:last-child {
    margin-bottom: 0;
}
.epja-sugerencia {
    font-size: 0.82rem;
    color: #b45309;
    background: #fffbeb;
    padding: 6px 8px;
    border-radius: 4px;
    line-height: 1.35;
}
.epja-row-sugerencia td {
    background: #fffbeb !important;
}
.epja-estado-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}
.epja-st-pendiente { background: #f1f5f9; color: #475569; }
.epja-st-proceso { background: #dbeafe; color: #1d4ed8; }
.epja-st-aprobado { background: #dcfce7; color: #166534; }
.epja-st-convalidado { background: #ede9fe; color: #5b21b6; }
.epja-st-na { background: #f1f5f9; color: #94a3b8; }
.epja-modulos-table td {
    vertical-align: top;
}

/* Historial Académico */
.ha-resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.ha-resumen-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
}
.ha-resumen-card span { display: block; font-size: 0.75rem; color: #64748b; margin-bottom: 4px; }
.ha-resumen-card strong { font-size: 1.1rem; color: #0f172a; }
.ha-student-bar {
    margin-bottom: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}
.ha-student-name { font-size: 1.35rem; font-weight: 700; color: #0f172a; line-height: 1.3; letter-spacing: -0.01em; }
.ha-student-id { margin-top: 4px; font-size: 0.92rem; font-weight: 500; color: #475569; }
.ha-muted { color: #64748b; }
.ha-section-title { margin: 0 0 8px; font-size: 1.05rem; }
.ha-hint { margin: 0 0 12px; font-size: 0.85rem; color: #64748b; }
.ha-toolbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.ha-check-opc { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.ha-periodo-row td { background: #f1f5f9; font-size: 0.9rem; }
.ha-mod-row.ha-st-pendiente td { color: #b91c1c; }
.ha-mod-row.ha-st-cursando td { color: #1d4ed8; font-weight: 500; }
.ha-mod-row.ha-st-aprobado td, .ha-mod-row.ha-st-convalidado td { color: #166534; }
.ha-cond-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.ha-st-pendiente.ha-cond-badge { background: #fee2e2; color: #b91c1c; }
.ha-st-aprobado.ha-cond-badge { background: #dcfce7; color: #166534; }
.ha-st-convalidado.ha-cond-badge { background: #ede9fe; color: #5b21b6; }
.ha-st-cursando.ha-cond-badge { background: #dbeafe; color: #1d4ed8; }
.ha-badge-opc { font-size: 0.7rem; background: #fef3c7; color: #92400e; padding: 1px 6px; border-radius: 4px; }
.ha-totales-footer { margin-top: 16px; padding: 12px; background: #f8fafc; border-radius: 8px; font-size: 0.9rem; }
.ha-preview-box { padding: 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; }
.ha-warn-list { margin: 8px 0; padding-left: 20px; color: #92400e; }
.ha-import-modal .paci-modal-body { padding-top: 8px; }
.ha-import-progress-wrap { margin-bottom: 16px; }
.ha-import-progress-bar { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.ha-import-progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); border-radius: 999px; transition: width 0.35s ease; }
.ha-import-step-label { margin-top: 8px; font-size: 0.85rem; color: #64748b; }
.ha-import-message { margin: 0 0 12px; font-size: 0.95rem; color: #334155; }
.ha-import-stats { padding: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; }
.ha-import-stats-detail { margin-top: 6px; font-size: 0.8rem; color: #64748b; }
.ha-import-preview-table { font-size: 0.8rem; }
.ha-import-preview-table th, .ha-import-preview-table td { padding: 6px 8px; }
.ha-save-info { margin-bottom: 16px; padding: 12px 16px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; font-size: 0.88rem; color: #1e3a8a; line-height: 1.5; }
.ha-import-notice { margin-bottom: 16px; padding: 10px 14px; background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; font-size: 0.88rem; color: #166534; }
.ha-import-assign { margin-bottom: 12px; padding: 12px 14px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; font-size: 0.9rem; color: #1e3a8a; }
.ha-import-assign-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ha-import-assign-title { font-weight: 600; margin-bottom: 6px; }
.ha-import-assign-main, .ha-import-assign-cedula { margin: 4px 0; }
.ha-import-assign-warn-text { margin: 8px 0 0; font-size: 0.85rem; color: #b45309; }

.ha-opc-section-row td { background: #fffbeb; color: #92400e; }
.ha-opc-hint-row td { color: #64748b; font-size: 0.85rem; font-style: italic; }
.ha-mod-row-opc td:first-child + td { font-weight: 500; }

/* Módulos fuera del plan modular actual (historial importado / en desuso) */
.ha-mod-row-fuera-plan td { background: #fff7ed !important; color: #9a3412 !important; }
.ha-mod-row-fuera-plan.ha-st-aprobado td,
.ha-mod-row-fuera-plan.ha-st-convalidado td { color: #c2410c !important; }
.ha-mod-row-legacy td { background: #fef2f2 !important; color: #991b1b !important; border-left: 3px solid #ef4444 !important; }
.ha-mod-row-legacy.ha-st-aprobado td,
.ha-mod-row-legacy.ha-st-convalidado td { color: #b91c1c !important; font-weight: 600; }
.ha-badge-fuera-plan { font-size: 0.7rem; background: #fed7aa; color: #9a3412; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.ha-badge-legacy { font-size: 0.7rem; background: #fecaca; color: #991b1b; padding: 1px 6px; border-radius: 4px; font-weight: 700; border: 1px solid #f87171; }
.ha-fuera-plan-block { margin-top: 20px; padding: 14px; background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px; }
.ha-fuera-plan-block--legacy { background: #fef2f2; border-color: #fca5a5; }
.ha-fuera-plan-block--legacy .ha-fuera-plan-title { color: #991b1b; }
.ha-fuera-plan-block--legacy .ha-fuera-plan-hint { color: #b91c1c !important; }
.ha-fuera-plan-title { margin: 0 0 8px; color: #9a3412; font-size: 1rem; }
.ha-fuera-plan-hint { color: #c2410c !important; margin-bottom: 10px !important; }
.ha-fuera-plan-table { border-color: #fdba74; }
.ha-total-fuera-plan { margin-top: 8px; color: #c2410c; font-weight: 500; }
.ha-import-stats-fuera-plan { margin-top: 8px; padding: 8px 10px; background: #fff7ed; border: 1px solid #fdba74; border-radius: 6px; color: #9a3412; font-size: 0.85rem; }
.ha-import-fuera-plan-row td { background: #fff7ed; color: #9a3412; }

.ha-report-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; padding: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.ha-report-bar--hidden { display: none !important; }
.ha-report-bar--inactive .ha-pdf-btn { opacity: 0.55; cursor: not-allowed; }
.ha-report-in-panel { margin: 0 0 20px; background: #f8fafc; border-color: #e2e8f0; }
.ha-report-hint { flex: 1 1 100%; font-size: 0.85rem; color: #64748b; margin: 0 0 4px; }
.ha-pdf-modal-card { max-width: 480px; width: 92%; padding: 20px; }
.ha-pdf-adjunto-hint { margin-bottom: 12px !important; font-size: 0.82rem; }
.ha-pdf-niveles { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.ha-pdf-nivel-label { font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ha-report-toolbar .ha-label { font-weight: 600; margin-right: 8px; font-size: 0.9rem; }
.ha-conv-group-row td { background: #e2e8f0; font-weight: 600; font-size: 0.85rem; }

/* Estado activo (como "Matrícula principal" en la imagen) */
.paci-menu-item.active {
    background: var(--paci-sidebar-active-bg);
    color: #ffffff;
    border: 1px solid var(--paci-sidebar-active-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-weight: 500;
}

.paci-menu-item.active::before {
    height: 52%;
}

/* Íconos del sidebar (color configurable via --paci-icon-color) */
.paci-menu-item .paci-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--paci-icon-color);
    transition: var(--paci-transition);
}

.paci-menu-item:hover .paci-icon,
.paci-menu-item.active .paci-icon {
    color: var(--paci-icon-color-hover);
}

/* Footer del sidebar (Cerrar sesión) */
.paci-sidebar-footer {
    padding: 12px 14px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.paci-sidebar-footer a {
    font-size: 0.84em;
    color: var(--paci-sidebar-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    transition: var(--paci-transition);
}

.paci-sidebar-footer a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fca5a5;
}

.paci-sidebar-footer a .paci-icon {
    color: var(--paci-icon-color);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: var(--paci-bg);
    min-width: 0;
}

/* ── Topbar (blanca, limpia como en la imagen) ── */
.paci-topbar {
    min-height: 70px;
    height: auto;
    background: var(--paci-topbar-bg);
    border-bottom: 1px solid var(--paci-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 32px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    overflow: visible;
    gap: 12px;
}

.paci-topbar-title {
    min-width: 0;
    flex: 1 1 auto;
}

.paci-topbar-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--paci-text-heading);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.paci-topbar-subtitle {
    font-size: 13px;
    color: var(--paci-text-muted);
    margin-top: 0;
    display: block;
}

.paci-topbar-title-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

/* Usuario en topbar */
.paci-topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.paci-campo-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff !important;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
    transition: opacity 0.15s ease;
}

.paci-campo-link:hover {
    opacity: 0.92;
    color: #fff !important;
    text-decoration: none;
}

@media (max-width: 768px) {
    .paci-topbar {
        height: auto;
        min-height: 70px;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
    }

    .paci-topbar-title {
        flex: 1 1 100%;
        min-width: 0;
    }

    .paci-topbar-title-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .paci-topbar-title-meta {
        width: 100%;
        justify-content: space-between;
        margin-top: 6px;
    }

    .paci-topbar-user {
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .paci-campo-link {
        padding: 7px 12px;
        font-size: 0.78rem;
        flex-shrink: 0;
    }
}

.paci-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 4px;
    background: transparent;
    border: 1px solid var(--paci-border);
    border-radius: 50px;
    font-size: 0.84rem;
    color: var(--paci-text-color);
    cursor: pointer;
    transition: var(--paci-transition);
}

.paci-user-badge:hover {
    border-color: var(--paci-primary);
    box-shadow: 0 0 0 3px rgba(var(--paci-primary-rgb), 0.08);
}

.paci-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--paci-border);
    object-fit: cover;
}

.paci-user-role {
    opacity: 0.6;
    font-size: 0.78em;
    color: var(--paci-text-muted);
    display: block;
}

.paci-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.paci-user-name {
    font-weight: 600;
    color: var(--paci-text-heading);
    display: block;
    font-size: 0.87rem;
}

.paci-user-avatar--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--paci-border);
    background: var(--paci-primary);
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.paci-user-chevron {
    font-size: 0.65rem;
    color: var(--paci-text-muted);
    margin-left: 2px;
}

/* ── Área de contenido ── */
.paci-content-area {
    padding: 24px 32px;
    flex: 1;
    overflow-y: auto;
    background: var(--paci-bg);
}

/* Scrollbar personalizado */
.paci-content-area::-webkit-scrollbar {
    width: 6px;
}
.paci-sidebar-menu::-webkit-scrollbar {
    width: 10px;
}
.paci-content-area::-webkit-scrollbar-track {
    background: transparent;
}
.paci-sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 6px 0;
}
.paci-content-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}
.paci-sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.paci-content-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.22);
}
.paci-sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.72);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS Y TABLAS — Fondo blanco, bordes limpios
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-card {
    background: var(--paci-card-bg);
    border-radius: var(--paci-border-radius);
    padding: 24px;
    border: 1px solid var(--paci-border);
    box-shadow: var(--paci-card-shadow);
    margin-bottom: 20px;
    transition: var(--paci-transition);
}

.paci-card:hover {
    box-shadow: var(--paci-card-hover-shadow);
    border-color: #b8c9db;
}

/* Toolbar de filtros (como en la imagen: búsqueda, sedes, modalidades...) */
.paci-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.paci-table-toolbar--stacked {
    flex-direction: column;
    align-items: flex-start;
}

.paci-toolbar-left { flex: 1; width: 100%; }

.paci-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: auto;
}

.paci-table-toolbar--stacked .paci-toolbar-actions {
    width: 100%; justify-content: flex-end; margin-left: 0;
}

.paci-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.paci-filter-grid--compact { max-width: 420px; }

/* Selector de columnas visibles (Alumnos) */
.paci-column-picker {
    position: relative;
    margin-top: 10px;
}

.paci-column-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    min-width: 280px;
    max-width: 520px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.paci-column-picker-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
}

.paci-column-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 12px;
    max-height: 260px;
    overflow-y: auto;
}

.paci-column-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
}

.paci-column-check input {
    accent-color: var(--paci-primary, #2563eb);
}

.paci-column-picker-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

/* ── Filtros con ícono (como en la imagen) ── */
.paci-filter-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.paci-filter-group .paci-filter-icon {
    position: absolute;
    left: 12px;
    font-size: 0.85rem;
    color: var(--paci-text-muted);
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.paci-filter-group .paci-chip-input,
.paci-filter-group select.paci-chip-input {
    padding-left: 36px !important;
}

/* Inputs tipo chip en filtros (como los de la imagen) */
.paci-chip-input {
    border-radius: var(--paci-border-radius) !important;
    padding: 9px 16px !important;
    border: 1px solid var(--paci-border) !important;
    background: #ffffff !important;
    box-shadow: var(--paci-input-shadow) !important;
    transition: var(--paci-transition) !important;
    font-family: inherit;
    font-size: 0.86rem;
    color: var(--paci-text-color) !important;
    appearance: auto;
}

.paci-chip-input:focus {
    border-color: var(--paci-primary) !important;
    box-shadow: var(--paci-input-focus-shadow) !important;
    outline: none;
}

.paci-chip-action {
    border-radius: var(--paci-border-radius);
    padding-left: 18px;
    padding-right: 18px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-btn {
    background: #ffffff;
    color: var(--paci-text-color);
    border: 1px solid var(--paci-border);
    padding: 9px 18px;
    border-radius: var(--paci-border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.86rem;
    transition: var(--paci-transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    box-shadow: var(--paci-input-shadow);
    white-space: nowrap;
}

.paci-btn:hover {
    background: #f8fafc;
    border-color: var(--paci-border-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.paci-btn-secondary {
    background: #ffffff;
    color: var(--paci-text-color);
    border: 1px solid var(--paci-border);
}

.paci-btn-secondary:hover {
    background: #f1f5f9;
    border-color: var(--paci-border-dark);
    color: var(--paci-text-heading);
}

/* Botón primario AZUL (Nuevo Registro, Guardar) */
.paci-btn-primary {
    background: var(--paci-primary);
    color: #ffffff;
    border-color: var(--paci-primary);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(var(--paci-primary-rgb), 0.28);
}

.paci-btn-primary:hover {
    background: var(--paci-primary-hover);
    box-shadow: 0 4px 12px rgba(var(--paci-primary-rgb), 0.38);
    transform: translateY(-1px);
}

/* Botón peligro */
.paci-btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.paci-btn-danger:hover {
    background: #fee2e2;
    border-color: #f87171;
    box-shadow: 0 2px 6px rgba(220, 38, 18, 0.12);
}

.paci-toolbar-actions .paci-btn,
.paci-toolbar-actions .paci-btn-secondary,
.paci-toolbar-actions .paci-btn-danger {
    min-height: 38px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLAS — Fondo blanco, filas limpias
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.paci-table th,
.paci-table td {
    padding: 13px 16px;
    text-align: left;
    font-size: 0.87rem;
    border-bottom: 1px solid #eef2f6;
}

.paci-table th {
    font-weight: 600;
    color: var(--paci-text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    background: #f8fafc;
    position: sticky;
    top: 0;
}

.paci-table th:first-child { border-radius: 8px 0 0 8px; }
.paci-table th:last-child  { border-radius: 0 8px 8px 0; }

.paci-table tbody tr { transition: var(--paci-transition); }
.paci-table tbody tr:hover { background: #f8fafc; }
.paci-table tbody tr:last-child td { border-bottom: none; }

.paci-table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 0 24px 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
}

.paci-pagination-left,
.paci-pagination-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paci-pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

.paci-page-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paci-page-info {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
}

.paci-btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ESTADO VACÍO — Ilustración como en la imagen
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    min-height: 280px;
}

.paci-empty-state-illustration {
    width: 200px;
    height: 160px;
    margin-bottom: 20px;
    opacity: 0.45;
}

.paci-empty-state-text {
    font-size: 0.95rem;
    color: var(--paci-text-muted);
    font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALES — Blanco puro, sombra definida, bordes en inputs (como la imagen)
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.paci-modal {
    background: var(--paci-modal-bg);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: var(--paci-modal-border-radius);
    display: flex;
    flex-direction: column;
    border: 1px solid #d4dde8;
    box-shadow: var(--paci-modal-shadow);
    overflow: hidden;
    animation: paciModalIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes paciModalIn {
    from   { opacity: 0; transform: scale(0.97) translateY(8px); }
    to     { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header del modal (título + cerrar) */
.paci-modal-header {
    padding: 20px 26px;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    flex-shrink: 0;
}

.paci-modal-header h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--paci-text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.paci-modal-header h3 .paci-icon {
    color: var(--paci-primary);
    font-size: 1.2rem;
}

/* Botón cerrar (X) */
.paci-modal-close {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 34px;
    height: 34px;
    border-radius: var(--paci-border-radius-sm);
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--paci-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--paci-transition);
    line-height: 1;
    padding: 0;
}

.paci-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    transform: rotate(90deg);
}

/* Cuerpo del modal — blanco, con formulario */
.paci-modal-body {
    padding: 24px 26px;
    overflow-y: auto;
    background: #ffffff;
}

/* Footer del modal (Cancelar / Guardar) */
.paci-modal-footer {
    padding: 16px 26px;
    border-top: 1px solid #eef2f6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafbfc;
    border-radius: 0 0 var(--paci-modal-border-radius) var(--paci-modal-border-radius);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ASIGNACIÓN CURRICULAR (Matrícula) e importación CSV
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-matricula-assign {
    padding: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--paci-border-radius-sm);
    background: #f8fafc;
}

.paci-assign-summary {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--paci-text-muted);
}

.paci-assign-empty {
    font-style: italic;
    color: #94a3b8;
}

.paci-assign-list {
    margin: 6px 0 0;
    padding-left: 18px;
}

.paci-assign-list li {
    margin: 2px 0;
}

.paci-assign-section {
    margin-bottom: 14px;
}

.paci-assign-item {
    display: block;
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.paci-assign-item:hover {
    background: #f1f5f9;
}

.paci-assign-meta {
    color: #94a3b8;
    font-size: 0.85em;
}

.paci-assign-hint {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0;
}

.paci-assign-error {
    color: #dc2626;
    font-weight: 500;
}

.paci-assign-item--warn {
    border: 1px solid #fcd34d;
    background: #fffbeb;
}

.paci-assign-item--warn:hover {
    background: #fef3c7;
}

.paci-assign-warn {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: #b45309;
}

.paci-assign-banner-warn {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.4;
}

.paci-import-stats {
    display: flex;
    gap: 18px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.paci-import-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 12px;
}

.paci-import-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.paci-import-result-table th,
.paci-import-result-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    text-align: left;
}

.paci-import-result-table th {
    background: #f8fafc;
    font-weight: 600;
}

.paci-import-row-error td { background: #fef2f2; }
.paci-import-row-rejected td { background: #fffbeb; }
.paci-import-row-imported td,
.paci-import-row-ok td { background: #f0fdf4; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMULARIOS — Inputs con BORDE + SOMBRA (como en la imagen)
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-form-group {
    margin-bottom: 18px;
}

.paci-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 550;
    font-size: 0.85rem;
    color: var(--paci-text-heading);
}

.paci-form-group label .req {
    color: var(--paci-primary);
    margin-left: 2px;
}

/* Input principal — borde visible + sombra sutil (clave según imagen) */
.paci-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--paci-border);
    border-radius: var(--paci-border-radius);
    font-family: inherit;
    font-size: 0.9rem;
    background: #ffffff;
    color: var(--paci-text-color);
    transition: var(--paci-transition);
    outline: none;
    box-shadow: var(--paci-input-shadow);
}

.paci-form-control::placeholder {
    color: var(--paci-text-muted);
    opacity: 0.65;
}

.paci-form-control:focus {
    border-color: var(--paci-primary);
    box-shadow: var(--paci-input-focus-shadow);
    background: #ffffff;
}

select.paci-form-control option {
    background: #ffffff;
    color: var(--paci-text-color);
}

/* Grid del formulario (2 columnas como en la imagen) */
#paci-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

#paci-form .paci-form-group { margin-bottom: 0; }

#paci-form > div[style*="text-align:right"],
#paci-form > div.full-width {
    grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SELECT2 OVERRIDES — Tema claro con bordes y sombras
   ═══════════════════════════════════════════════════════════════════════════ */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--paci-border) !important;
    border-radius: var(--paci-border-radius) !important;
    padding: 5px 10px;
    background: #ffffff !important;
    color: var(--paci-text-color) !important;
    min-height: 42px;
    box-shadow: var(--paci-input-shadow) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--paci-text-color) !important;
    line-height: 28px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--paci-text-muted) transparent transparent transparent !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--paci-primary) !important;
    box-shadow: var(--paci-input-focus-shadow) !important;
}

.select2-dropdown {
    background: #ffffff !important;
    border: 1px solid var(--paci-border) !important;
    border-radius: var(--paci-border-radius) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    color: var(--paci-text-color) !important;
}

.select2-container--default .select2-results__option {
    color: var(--paci-text-color) !important;
    padding: 10px 12px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: rgba(var(--paci-primary-rgb), 0.08) !important;
    color: var(--paci-primary) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(var(--paci-primary-rgb), 0.1) !important;
    border: 1px solid rgba(var(--paci-primary-rgb), 0.25) !important;
    color: var(--paci-primary) !important;
    border-radius: 6px !important;
    padding: 2px 8px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--paci-primary) !important;
    margin-right: 4px !important;
}

.select2-search--dropdown .select2-search__field {
    background: #f8fafc !important;
    border: 1px solid var(--paci-border) !important;
    border-radius: var(--paci-border-radius-sm) !important;
    color: var(--paci-text-color) !important;
    padding: 8px 12px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESS GATE (Login / Acceso Denegado)
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-access-gate {
    font-family: var(--paci-font-family);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    background: var(--paci-bg);
    position: relative;
}

.paci-access-card {
    background: var(--paci-card-bg);
    border-radius: var(--paci-border-radius-lg);
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    border: 1px solid var(--paci-border);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    animation: paciSlideUp 0.4s ease-out;
    position: relative;
    z-index: 1;
}

.paci-access-card--denied {
    border-color: #fecaca;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06), 0 0 0 1px #fecaca;
}

@keyframes paciSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.paci-access-icon { font-size: 3.5rem; margin-bottom: 20px; line-height: 1; }

.paci-access-card h2 {
    margin: 0 0 12px 0;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--paci-text-heading);
}

.paci-access-card p {
    margin: 0 0 24px 0;
    color: var(--paci-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.paci-access-btn {
    display: inline-block;
    background: var(--paci-primary);
    color: #ffffff;
    text-decoration: none;
    padding: 12px 32px;
    border-radius: var(--paci-border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--paci-transition);
    box-shadow: 0 2px 8px rgba(var(--paci-primary-rgb), 0.25);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.paci-access-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--paci-primary-rgb), 0.35);
    color: #ffffff;
    text-decoration: none;
}

.paci-access-btn--secondary {
    background: #f1f5f9;
    color: var(--paci-text-color);
    box-shadow: none;
    border: 1px solid var(--paci-border);
    margin-left: 10px;
}

.paci-access-btn--secondary:hover {
    background: #e2e8f0;
    color: var(--paci-text-heading);
    box-shadow: var(--paci-input-shadow);
    filter: none;
}

/* Modal de confirmación llamativo (registro guardado) */
.paci-feedback-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: paciFeedbackFadeIn 0.22s ease;
}

.paci-feedback-card {
    width: 100%;
    max-width: 460px;
    padding: 36px 28px 28px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: paciFeedbackPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.paci-feedback-card--success {
    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.28),
        0 0 0 4px rgba(34, 197, 94, 0.42),
        0 0 48px rgba(34, 197, 94, 0.22);
}

.paci-feedback-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(145deg, #4ade80, #16a34a);
    box-shadow: 0 10px 28px rgba(22, 163, 74, 0.45);
    animation: paciFeedbackPulse 1.6s ease-in-out infinite;
}

.paci-feedback-title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.paci-feedback-message {
    margin: 0 0 22px;
    font-size: 1rem;
    line-height: 1.55;
    color: #334155;
    white-space: pre-line;
}

.paci-feedback-btn {
    min-width: 180px;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.paci-feedback-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.42);
}

.paci-modal.paci-modal--feedback-success {
    box-shadow:
        var(--paci-modal-shadow),
        0 0 0 4px rgba(34, 197, 94, 0.38),
        0 0 40px rgba(34, 197, 94, 0.18);
}

.paci-modal--feedback-success .paci-modal-header {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-bottom: 1px solid #bbf7d0;
}

.paci-modal--feedback-success .paci-modal-header h3 {
    color: #166534;
    font-size: 1.15rem;
}

.ha-import-modal--success .ha-import-progress-fill {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.ha-import-modal--success .ha-import-message {
    padding: 14px 16px;
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: 10px;
    color: #166534;
    font-size: 1rem;
    font-weight: 600;
}

@keyframes paciFeedbackFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes paciFeedbackPop {
    from { opacity: 0; transform: scale(0.88) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes paciFeedbackPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILIDADES: Loading, Radio, Badges
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--paci-text-muted);
    font-family: var(--paci-font-family);
    font-size: 0.95rem;
    gap: 10px;
}

.paci-loading::after {
    content: '';
    width: 18px; height: 18px;
    border: 2.5px solid rgba(var(--paci-primary-rgb), 0.2);
    border-top-color: var(--paci-primary);
    border-radius: 50%;
    animation: paciSpin 0.8s linear infinite;
}

@keyframes paciSpin { to { transform: rotate(360deg); } }

/* Radio group */
.paci-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 8px 0;
}

.paci-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--paci-text-color);
    padding: 7px 14px;
    background: #f8fafc;
    border: 1px solid var(--paci-border);
    border-radius: var(--paci-border-radius-sm);
    transition: var(--paci-transition);
}

.paci-radio-group label:hover {
    background: #f1f5f9;
    border-color: var(--paci-border-dark);
}

.paci-radio-group input[type="radio"] {
    cursor: pointer;
    accent-color: var(--paci-primary);
    width: 16px; height: 16px;
}

/* Badges de estado */
.paci-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.paci-badge--active {
    background: #f0fdf4; color: #16a34a; border-color: #bbf7d0;
}
.paci-badge--inactive {
    background: #fef2f2; color: #dc2626; border-color: #fecaca;
}

.paci-badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Footer versión */
.paci-version-footer {
    position: absolute;
    bottom: 12px; right: 20px;
    font-size: 0.72rem;
    color: var(--paci-text-muted);
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AVISO / TABS
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-tab-header {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--paci-border);
}

.paci-tab-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--paci-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--paci-transition);
    font-family: inherit;
}

.paci-tab-btn:hover {
    color: var(--paci-text-heading);
}

.paci-tab-btn.active {
    color: var(--paci-primary);
    border-bottom-color: var(--paci-primary);
    font-weight: 600;
}

/* Expediente básico */
.paci-exp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px 20px;
}
.paci-exp-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.paci-exp-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.paci-exp-value {
    font-size: 0.9rem;
    color: #1e293b;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPALDO DE DATOS (Dirección)
   ═══════════════════════════════════════════════════════════════════════════ */
.paci-respaldo-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1100px;
}

.paci-respaldo-hero {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 24px;
}

.paci-respaldo-hero-icon {
    font-size: 2.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.paci-respaldo-hero-body h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.paci-respaldo-hero-body p {
    margin: 0 0 16px;
    color: var(--paci-text-muted, #64748b);
    line-height: 1.55;
}

.paci-respaldo-hint {
    margin: 12px 0 0;
    font-size: 0.88rem;
    color: var(--paci-text-muted, #64748b);
}

.paci-respaldo-notice {
    padding: 20px 24px;
    border-left: 4px solid var(--paci-primary, #2563eb);
}

.paci-respaldo-notice h4,
.paci-respaldo-section-title {
    margin: 0 0 10px;
    font-size: 1rem;
}

.paci-respaldo-notice ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--paci-text-muted, #64748b);
    line-height: 1.6;
}

.paci-respaldo-section-sub {
    margin: 0 0 14px;
    font-size: 0.9rem;
    color: var(--paci-text-muted, #64748b);
}

.paci-respaldo-slug {
    font-size: 0.75rem;
    color: #94a3b8;
}

.paci-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.paci-badge-vital {
    background: #dcfce7;
    color: #166534;
}

.paci-badge-muted {
    background: #f1f5f9;
    color: #64748b;
}

.paci-respaldo-table td,
.paci-respaldo-table th {
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .paci-sidebar { width: 240px; min-width: 240px; }
    .paci-content-area { padding: 20px; }
    .paci-topbar { padding: 0 20px; }
    #paci-form { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    #paci-core-app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .paci-sidebar { width: 100%; min-width: 100%; order: 2; }
    .paci-main { order: 1; }
    .paci-sidebar-collapse-btn,
    .paci-sidebar-restore { display: none !important; }
    .paci-modal { width: 96%; max-height: 95vh; border-radius: var(--paci-border-radius); }
    .paci-filter-grid { flex-direction: column; }
    .paci-filter-grid .paci-chip-input { width: 100% !important; }
}

/* Matrícula / asignación por modalidad (v2) */
.paci-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}
.paci-form-grid .paci-form-group { margin-bottom: 0; }
.paci-form-grid .full-width { grid-column: 1 / -1; }
.paci-form-card {
    padding: 28px 32px;
    max-width: 840px;
    background: var(--paci-card-bg, #ffffff);
    border: 1px solid var(--paci-border);
    border-radius: var(--paci-border-radius);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
/* Respaldo: inputs del grid heredan estilo elegante aunque falte la clase */
.paci-form-card .paci-form-grid :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select,
    textarea
) {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--paci-border);
    border-radius: var(--paci-border-radius);
    font-family: inherit;
    font-size: 0.9rem;
    background: #ffffff;
    color: var(--paci-text-color);
    transition: var(--paci-transition);
    outline: none;
    box-shadow: var(--paci-input-shadow);
}
.paci-form-card .paci-form-grid :is(input, select, textarea):focus {
    border-color: var(--paci-primary);
    box-shadow: var(--paci-input-focus-shadow);
}
.paci-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--paci-border);
}
@media (max-width: 640px) {
    .paci-form-grid { grid-template-columns: 1fr; }
    .paci-form-card { padding: 20px 16px; }
}

/* ── Dashboard de inicio (estilo moderno, colores del tema) ─────────────── */
.paci-dashboard {
    --dash-primary: var(--paci-primary, #2563eb);
    --dash-secondary: var(--paci-secondary, #1e40af);
    --dash-primary-rgb: var(--paci-primary-rgb, 37, 99, 235);
    --dash-secondary-rgb: var(--paci-secondary-rgb, 30, 64, 175);
}
.paci-dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 22px;
    align-items: start;
}
.paci-dash-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
.paci-dash-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 22px;
    align-items: start;
    min-width: 0;
}
.paci-dash-split-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
.paci-dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.paci-dash-aside {
    position: relative;
    align-self: start;
    min-width: 0;
    max-width: 100%;
    z-index: 1;
}
.paci-dash-welcome-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}
.paci-dash-cal-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(var(--dash-primary-rgb), 0.35);
    background: rgba(255, 255, 255, 0.92);
    color: var(--dash-primary);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(var(--dash-primary-rgb), 0.1);
}
.paci-dash-cal-toggle:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(var(--dash-primary-rgb), 0.15);
}
.paci-dash-cal-toggle-icon { font-size: 1rem; line-height: 1; }
.paci-dash--cal-collapsed .paci-dash-split {
    grid-template-columns: minmax(0, 1fr);
}
.paci-dash--cal-collapsed .paci-dash-aside {
    display: none;
}
.paci-dash-aside--collapsed {
    max-width: none;
}
.paci-dash-card--cal-collapsed {
    box-shadow: 0 4px 14px rgba(var(--dash-primary-rgb), 0.08);
}
.paci-dash-cal-body[hidden] {
    display: none !important;
}
.paci-dash-cal-banner-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

/* Welcome banner */
.paci-dash-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 24px 28px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(var(--dash-primary-rgb), 0.16) 0%, rgba(var(--dash-secondary-rgb), 0.08) 55%, rgba(255,255,255,0.9) 100%);
    border: 1px solid rgba(var(--dash-primary-rgb), 0.22);
    box-shadow: 0 10px 32px rgba(var(--dash-primary-rgb), 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    position: relative;
}
.paci-dash-welcome::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -20px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--dash-primary-rgb), 0.14) 0%, transparent 70%);
    pointer-events: none;
}
.paci-dash-welcome-user {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
}
.paci-dash-welcome-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(var(--dash-primary-rgb), 0.2), rgba(var(--dash-secondary-rgb), 0.15));
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(var(--dash-primary-rgb), 0.25);
    overflow: hidden;
}
.paci-dash-welcome-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.paci-dash-welcome-avatar-fallback {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dash-primary);
}
.paci-dash-welcome-greeting {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(var(--dash-primary-rgb), 0.75);
    margin-bottom: 4px;
}
.paci-dash-welcome h2 { margin: 0 0 6px; font-size: 1.45rem; color: var(--paci-text-heading); font-weight: 800; letter-spacing: -0.02em; }
.paci-dash-welcome p { margin: 0 0 6px; color: var(--paci-text-muted); font-size: 0.92rem; }
.paci-dash-welcome-role { font-size: 0.8rem; color: rgba(var(--dash-primary-rgb), 0.9); font-weight: 600; }
.paci-dash-welcome-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.paci-dash-chip {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--chip-color, var(--dash-primary));
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid color-mix(in srgb, var(--chip-color) 35%, transparent);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* Notificación de documentos */
.paci-dash-docs-notify {
    position: relative;
    padding: 18px 20px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--dash-primary-rgb), 0.09) 0%, rgba(234, 88, 12, 0.06) 100%);
    border: 1px solid rgba(var(--dash-primary-rgb), 0.22);
    box-shadow: 0 8px 24px rgba(var(--dash-primary-rgb), 0.1);
}
.paci-dash-docs-notify-badge {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dash-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(var(--dash-primary-rgb), 0.35);
}
.paci-dash-docs-notify-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(var(--dash-primary-rgb), 0.45);
    animation: paci-dash-pulse 2s ease-out infinite;
}
@keyframes paci-dash-pulse {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.35); opacity: 0; }
}
.paci-dash-docs-notify-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-right: 44px;
}
.paci-dash-docs-notify-icon { font-size: 1.6rem; line-height: 1; }
.paci-dash-docs-notify-head h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; color: var(--paci-text-heading); }
.paci-dash-docs-notify-head p { margin: 0; font-size: 0.88rem; color: var(--paci-text-muted); }
.paci-dash-docs-notify-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.paci-dash-docs-notify-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(var(--dash-primary-rgb), 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.paci-dash-docs-notify-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.paci-dash-docs-notify-rank {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(var(--dash-primary-rgb), 0.12);
    color: var(--dash-primary);
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.paci-dash-docs-meta { display: block; font-size: 0.75rem; color: var(--paci-text-muted); margin-top: 2px; }
.paci-dash-docs-notify-actions { margin-top: 12px; }

/* Stat cards row */
.paci-dash-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.paci-dash-stat-card {
    background: var(--stat-bg, rgba(var(--dash-primary-rgb), 0.08));
    border: 1px solid rgba(var(--dash-primary-rgb), 0.12);
    border-radius: 14px;
    padding: 16px 18px;
    border-top: 4px solid var(--stat-color, var(--dash-primary));
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.paci-dash-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}
.paci-dash-stat-label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--paci-text-muted); letter-spacing: 0.04em; }
.paci-dash-stat-value { display: block; font-size: 1.6rem; font-weight: 700; color: var(--paci-text-heading); line-height: 1.2; margin: 4px 0; }
.paci-dash-stat-sub { font-size: 0.78rem; color: var(--paci-text-muted); }

/* Cards */
.paci-dash-card {
    background: var(--paci-card-bg);
    border-radius: 16px;
    padding: 20px 22px;
    border: 1px solid var(--paci-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease;
}
.paci-dash-card:hover { box-shadow: 0 8px 28px rgba(15, 23, 42, 0.09); }
.paci-dash-card h3 { margin: 0 0 14px; font-size: 0.95rem; font-weight: 800; color: var(--paci-text-heading); }
.paci-dash-card--chart { display: flex; flex-direction: column; }
.paci-dash-card--cal {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(var(--dash-primary-rgb), 0.2);
    box-shadow: 0 12px 32px rgba(var(--dash-primary-rgb), 0.12);
}
.paci-dash-cal-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--dash-primary) 0%, var(--dash-secondary) 100%);
    color: #fff;
}
.paci-dash-cal-banner-icon { font-size: 1.5rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }
.paci-dash-cal-banner .paci-dash-cal-header h3 { color: #fff; margin: 0; font-size: 1rem; }
.paci-dash-cal-banner .paci-dash-muted { color: rgba(255,255,255,0.85); margin: 2px 0 0; font-size: 0.78rem; }
.paci-dash-card--cal .paci-cal-grid,
.paci-dash-card--cal .paci-dash-cal-body > .paci-cal-grid { padding: 12px 14px 8px; }
.paci-dash-card--cal .paci-dash-subtitle,
.paci-dash-card--cal #paci-dash-act-list,
.paci-dash-card--cal .paci-dash-cal-form,
.paci-dash-card--cal .paci-dash-cal-body .paci-dash-subtitle,
.paci-dash-card--cal .paci-dash-cal-body #paci-dash-act-list,
.paci-dash-card--cal .paci-dash-cal-body .paci-dash-cal-form { padding-left: 16px; padding-right: 16px; }
.paci-dash-card--cal .paci-dash-cal-form,
.paci-dash-card--cal .paci-dash-cal-body .paci-dash-cal-form { padding-bottom: 16px; }
.paci-dash-card--epi-head { display: flex; flex-direction: column; justify-content: center; }
.paci-dash-card--epi-head h3 { margin-bottom: 4px; }
.paci-dash-card--epi-head p { margin: 0; }

.paci-dash-mid-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.paci-dash-mid-row--tops { grid-template-columns: 1fr 1fr; }

/* Donut chart */
.paci-dash-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.paci-dash-donut {
    width: 130px; height: 130px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.paci-dash-donut-hole {
    width: 78px; height: 78px; border-radius: 50%; background: var(--paci-card-bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px var(--paci-border);
}
.paci-dash-donut-pct { font-size: 1.25rem; font-weight: 700; color: var(--dash-primary); line-height: 1; }
.paci-dash-donut-lbl { font-size: 0.6rem; color: var(--paci-text-muted); text-align: center; margin-top: 2px; }
.paci-dash-legend { list-style: none; margin: 0; padding: 0; width: 100%; font-size: 0.8rem; }
.paci-dash-legend li { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--paci-text-color); }
.paci-dash-legend li strong { margin-left: auto; color: var(--paci-text-heading); }
.paci-dash-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Progress list (EduAdmin style) */
.paci-dash-progress-list { display: flex; flex-direction: column; gap: 12px; }
.paci-dash-progress-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.paci-dash-progress-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}
.paci-dash-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.paci-dash-progress-name { font-size: 0.85rem; font-weight: 600; color: var(--paci-text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paci-dash-progress-sub { font-size: 0.75rem; color: var(--paci-text-muted); margin-bottom: 4px; }
.paci-dash-progress-pct { font-size: 0.75rem; font-weight: 700; color: var(--dash-primary); flex-shrink: 0; }
.paci-dash-progress-track { height: 6px; background: rgba(var(--dash-primary-rgb), 0.1); border-radius: 3px; overflow: hidden; }
.paci-dash-progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.paci-dash-progress-count { font-size: 0.8rem; font-weight: 700; color: var(--paci-text-muted); min-width: 28px; text-align: right; }

/* EPI strip */
.paci-dash-epi-strip { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 12px; }
.paci-dash-epi-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: var(--paci-border-radius);
    background: var(--epi-bg); border: 1px solid rgba(var(--dash-primary-rgb), 0.1);
    box-shadow: var(--paci-card-shadow);
}
.paci-dash-epi-icon { font-size: 1.4rem; }
.paci-dash-epi-val { font-size: 1.35rem; font-weight: 700; color: var(--epi-color); line-height: 1.1; }
.paci-dash-epi-lbl { font-size: 0.78rem; color: var(--paci-text-muted); }

/* Lesson cards (docente) */
.paci-dash-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.paci-dash-lesson-card {
    padding: 14px; border-radius: var(--paci-border-radius);
    background: var(--lesson-bg); border: 1px solid rgba(var(--dash-primary-rgb), 0.12);
    border-top: 3px solid var(--lesson-accent);
    box-shadow: var(--paci-card-shadow);
}
.paci-dash-lesson-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.paci-dash-lesson-mod { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--lesson-accent); }
.paci-dash-lesson-count { font-size: 0.75rem; color: var(--paci-text-muted); }
.paci-dash-lesson-title { font-size: 0.88rem; font-weight: 600; color: var(--paci-text-heading); line-height: 1.35; }

.paci-dash-muted { color: var(--paci-text-muted); font-size: 0.88rem; margin: 0; }
.paci-dash-subtitle { margin: 14px 0 8px; font-size: 0.85rem; font-weight: 600; color: var(--paci-text-muted); }
.paci-dash-cal-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 0; flex-wrap: wrap; }
.paci-dash-cal-header h3 { margin: 0; }

/* Calendar */
.paci-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; font-size: 0.72rem; }
.paci-cal-head {
    text-align: center;
    font-weight: 800;
    color: #fff;
    padding: 6px 0;
    font-size: 0.68rem;
    border-radius: 8px;
    background: rgba(var(--dash-primary-rgb), 0.75);
}
.paci-cal-head--weekend { background: rgba(234, 88, 12, 0.85); }
.paci-cal-cell {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    border-radius: 10px;
    background: rgba(var(--dash-primary-rgb), 0.06);
    border: 1px solid rgba(var(--dash-primary-rgb), 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
    gap: 2px;
    overflow: hidden;
    transition: transform 0.12s ease;
}
.paci-cal-cell:not(.paci-cal-cell--empty):hover { transform: scale(1.04); }
.paci-cal-cell--empty { background: transparent; border-color: transparent; min-height: 0; height: auto; max-height: none; }
.paci-cal-cell--today {
    background: rgba(var(--dash-primary-rgb), 0.22);
    border: 2px solid var(--dash-primary);
    font-weight: 800;
    box-shadow: 0 0 0 3px rgba(var(--dash-primary-rgb), 0.15);
}
.paci-cal-cell--event .paci-cal-day { font-weight: 800; color: var(--cal-accent, #c2410c); }
.paci-cal-cell--next { background: rgba(22, 163, 74, 0.08); border-color: rgba(22, 163, 74, 0.25); }
.paci-cal-day { text-align: center; font-size: 0.78rem; color: var(--paci-text-heading); line-height: 1.1; }
.paci-cal-month-hint { font-size: 0.55rem; color: #16a34a; text-align: center; line-height: 1; font-weight: 700; }
.paci-cal-dots { display: flex; gap: 2px; align-items: center; justify-content: center; }
.paci-cal-dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ea580c;
    flex-shrink: 0;
}
.paci-cal-dot--next { background: #16a34a; }

/* Padres / Tutores */
.paci-tutor-vinculos-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.paci-tutor-vinculos-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--paci-border);
    font-size: 0.88rem;
}
.paci-tutor-vinculos-list li:last-child { border-bottom: none; }

/* Buscador de estudiantes (tutores) */
.paci-tutor-alumno-picker { position: relative; }
.paci-tutor-picker-label { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.paci-tutor-search-results {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--paci-border, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
}
.paci-tutor-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-size: 0.88rem;
}
.paci-tutor-search-item:hover { background: #f0f9ff; }
.paci-tutor-search-name { font-weight: 600; color: var(--paci-text-heading, #1e293b); }
.paci-tutor-search-empty { padding: 12px; color: #64748b; font-size: 0.85rem; }
.paci-tutor-pending-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    border: 1px dashed var(--paci-border, #e2e8f0);
    border-radius: 8px;
    min-height: 44px;
}
.paci-tutor-pending-empty {
    padding: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
}
.paci-tutor-pending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
}
.paci-tutor-pending-item:last-child { border-bottom: none; }

/* Activities list + form */
.paci-dash-act-list { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; }
.paci-dash-act-list li {
    display: flex; align-items: flex-start; gap: 8px; padding: 7px 0;
    border-bottom: 1px solid var(--paci-border); font-size: 0.82rem;
}
.paci-dash-act-date { flex-shrink: 0; font-weight: 600; color: var(--dash-primary); min-width: 82px; font-size: 0.78rem; }
.paci-dash-act-text { flex: 1; color: var(--paci-text-color); }
.paci-dash-vis-label { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; margin-bottom: 10px; color: var(--paci-text-muted); }
.paci-dash-act-pub { font-size: 0.85em; }
.paci-dash-cal-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--paci-border); }
.paci-dash-cal-form h4 { margin: 0 0 10px; font-size: 0.88rem; color: var(--paci-text-heading); }
.paci-dash-form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.paci-dash-form-row label, .paci-dash-cal-form > label {
    display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--paci-text-muted); flex: 1; min-width: 120px;
}
.paci-dash-cal-form textarea, .paci-dash-cal-form input[type="date"], .paci-dash-cal-form input[type="number"] {
    padding: 8px 10px; border: 1px solid var(--paci-border); border-radius: var(--paci-border-radius-sm); font-size: 0.88rem;
    font-family: var(--paci-font-family); box-shadow: var(--paci-input-shadow);
}
.paci-input-readonly { background: rgba(var(--dash-primary-rgb), 0.04); color: var(--paci-text-muted); }
.paci-dash-last-att {
    margin-bottom: 12px; padding: 10px 12px; border-radius: var(--paci-border-radius-sm);
    background: rgba(var(--dash-primary-rgb), 0.08); border: 1px solid rgba(var(--dash-primary-rgb), 0.15);
    font-size: 0.88rem; color: var(--paci-text-color);
}
.paci-btn-icon { background: none; border: none; cursor: pointer; color: var(--paci-text-muted); padding: 2px 6px; }
.paci-btn-icon:hover { color: #dc2626; }
.paci-topbar-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.paci-help-btn {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid #b91c1c;
    background: #dc2626; color: #ffffff;
    font-size: 1.15rem; font-weight: 700; line-height: 1; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--paci-transition); flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}
.paci-help-btn:hover {
    background: #b91c1c; color: #ffffff;
    box-shadow: 0 3px 10px rgba(185, 28, 28, 0.45);
}
.paci-help-modal { max-width: 560px; }
.paci-help-modal-body { display: flex; flex-direction: column; gap: 16px; }
.paci-help-section h4 {
    margin: 0 0 6px; font-size: 0.88rem; font-weight: 700; color: var(--paci-primary);
    text-transform: uppercase; letter-spacing: 0.03em;
}
.paci-help-section p { margin: 0; font-size: 0.92rem; line-height: 1.55; color: var(--paci-text-color); white-space: pre-line; }

.paci-dash-grupos-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.paci-dash-grupos-head h3 { margin: 0; }
.paci-dash-filtro-wrap { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--paci-text-muted); }
.paci-dash-filtro-sem {
    padding: 6px 10px; border: 1px solid var(--paci-border); border-radius: var(--paci-border-radius-sm);
    font-size: 0.85rem; background: var(--paci-card-bg); color: var(--paci-text-color);
    box-shadow: var(--paci-input-shadow);
}

.paci-menu-home { margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.12); padding-bottom: 8px !important; }

/* ── Acceso Rápido ─────────────────────────────────────────────────────── */
.paci-acceso-rapido-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #14b8a6 100%);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.paci-acceso-rapido-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.4);
}
#paci-acceso-rapido-root.is-open {
    position: fixed;
    inset: 0;
    z-index: 10050;
}
.paci-ar-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(37, 99, 235, 0.28), rgba(15, 23, 42, 0.55) 55%);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 16px 28px;
    overflow: auto;
}
.paci-ar-modal {
    width: min(760px, 100%);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.4);
}
.paci-ar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 18px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #0ea5e9 100%);
    color: #fff;
}
.paci-ar-header-text { min-width: 0; }
.paci-ar-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.paci-ar-header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}
.paci-ar-subtitle {
    margin: 6px 0 0;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.88);
    line-height: 1.4;
}
.paci-ar-subtitle kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid rgba(255,255,255,0.35);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: rgba(255,255,255,0.12);
    font-size: 0.75rem;
    font-family: inherit;
}
.paci-ar-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.paci-ar-close:hover { background: rgba(255,255,255,0.28); }
.paci-ar-body { padding: 20px 24px 24px; }
.paci-ar-period-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.paci-ar-period-field { min-width: 0; }
.paci-ar-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #f8fbff;
    color: #0f172a;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: inset 0 1px 2px rgba(37, 99, 235, 0.06);
}
.paci-ar-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.paci-ar-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 8px;
}
.paci-ar-search-row { margin-bottom: 16px; }
.paci-ar-ficha {
    padding: 16px 18px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
    margin-bottom: 18px;
}
.paci-ar-ficha--empty {
    color: #64748b;
    text-align: center;
    padding: 28px 16px;
    background: #f8fafc;
    border-style: dashed;
    border-color: #cbd5e1;
}
.paci-ar-empty-ico { font-size: 1.6rem; margin-bottom: 6px; }
.paci-ar-ficha--empty p { margin: 0; }
.paci-ar-error { color: #b91c1c; margin: 0; }
.paci-ar-ficha-main {
    display: flex;
    align-items: center;
    gap: 14px;
}
.paci-ar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}
.paci-ar-ficha-text { min-width: 0; }
.paci-ar-name {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
}
.paci-ar-cedula {
    font-size: 0.88rem;
    color: #334155;
    margin-top: 2px;
}
.paci-ar-meta {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 4px;
}
.paci-ar-tutor {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.35;
}
.paci-ar-tutor--ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.paci-ar-tutor--none {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}
.paci-ar-tutor-ico { flex-shrink: 0; }
.paci-ar-tutor-text { font-weight: 600; }
.paci-ar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.paci-ar-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}
.paci-ar-chip--ok { background: #dcfce7; color: #166534; }
.paci-ar-chip--warn { background: #fef3c7; color: #92400e; }
.paci-ar-chip--info { background: #e0f2fe; color: #075985; }
.paci-ar-chip--muted { background: #e2e8f0; color: #475569; }
.paci-ar-section-title {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 12px;
}
.paci-ar-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    justify-items: stretch;
}
.paci-ar-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    padding: 12px 10px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    text-align: center;
}
.paci-ar-action-ico { font-size: 1.35rem; line-height: 1; }
.paci-ar-action-label {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
}
.paci-ar-action--pri {
    background: linear-gradient(180deg, #eff6ff, #dbeafe);
    color: #1e3a8a;
    border-color: #bfdbfe;
}
.paci-ar-action--epi {
    background: linear-gradient(180deg, #fff7ed, #ffedd5);
    color: #9a3412;
    border-color: #fed7aa;
}
.paci-ar-action--sec {
    background: linear-gradient(180deg, #f0fdf4, #dcfce7);
    color: #166534;
    border-color: #bbf7d0;
}
.paci-ar-action:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}
.paci-ar-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.25);
}
.paci-ar-more-toggle {
    display: block;
    width: 100%;
    margin: 14px 0 10px;
    border: none;
    background: transparent;
    color: #2563eb;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px;
    text-align: center;
}
.paci-ar-more-toggle:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .paci-acceso-rapido-btn { padding: 6px 10px; font-size: 0.75rem; }
    .paci-ar-backdrop { padding-top: 3vh; }
    .paci-ar-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .paci-ar-header { padding: 18px 16px 14px; }
    .paci-ar-body { padding: 16px; }
    .paci-ar-period-row { grid-template-columns: 1fr; }
}


@media (max-width: 1320px) {
    .paci-dash-layout,
    .paci-dash-split { grid-template-columns: 1fr; }
    .paci-dash-aside { position: static; max-width: none; }
    .paci-dash-mid-row { grid-template-columns: 1fr 1fr; }
    .paci-dash-mid-row .paci-dash-card--chart { grid-column: 1 / -1; }
}
@media (max-width: 1200px) {
    .paci-dash-mid-row { grid-template-columns: 1fr 1fr; }
    .paci-dash-mid-row .paci-dash-card--chart { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .paci-dash-stat-row, .paci-dash-mid-row, .paci-dash-mid-row--tops, .paci-dash-epi-strip { grid-template-columns: 1fr; }
    .paci-dash-welcome-illus { display: none; }
    .paci-dash-welcome-side { align-items: stretch; width: 100%; }
    .paci-dash-cal-toggle { justify-content: center; }
}

/* ── Estadísticas institucionales ───────────────────────────────────────── */
.paci-est-wrap { display: flex; flex-direction: column; gap: 16px; }
.paci-est-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px 16px;
    align-items: end;
}
.paci-est-filter-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; color: #475569; }
.paci-est-check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; padding-bottom: 6px; }
.paci-est-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.paci-est-hint { margin: 12px 0 0; font-size: 0.8rem; color: #64748b; }
.paci-est-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.paci-est-kpi {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}
.paci-est-kpi-val { display: block; font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.paci-est-kpi-lbl { display: block; font-size: 0.75rem; color: #64748b; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.paci-est-kpi--ok .paci-est-kpi-val { color: #16a34a; }
.paci-est-kpi--bad .paci-est-kpi-val { color: #dc2626; }
.paci-est-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.paci-est-chart-card {
    padding: 16px 20px;
    min-height: 280px;
}
.paci-est-chart-card h3 { margin: 0 0 12px; font-size: 0.95rem; color: #334155; }
.paci-est-chart-canvas-wrap { position: relative; width: 100%; overflow: hidden; }
.paci-est-chart-canvas-wrap canvas { display: block; max-height: 100%; }
.paci-est-no-data { padding: 48px 16px; text-align: center; color: #94a3b8; font-size: 0.9rem; margin: 0; }
.paci-est-chart-wide { min-height: 320px; }
.paci-est-table-wrap { overflow-x: auto; }
.paci-est-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.paci-est-table .ok { color: #16a34a; }
.paci-est-table .bad { color: #dc2626; }
@media (max-width: 900px) {
    .paci-est-charts { grid-template-columns: 1fr; }
}

/* Mi Perfil */
.paci-perfil-wrap { display: grid; gap: 20px; max-width: 720px; }
.paci-perfil-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
}
.paci-perfil-card h3 { margin: 0 0 16px; font-size: 1rem; color: #334155; }
.paci-perfil-avatar-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.paci-perfil-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.paci-perfil-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.paci-perfil-avatar-fallback {
    font-size: 1.5rem;
    font-weight: 700;
    color: #64748b;
}

/* Documentos institucionales */
.paci-docs-inst-wrap { max-width: 960px; }
.paci-docs-inst-upload {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
}
.paci-docs-inst-table-wrap { overflow-x: auto; }
.paci-docs-inst-icon { margin-right: 6px; }
.paci-docs-inst-preview-iframe {
    width: 100%;
    min-height: 480px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.paci-docs-inst-xlsx-preview {
    max-height: 480px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
}
.paci-docs-inst-xlsx-preview table { border-collapse: collapse; font-size: 0.85rem; }
.paci-docs-inst-xlsx-preview td, .paci-docs-inst-xlsx-preview th {
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
}
.paci-modal--wide { max-width: 900px; width: 95%; }
.paci-btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* Dashboard — últimos documentos */
.paci-dash-docs-list { list-style: none; margin: 0; padding: 0; }
.paci-dash-docs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.paci-dash-docs-item:last-child { border-bottom: none; }
.paci-dash-docs-body { flex: 1; min-width: 0; }
.paci-dash-docs-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--dash-primary, #2563eb);
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
}
.paci-dash-docs-link:hover { text-decoration: underline; }

/* Actas AT */
.acta-at-card .acta-at-dyn { color: #c8102e; font-weight: 600; }
.acta-at-preview { margin-top: 8px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
.acta-at-title { text-align: center; font-size: 1.05rem; margin: 0 0 8px; }
.acta-at-center { text-align: center; margin: 4px 0; }
.acta-at-parrafo { font-size: 0.9rem; line-height: 1.5; margin: 12px 0; }
.acta-at-table { font-size: 0.82rem; }
.acta-at-table th { text-align: center; font-size: 0.75rem; }
.acta-at-firma { margin-top: 8px; border-top: 1px solid #94a3b8; max-width: 220px; padding-top: 6px; }

@media (max-width: 1100px) {
    .paci-dash-welcome-chips { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 768px) {
    .paci-dash-welcome-user { flex-direction: column; align-items: flex-start; }
    .paci-dash-stat-row { grid-template-columns: 1fr; }
    .paci-dash-mid-row { grid-template-columns: 1fr; }
    .paci-dash-epi-strip { grid-template-columns: 1fr 1fr; }
}

/* Institución única: ocultar selectores de sede y modalidad en toda la plataforma */
.paci-sede-ui,
.paci-mod-ui,
.paci-filter-group:has(select[id*="sede" i]),
.paci-filter-group:has(select[id$="-mod"]),
.paci-campo-field:has(select[id*="sede" i]),
.paci-campo-field:has(select[id$="-mod"]),
select[name="id_sede"] {
    display: none !important;
}

