/* 
 ==========================================================================
  SISTEMA DE ESTILOS PREMIUM - GESTOR PAE (CLÍNICO & ACADÉMICO)
  Basado en Variables CSS, HSL, Glassmorphism, Micro-animaciones e Impresión Limpia.
 ==========================================================================
*/

/* 1. VARIABLES DEL SISTEMA DE DISEÑO (TEMA INSTITUCIONAL IUTEPAL - DEEP BLUE & AMBER GOLD) */
:root {
    --bg-app: #eef2f8;
    --bg-card: rgba(255, 255, 255, 0.96);
    --bg-sidebar: #071830;
    /* Navy azul oscuro IUTEPAL */
    --bg-sidebar-hover: #0e2a4a;

    --text-primary: #1a2540;
    --text-secondary: #445069;
    --text-light: #6b7fa0;

    --border-color: rgba(200, 215, 235, 0.9);
    --border-focus: #0056b3;
    /* IUTEPAL Blue */

    /* Colores Clave Clínicos y Corporativos */
    --primary: #071830;
    /* Navy principal */
    --primary-light: #0056b3;
    /* Blue highlight */
    --primary-glow: rgba(0, 86, 179, 0.10);
    --primary-glow-strong: rgba(0, 86, 179, 0.18);

    --secondary: #445069;
    --accent: #c96b00;
    /* Gold/Amber más profundo */
    --accent-light: #fff3dc;

    /* Estados Alertas */
    --danger: #c91f1f;
    --danger-light: #fce8e8;
    --warning: #c96b00;
    --warning-light: #fff3dc;
    --success: #0f6d34;
    --success-light: #d4f5e2;

    /* Efectos & Sombras mejoradas */
    --glass-blur: blur(16px);
    --shadow-xs: 0 1px 3px rgba(9, 32, 64, 0.04);
    --shadow-sm: 0 2px 8px rgba(9, 32, 64, 0.06);
    --shadow-md: 0 6px 24px rgba(9, 32, 64, 0.09);
    --shadow-lg: 0 16px 40px rgba(9, 32, 64, 0.14);
    --shadow-xl: 0 24px 60px rgba(9, 32, 64, 0.18);

    /* Bordes Redondeados — más suaves */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;

    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* 2. VARIABLES DEL TEMA OSCURO (SE ACTIVA MEDIANTE CLASE [data-theme="dark"]) */
[data-theme="dark"] {
    --bg-app: #060d1a;
    --bg-card: rgba(12, 22, 42, 0.92);
    --bg-sidebar: #030810;
    --bg-sidebar-hover: #0a1628;

    --text-primary: #e8f0fc;
    --text-secondary: #a8bdd4;
    --text-light: #7a93b2;

    --border-color: rgba(40, 60, 90, 0.55);

    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-glow: rgba(59, 130, 246, 0.15);
    --primary-glow-strong: rgba(59, 130, 246, 0.25);

    --secondary: #6284a0;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* 3. RESETEO & SOPORTE GLOBAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-primary);
    background-color: var(--bg-app);
    background-image: radial-gradient(ellipse at 20% 10%, rgba(0, 86, 179, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 90%, rgba(201, 107, 0, 0.03) 0%, transparent 60%);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

input,
button,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

/* Barra de desplazamiento */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 4. ESTRUCTURA DE LA APP (GRID LAYOUT) */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    position: relative;
}

/* 5. SIDEBAR ESTILIZADO */
.sidebar {
    background: linear-gradient(180deg, #071830 0%, #091e3a 60%, #071830 100%);
    color: #f8fafc;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: sticky;
    top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 10;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0056b3, #c96b00);
}

.sidebar::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 86, 179, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.brand-logo {
    background-color: #ffffff;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    flex-shrink: 0;
}

.brand-logo:hover {
    transform: scale(1.06);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.brand-text h1 {
    font-size: 20px;
    color: #ffffff;
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-text span {
    font-size: 11px;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
    min-height: 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}


.sidebar-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-btn {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: #94a3b8;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn i {
    font-size: 18px;
    transition: var(--transition);
}

.nav-btn span {
    font-weight: 500;
}

.nav-btn:hover {
    background-color: var(--bg-sidebar-hover);
    color: #ffffff;
}

.nav-btn.active {
    background-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}

.nav-btn.active i {
    transform: scale(1.1);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Aviso institucional en el pie de la barra lateral */
.institutional-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.institutional-notice i {
    color: #d97706;
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.institutional-notice div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.institutional-notice strong {
    font-size: 11px;
    color: #f1f5f9;
    font-weight: 700;
    line-height: 1.3;
}

.institutional-notice span {
    font-size: 10px;
    color: #d97706;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot.online {
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.dot.offline {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

/* 6. PANEL DE CONTENIDO PRINCIPAL */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Zona de contenido con scroll (entre header y footer) */
.content-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* CABECERA SUPERIOR */
.app-header {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(200, 215, 235, 0.7);
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 9;
    transition: var(--transition);
    box-shadow: 0 1px 12px rgba(7, 24, 48, 0.06);
}

[data-theme="dark"] .app-header {
    background-color: rgba(10, 18, 36, 0.88);
    border-bottom-color: rgba(40, 60, 90, 0.5);
}

.header-search {
    position: relative;
    width: 380px;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-primary);
    transition: var(--transition);
}

.header-search input:focus {
    border-color: var(--border-focus);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--primary);
    border-color: var(--border-focus);
    background-color: var(--bg-card);
    transform: translateY(-2px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-glow);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

/* VISTA DE CONTENIDO SPA */
.view-container {
    padding: 40px;
    flex: 1;
}

.tab-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-view.active {
    display: block;
}

/* 7. COMPONENTES Y TARJETAS */
.panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.panel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.panel-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.panel-card:hover::before {
    opacity: 1;
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 86, 179, 0.02) 100%);
}

.panel-header h3 {
    font-size: 15.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 600;
}

.panel-header h3 i {
    color: var(--primary-light);
    font-size: 16px;
}

.badge {
    background-color: var(--primary-glow-strong);
    color: var(--primary-light);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 86, 179, 0.15);
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(140deg, var(--primary) 0%, #0a2e60 50%, #102448 100%);
    border-radius: var(--radius-md);
    padding: 36px 44px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
}

.banner-text {
    max-width: 65%;
    z-index: 1;
}

.banner-text h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: #ffffff;
}

.banner-text p {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 24px;
}

.banner-actions {
    display: flex;
    gap: 16px;
}

.banner-illustration {
    font-size: 96px;
    color: rgba(255, 255, 255, 0.1);
    margin-right: 20px;
    z-index: 0;
}

/* Botones — Diseño Premium */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid transparent;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background 0.2s ease;
}

.btn:hover::after {
    background: rgba(255, 255, 255, 0.08);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #0056b3 0%, #0047a0 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 86, 179, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0047a0 0%, #003880 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 86, 179, 0.4);
}

.btn-secondary {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: rgba(201, 31, 31, 0.2);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 31, 31, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent) 0%, #a85800 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(201, 107, 0, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #a85800 0%, #8a4700 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(201, 107, 0, 0.4);
}

.link-btn {
    background: transparent;
    border: none;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
}

.link-btn:hover {
    color: var(--primary);
    background-color: var(--primary-glow);
    text-decoration: none;
}

/* 8. VISTA DE INICIO (DASHBOARD) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 26px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light), transparent);
    opacity: 0.8;
    /* Mostrarlo sutilmente de forma permanente para el diseño premium */
}

/* Estilos para el botón de control de sesión de Administrador */
.btn-admin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-secondary);
}

.btn-admin-toggle:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background-color: var(--primary-glow);
    transform: translateY(-1px);
}

.btn-admin-toggle.admin-active {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.2);
}

.btn-admin-toggle.admin-active:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.2);
}


.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.bg-teal {
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.15) 0%, rgba(0, 86, 179, 0.08) 100%);
    color: var(--primary-light);
}

.bg-blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.08) 100%);
    color: #3b82f6;
}

.bg-purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(139, 92, 246, 0.08) 100%);
    color: #8b5cf6;
}

.bg-emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.08) 100%);
    color: #10b981;
}

.stat-info h3 {
    font-size: 24px;
    font-family: var(--font-heading);
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

/* Dashboard footer cards */
.dashboard-footer-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 30px;
}

.dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px 32px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-light);
}

.info-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.methodology-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.methodology-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.step-num {
    background-color: var(--primary-glow);
    color: var(--primary-light);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.methodology-steps li span:last-child {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.recent-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    background-color: var(--bg-app);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    border-left: 3px solid var(--primary-light);
}

.recent-item:hover {
    transform: translateX(4px);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.recent-item-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.recent-item-info p {
    font-size: 12px;
    color: var(--text-light);
}

/* 9. EXPLORADOR DE TAXONOMÍA */
.explorer-grid {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 24px;
    min-height: calc(100vh - 200px);
}

.patrones-list {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 6px;
    height: 500px;
    overflow-y: auto;
}

.patron-item {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.patron-item:hover {
    background-color: var(--bg-app);
    color: var(--primary-light);
}

.patron-item.active {
    background-color: var(--primary-glow);
    color: var(--primary-light);
    font-weight: 600;
}

.patron-badge {
    background-color: var(--primary);
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.patron-item.active .patron-badge {
    background-color: var(--primary-light);
}

/* Lista NANDA */
.nanda-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 500px;
    overflow-y: auto;
}

.nanda-item {
    width: 100%;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.nanda-item:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nanda-item.active {
    background-color: var(--bg-card);
    border-color: var(--primary-light);
    border-left: 4px solid var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.nanda-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.nanda-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    background-color: var(--primary-glow);
    padding: 2px 6px;
    border-radius: 4px;
}

.nanda-item h4 {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.nanda-item p {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Relaciones recomendadas */
.relations-panel {
    padding: 24px;
    height: 500px;
    overflow-y: auto;
}

.nanda-detail-title {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.nanda-detail-title span {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
}

.nanda-detail-title h3 {
    font-size: 18px;
    margin-top: 4px;
    line-height: 1.3;
}

.nanda-definition-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    background-color: var(--bg-app);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-style: italic;
}

.relations-section {
    margin-bottom: 24px;
}

.relations-section h4 {
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.relations-section h4.noc-header {
    color: #8b5cf6;
}

.relations-section h4.nic-header {
    color: var(--primary-light);
}

.relation-badge-item {
    background-color: var(--bg-app);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid #ddd;
}

.relation-badge-item.noc-item {
    border-left-color: #8b5cf6;
}

.relation-badge-item.nic-item {
    border-left-color: var(--primary-light);
}

.relation-item-top {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
}

.relation-item-name {
    font-weight: 600;
    font-size: 13px;
}

.relation-item-def {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.relation-sublist {
    margin-top: 8px;
    padding-left: 14px;
    border-left: 1px dashed var(--border-color);
}

.sublist-item {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    position: relative;
}

.sublist-item::before {
    content: '•';
    position: absolute;
    left: -10px;
    color: var(--text-light);
}

/* 10. CREADOR DE PAE & STEPPER */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0 10px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: var(--transition);
}

.step-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: var(--border-color);
    margin: 0 16px;
    margin-bottom: 22px;
    z-index: 0;
    transition: var(--transition);
}

.step-item.active .step-circle {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 0 10px var(--primary-glow);
}

.step-item.active .step-title {
    color: var(--primary-light);
    font-weight: 700;
}

.step-item.completed .step-circle {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.step-item.completed .step-title {
    color: var(--accent);
}

.step-line.completed {
    background-color: var(--accent);
}

/* Formularios del Creador */
.creator-step-content {
    min-height: 400px;
}

.creator-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
    padding: 30px;
}

.creator-step.active {
    display: block;
}

.step-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.step-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.step-header p {
    font-size: 13px;
    color: var(--text-light);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-primary);
    transition: var(--transition);
    font-size: 14px;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(0, 86, 179, 0.35);
    background-color: var(--bg-card);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3.5px var(--primary-glow), 0 2px 8px rgba(0, 86, 179, 0.08);
    outline: none;
}

.step-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

/* Doble Panel Creador Paso 2 */
.creator-dual-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.dual-left {
    border-right: 1px solid var(--border-color);
    padding-right: 30px;
}

.nanda-select-list {
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    background-color: var(--bg-app);
    margin-top: 12px;
}

.nanda-select-item {
    padding: 12px 14px;
    border-radius: 4px;
    background-color: var(--bg-card);
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.nanda-select-item:hover {
    border-color: var(--primary-light);
    background-color: var(--primary-glow);
}

.nanda-select-item.selected {
    border-color: var(--primary-light);
    background-color: var(--primary-glow);
    border-left: 4px solid var(--primary-light);
}

.nanda-selected-preview {
    padding: 20px;
    background-color: var(--primary-glow);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--primary-light);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Selector NOC y Escalas Likert */
.creator-noc-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.creator-noc-card-header {
    background-color: rgba(139, 92, 246, 0.08);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.noc-select-cb {
    width: 20px;
    height: 20px;
    accent-color: #8b5cf6;
}

.creator-noc-card-body {
    padding: 20px;
}

.noc-indicators-table {
    width: 100%;
    border-collapse: collapse;
}

.noc-indicators-table th,
.noc-indicators-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.noc-indicators-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-light);
}

/* Controles Likert interactivos */
.likert-selector {
    display: flex;
    gap: 4px;
}

.likert-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.likert-btn:hover {
    border-color: var(--primary-light);
    background-color: var(--primary-glow);
}

/* Niveles de Likert */
.likert-btn.active.level-1 {
    background-color: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

.likert-btn.active.level-2 {
    background-color: #f97316;
    color: #fff;
    border-color: #f97316;
}

.likert-btn.active.level-3 {
    background-color: #eab308;
    color: #fff;
    border-color: #eab308;
}

.likert-btn.active.level-4 {
    background-color: #a3e635;
    color: #3f6212;
    border-color: #a3e635;
}

.likert-btn.active.level-5 {
    background-color: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

/* Selector NIC y actividades */
.creator-nic-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.creator-nic-card-header {
    background-color: rgba(13, 148, 136, 0.05);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nic-select-cb {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-light);
}

.creator-nic-card-body {
    padding: 20px;
}

.nic-activities-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nic-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 4px;
    background-color: var(--bg-app);
    transition: var(--transition);
}

.nic-activity-item:hover {
    background-color: var(--bg-card);
}

.activity-cb {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary-light);
}

.nic-activity-item label {
    font-size: 13px;
    cursor: pointer;
    line-height: 1.4;
}

/* 11. HISTORIAL Y TABLAS */
.clinical-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.clinical-table th,
.clinical-table td {
    padding: 15px 22px;
    border-bottom: 1px solid var(--border-color);
}

.clinical-table th {
    font-weight: 700;
    font-size: 11.5px;
    color: var(--text-light);
    background-color: var(--bg-app);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.clinical-table tbody tr {
    transition: var(--transition-fast);
}

.clinical-table tbody tr:hover td {
    background-color: var(--primary-glow);
    cursor: pointer;
}

.clinical-table tbody tr:last-child td {
    border-bottom: none;
}

.history-toolbar {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.toolbar-search {
    position: relative;
    width: 320px;
}

.toolbar-search input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
}

.toolbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.history-table-container {
    overflow-x: auto;
}

.table-empty {
    text-align: center;
    color: var(--text-light);
    padding: 40px !important;
}

.actions-row {
    display: flex;
    gap: 8px;
}

.action-btn-sm {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.action-btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-view-plan {
    color: var(--primary-light);
}

.btn-view-plan:hover {
    background-color: var(--primary-glow);
    border-color: var(--primary-light);
}

.btn-delete-plan {
    color: var(--danger);
}

.btn-delete-plan:hover {
    background-color: var(--danger-light);
    border-color: var(--danger);
}

/* 12. MODAL Y VISTA CLÍNICA */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(7, 18, 40, 0.65);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 32px;
    animation: fadeIn 0.25s ease;
}

.modal-overlay.active {
    display: flex;
}

.clinical-modal-content {
    background-color: var(--bg-card);
    border: 1px solid rgba(200, 215, 235, 0.6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 920px;
    height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.clinical-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
}

.modal-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-close {
    background-color: var(--bg-app);
    border: 1.5px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.btn-close:hover {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px 48px;
    background-color: #ffffff;
    color: #1a2540;
}

/* Formato Clínico del Reporte — Diseño Premium */
.clinical-report {
    max-width: 820px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    line-height: 1.6;
}

.report-header {
    border-bottom: 2.5px solid #071830;
    padding-bottom: 18px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.report-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #071830;
}

.report-logo i {
    font-size: 28px;
}

.report-logo h2 {
    font-size: 21px;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.report-logo span {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    color: #6b7fa0;
}

.report-meta {
    text-align: right;
    font-size: 12px;
    color: #6b7fa0;
    line-height: 1.7;
}

/* Tabla de datos del paciente */
.patient-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 0 0 1px #dde6f0;
}

.patient-info-table td {
    padding: 11px 15px;
    border: 1px solid #dde6f0;
    font-size: 13px;
}

.patient-info-table td.label-cell {
    background: linear-gradient(135deg, #f4f7fc 0%, #eef2f8 100%);
    font-weight: 700;
    width: 175px;
    color: #1a2540;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-right: 2px solid #c8d7eb;
}

/* Secciones del reporte */
.report-section {
    margin-bottom: 28px;
}

.report-section-title {
    background: linear-gradient(135deg, #eef4ff 0%, #f4f7fc 100%);
    border-left: 4px solid #0056b3;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    color: #1a2540;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.nanda-card-report {
    background: linear-gradient(135deg, #f4f7fc 0%, #f8faff 100%);
    border: 1.5px solid #c8d7eb;
    padding: 20px 22px;
    border-radius: var(--radius-sm);
    border-left: 4px solid #0056b3;
}

.nanda-card-report h4 {
    color: #0056b3;
    font-size: 15px;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.nanda-card-report p {
    font-size: 13px;
    color: #445069;
    line-height: 1.55;
}

.plan-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.report-item-box {
    border: 1px solid #dde6f0;
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    background-color: #fafcff;
    transition: box-shadow 0.2s ease;
}

.report-item-box:hover {
    box-shadow: 0 2px 12px rgba(0, 86, 179, 0.08);
}

.report-item-box.noc-box {
    border-top: 3.5px solid #7c3aed;
    background: linear-gradient(135deg, #fdf9ff 0%, #fafcff 100%);
}

.report-item-box.nic-box {
    border-top: 3.5px solid #0056b3;
    background: linear-gradient(135deg, #f0f6ff 0%, #fafcff 100%);
}

.report-item-box h5 {
    font-size: 13.5px;
    margin-bottom: 12px;
    color: #1a2540;
    font-family: 'Outfit', sans-serif;
}

.report-list-flat {
    list-style: none;
    padding-left: 0;
}

.report-list-flat li {
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.report-list-flat li:last-child {
    border-bottom: none;
}

.report-score-badge {
    background-color: #e8eef8;
    color: #1a2540;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid #c8d7eb;
}

.report-score-badge.meta {
    background-color: #d4f5e2;
    color: #0f6d34;
    border-color: #a8dfb8;
}

.report-notes {
    font-style: italic;
    font-size: 13px;
    color: #445069;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8fafc 0%, #f4f7fc 100%);
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid #dde6f0;
    border-left: 3px solid #c96b00;
}

.signature-row {
    margin-top: 70px;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
}

.signature-box {
    border-top: 1.5px solid #8099bc;
    width: 230px;
    text-align: center;
    padding-top: 10px;
    font-size: 12px;
    color: #445069;
    font-weight: 500;
}

/* 13. ESTADOS DE ERROR, CARGA Y VACÍOS */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 15px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 40px;
    color: var(--text-light);
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 14px;
}

/* 14. ANIMACIONES */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseIcon {
    from {
        box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
    }

    to {
        box-shadow: 0 4px 22px rgba(13, 148, 136, 0.7);
    }
}

/* 15. RESPONSIVIDAD GENERAL */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 240px 1fr;
    }

    .explorer-grid {
        grid-template-columns: 220px 1fr 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        /* Sería ideal un drawer móvil, pero por foco mantendremos diseño escritorio adaptativo */
    }

    .explorer-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .patrones-list,
    .nanda-list,
    .relations-panel {
        height: 350px;
    }

    .form-grid,
    .creator-dual-panel {
        grid-template-columns: 1fr;
    }

    .dual-left {
        border-right: none;
        padding-right: 0;
        margin-bottom: 20px;
    }
}

/* Marca de agua para impresión (oculta por defecto en pantalla) */
.print-watermark {
    display: none;
}

/* ==========================================================================
   16. REGLAS EXCLUSIVAS DE IMPRESIÓN (@media print)
   ========================================================================== */
@media print {

    @page {
        margin: 0; /* Elimina encabezados y pies de página predeterminados (como la URL de localhost) */
    }

    body {
        margin: 1.6cm 2cm !important; /* Mantiene un margen físico en la hoja impresa */
    }

    /* Ocultar elementos web no deseados */
    .app-container,
    .sidebar,
    .app-header,
    .stepper,
    .step-footer,
    .creator-actions,
    .modal-header,
    .btn,
    .theme-toggle,
    .modal-overlay::before,
    .history-toolbar,
    /* Chatbot Nursy — excluido de impresión */
    #nursy-root,
    #nursy-fab,
    #nursy-window,
    .chatbot-wrapper,
    .chatbot-fab-btn,
    .chatbot-window,
    .chatbot-window-panel,
    .sidebar-nursy-banner {
        display: none !important;
    }

    /* Ajustar cuerpo global */
    body,
    html {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Mostrar solo la zona de impresión */
    .modal-overlay {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        display: block !important;
        padding: 0 !important;
        z-index: auto !important;
    }

    .clinical-modal-content {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .modal-body {
        padding: 0 !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .print-section {
        display: block !important;
        width: 100% !important;
    }

    /* Formateo Clínico en Papel */
    .clinical-report {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }

    .report-header {
        border-bottom: 3px solid #000000 !important;
    }

    .report-logo {
        color: #000000 !important;
    }

    .report-section-title {
        background-color: #f1f5f9 !important;
        border-left: 5px solid #000000 !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .patient-info-table td.label-cell {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .report-item-box {
        border: 1px solid #94a3b8 !important;
        background: transparent !important;
        page-break-inside: avoid;
        margin-bottom: 15px;
    }

    .nanda-card-report {
        background: transparent !important;
    }

    .report-item-box.noc-box {
        border-top: 3px solid #000000 !important;
    }

    .report-item-box.nic-box {
        border-top: 3px solid #000000 !important;
    }

    .report-score-badge {
        border: 1px solid #000000 !important;
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    .signature-row {
        margin-top: 80px !important;
        page-break-inside: avoid;
    }

    .signature-box {
        border-top: 1px solid #000000 !important;
    }

    /* Marca de agua centrada en TODAS las páginas impresas */
    .print-watermark {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
        z-index: 99999;
        pointer-events: none;
    }

    .print-watermark img {
        width: 450px;
        max-width: 75%;
        opacity: 0.12;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ------------------------------------------
   ESTILOS DE VALORACIÓN GORDON (PASO 2)
--------------------------------------------- */
.gordon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gordon-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.gordon-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.gordon-card.altered {
    border-color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.05);
}

.gordon-card-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    height: 50px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.gordon-card.altered .gordon-card-icon {
    color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.1);
}

.gordon-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.gordon-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 15px 0;
    flex-grow: 1;
}

.gordon-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.gordon-card.altered .gordon-toggle {
    background-color: var(--warning-color);
    color: #fff;
    border-color: var(--warning-color);
}

.altered-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--warning-color);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.gordon-card.altered .altered-badge {
    opacity: 1;
    transform: scale(1);
}

.nanda-select-list .pattern-group-header {
    background-color: var(--bg-secondary);
    padding: 10px 15px;
    margin: 15px 0 10px 0;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid var(--primary-color);
}

.nanda-select-list .pattern-group-header:first-child {
    margin-top: 0;
}

/* ==========================================================================
   CHATBOT NURSY STYLES — VERSIÓN LIMPIA Y FUNCIONAL
   ========================================================================== */

/* Contenedor fijo en esquina inferior derecha */
.chatbot-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

/* Botón de apertura (FAB) */
.chatbot-fab-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(13, 148, 136, 0.45);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.25s ease;
    animation: nursyFloat 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.chatbot-fab-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.4);
    animation: nursyPing 2s ease-out infinite;
    z-index: -1;
}

.chatbot-fab-btn:hover {
    transform: scale(1.12) translateY(-4px);
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.55);
}

@keyframes nursyFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes nursyPing {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Ventana del chat */
.chatbot-window-panel {
    width: 360px;
    height: 510px;
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Cerrado por defecto */
    transform-origin: bottom right;
    transform: scale(0.4) translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.3s ease;
}

.chatbot-window-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chatbot-avatar-launcher {
    position: relative;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--primary-light);
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.chatbot-avatar-launcher:hover {
    transform: scale(1.1) translateY(-5px);
}

.launcher-icon {
    font-size: 30px;
    color: var(--primary);
    z-index: 2;
}

.launcher-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: var(--primary-light);
    z-index: 1;
    opacity: 0.4;
    animation: pulseAvatar 2s infinite ease-out;
}

@keyframes pulseAvatar {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.launcher-message {
    position: absolute;
    right: 80px;
    bottom: 10px;
    background: var(--bg-card);
    padding: 10px 15px;
    border-radius: 20px;
    border-bottom-right-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    animation: slideInMessage 0.5s 2s forwards, fadeOutMessage 0.5s 7s forwards;
}

@keyframes slideInMessage {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOutMessage {
    to {
        opacity: 0;
        transform: translateX(10px);
    }
}

/* Sidebar Dynamic Banner */
.sidebar-nursy-banner {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(13, 148, 136, 0.02));
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-nursy-banner:hover {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.25), rgba(13, 148, 136, 0.05));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.15);
    border-color: rgba(13, 148, 136, 0.4);
}

.nursy-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.2);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nursy-banner-text {
    display: flex;
    flex-direction: column;
}

.nursy-banner-text strong {
    font-size: 14px;
    color: white;
    font-family: var(--font-heading);
}

.nursy-banner-text span {
    font-size: 11px;
    color: #94a3b8;
}

.nursy-banner-status {
    position: absolute;
    right: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: blinkStatus 2s infinite;
}

@keyframes blinkStatus {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.chatbot-window {
    width: 350px;
    height: 500px;
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    pointer-events: none;
}

/* chatbot-window-panel is the new ID-less panel — inherits all chatbot-window styles */
.chatbot-window-panel {
    width: 360px;
    height: 510px;
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.3) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    pointer-events: none;
}

.chatbot-window.active,
.chatbot-window-panel.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary), #064e3b);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
}

.chat-avatar-container {
    position: relative;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.btn-close-chat {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-close-chat:hover {
    color: white;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--bg-app);
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageFadeInUp 0.3s ease forwards;
}

@keyframes messageFadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary-glow);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background-color: var(--border-color);
    color: var(--text-secondary);
}

.message-content {
    background-color: var(--bg-card);
    padding: 12px 16px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.user-message .message-content {
    background-color: var(--primary-light);
    color: white;
    border-top-right-radius: 4px;
    border-top-left-radius: 16px;
    border-color: transparent;
}

.chatbot-input-area {
    padding: 15px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

#chatbot-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-send-chat {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-send-chat:hover {
    background-color: var(--primary);
    transform: scale(1.05);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 15px 20px;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card);
    border-radius: 16px;
    border-top-left-radius: 4px;
    width: fit-content;
    border: 1px solid var(--border-color);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ==========================================================================
   SISTEMA DE DISEÑO RESPONSIVO (MEDIA QUERIES)
   ========================================================================== */

/* Botón Hamburguesa oculto por defecto */
.menu-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 22px;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-toggle-btn:hover {
    background-color: var(--primary-glow);
    color: var(--primary-light);
}

/* 1. TABLETS Y PORTÁTILES PEQUEÑOS (<= 1024px) */
@media screen and (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        /* Una sola columna: contenido principal */
    }

    /* Barra lateral se convierte en Drawer (cajón deslizante) */
    .sidebar {
        position: fixed;
        top: 0;
        left: -290px;
        /* Escondido a la izquierda */
        bottom: 0;
        width: 280px;
        z-index: 9999;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100vh;
        display: flex !important;
    }

    .sidebar.open {
        left: 0;
        /* Deslizar hacia adentro */
    }

    /* Mostrar botón hamburguesa en cabecera */
    .menu-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 16px;
    }

    .app-header {
        padding: 16px 20px;
    }

    /* Grillas del dashboard */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .dashboard-footer-grid {
        grid-template-columns: 1fr;
        /* Apilar tarjetas de metodología y recientes */
        gap: 20px;
    }

    /* Explorador en cascada vertical */
    .explorer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: auto;
    }

    .patrones-list,
    .nanda-list,
    .relations-panel {
        height: 350px;
        /* Altura más baja para navegación vertical cómoda */
    }

    /* Formulario del Creador */
    .creator-dual-panel {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dual-left {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }
}

/* 2. DISPOSITIVOS MÓVILES (<= 768px) */
@media screen and (max-width: 768px) {
    .view-container {
        padding: 20px 16px;
    }

    /* Rediseño banner de bienvenida */
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px;
    }

    .banner-text {
        max-width: 100%;
    }

    .banner-text h2 {
        font-size: 22px;
    }

    .banner-illustration {
        display: none;
        /* Ocultar ilustración en pantallas pequeñas */
    }

    .banner-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .banner-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Tarjetas de estadísticas a 1 columna */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Pasos del Creador (Stepper) adaptativo horizontal con scroll */
    .stepper {
        overflow-x: auto;
        padding: 10px 0;
        margin-bottom: 20px;
        justify-content: flex-start;
        gap: 12px;
    }

    .step-item {
        flex-shrink: 0;
        min-width: 70px;
    }

    .step-line {
        display: none;
        /* Ocultar líneas conectoras para ahorrar espacio */
    }

    /* Formulario de paciente */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Metodología pasos a 1 columna */
    .methodology-steps {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Modal Clínico Responsivo */
    .clinical-modal-content {
        height: 95vh;
    }

    .modal-body {
        padding: 20px 16px;
    }

    /* Encabezado del reporte imprimible adaptativo */
    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .report-meta {
        text-align: left;
    }

    .patient-info-table td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    .patient-info-table td.label-cell {
        background-color: #f1f5f9;
        font-weight: 700;
    }

    /* Calificación Likert */
    .noc-indicators-table th:nth-child(2),
    .noc-indicators-table th:nth-child(3),
    .noc-indicators-table td:nth-child(2),
    .noc-indicators-table td:nth-child(3) {
        padding: 8px 4px;
    }

    .likert-selector {
        gap: 2px;
    }

    .likert-btn {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }

    /* Firma en el reporte */
    .signature-row {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }

    .signature-box {
        width: 100%;
        max-width: 280px;
    }
}

/* Soporte de visualización extra para teléfonos muy pequeños */
@media screen and (max-width: 480px) {
    .app-header {
        display: grid;
        grid-template-areas: 
            "toggle actions"
            "search search";
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 10px 8px;
        padding: 12px 16px;
    }

    .menu-toggle-btn {
        grid-area: toggle;
        margin-right: 0 !important;
        justify-self: start;
        display: flex !important;
    }

    .header-search {
        grid-area: search;
        width: 100%;
    }

    .header-actions {
        grid-area: actions;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
    }

    .app-header .user-info {
        display: none;
    }

    .user-profile {
        padding-left: 0;
        border-left: none;
    }
}

/* Sección de Títulos de Formularios */
.form-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-light);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 16px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botón Administrador en Sidebar */
.btn-sidebar-admin {
    width: 100%;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.05) 0%, rgba(15, 118, 110, 0.05) 100%);
    border: 1px solid rgba(0, 86, 179, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.btn-sidebar-admin:hover {
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.1) 0%, rgba(15, 118, 110, 0.1) 100%);
    border-color: rgba(0, 86, 179, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.08);
}

.btn-sidebar-admin.admin-active {
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.9) 0%, rgba(15, 118, 110, 0.9) 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.25);
}

.admin-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0056b3;
    font-size: 18px;
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-sidebar-admin.admin-active .admin-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-sidebar-admin-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-title {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    transition: var(--transition);
}

.admin-status {
    font-size: 14px;
    font-weight: 600;
    color: solid white;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.btn-sidebar-admin.admin-active .admin-title {
    color: rgba(255, 255, 255, 0.7);
}

.btn-sidebar-admin.admin-active .admin-status {
    color: white;
}


/* ============================================
   MODAL DE ACCESO ADMINISTRADOR - ESTILOS
   ============================================ */

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 15, 35, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transform: translateY(30px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.admin-modal-overlay.active .admin-modal-card {
    transform: translateY(0) scale(1);
}

.admin-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0f766e, #0056b3, #7c3aed);
}

.admin-modal-header {
    padding: 36px 36px 24px;
    text-align: center;
    position: relative;
    background: linear-gradient(160deg, var(--bg-card) 0%, rgba(0, 86, 179, 0.04) 100%);
    border-bottom: 1px solid var(--border-color);
}

.admin-modal-logo {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, #0056b3 0%, #0f766e 100%);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 8px 24px rgba(0, 86, 179, 0.3);
}

.admin-modal-header h2 {
    font-size: 22px;
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 6px;
}

.admin-modal-header p {
    font-size: 13.5px;
    color: var(--text-light);
}

.admin-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.admin-modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(201, 31, 31, 0.3);
    transform: rotate(90deg);
}

.admin-modal-body {
    padding: 28px 36px 32px;
}

.admin-step {
    display: none;
    animation: fadeIn 0.3s ease forwards;
}

.admin-step.active {
    display: block;
}

.admin-field-group {
    margin-bottom: 20px;
}

.admin-field-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.admin-field-group label i {
    color: var(--primary-light);
}

.admin-field-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition-fast);
    outline: none;
    box-sizing: border-box;
}

.admin-field-group input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.admin-field-hint {
    font-size: 11.5px;
    color: var(--text-light);
    margin-top: 5px;
    display: block;
}

.admin-input-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    overflow: hidden;
    transition: var(--transition-fast);
}

.admin-input-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.admin-input-prefix {
    padding: 12px 12px 12px 16px;
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-light);
    background: var(--primary-glow);
    border-right: 1px solid var(--border-color);
    user-select: none;
}

.admin-input-wrapper input {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    flex: 1;
    padding: 12px 16px;
}

.admin-pass-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    overflow: hidden;
    transition: var(--transition-fast);
}

.admin-pass-wrapper:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.admin-pass-wrapper input {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    flex: 1;
    padding: 12px 16px;
}

.admin-eye-btn {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 0 14px;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.2s;
}

.admin-eye-btn:hover {
    color: var(--primary-light);
}

.admin-btn-primary {
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #0056b3 0%, #0f766e 100%);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 6px;
    box-shadow: 0 4px 14px rgba(0, 86, 179, 0.25);
}

.admin-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 86, 179, 0.35);
}

.admin-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.admin-btn-back {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: var(--transition-fast);
}

.admin-btn-back:hover {
    background: var(--bg-app);
    color: var(--text-primary);
}

.admin-error-msg {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-left: 3px solid #ef4444;
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    font-size: 13px;
    color: #ef4444;
    margin-bottom: 16px;
}

.admin-welcome-user {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.08) 0%, rgba(15, 118, 110, 0.06) 100%);
    border: 1px solid rgba(0, 86, 179, 0.15);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 22px;
    color: var(--primary-light);
    font-weight: 600;
    font-size: 15px;
}

.admin-welcome-user i {
    font-size: 26px;
}

.admin-setup-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(0, 86, 179, 0.06) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 22px;
}

.admin-setup-notice>i {
    font-size: 22px;
    color: #7c3aed;
    margin-top: 2px;
    flex-shrink: 0;
}

.admin-setup-notice strong {
    font-size: 14px;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.admin-setup-notice p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0;
}

.admin-guest-notice {
    margin-top: 24px;
    padding: 10px 14px;
    background: var(--bg-app);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xs);
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* ============================================
   USER PROFILE BUTTON Y ESTADÍSTICAS COMPACTAS
   ============================================ */

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 6px 16px 6px 6px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    margin-left: 8px;
}

.user-profile-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.user-profile-btn.admin-active {
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.05) 0%, rgba(15, 118, 110, 0.05) 100%);
    border-color: rgba(0, 86, 179, 0.3);
}

.user-profile-btn .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.user-profile-btn.admin-active .avatar {
    background: var(--primary-light);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.2);
}

.user-profile-btn .user-info {
    display: flex;
    flex-direction: column;
}

.user-profile-btn .user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-profile-btn .user-role {
    font-size: 11px;
    color: var(--text-light);
}

/* Estadísticas Compactas */
.compact-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.compact-stats .stat-card {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-direction: row;
    min-height: auto;
    border-radius: 14px;
}

.compact-stats .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 18px;
    margin-bottom: 0;
    border-radius: 12px;
}

.compact-stats .stat-info {
    text-align: left;
}

.compact-stats .stat-info h3 {
    font-size: 18px;
    margin-bottom: 2px;
}

.compact-stats .stat-info p {
    font-size: 11.5px;
}

@media (max-width: 1024px) {
    .compact-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .compact-stats {
        grid-template-columns: 1fr;
    }
}

/* Banner de Rol Activo (Invitado / Administrador) */
.role-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 40px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    flex-wrap: wrap;
    line-height: 1.4;
}

.role-banner i {
    font-size: 15px;
    flex-shrink: 0;
}

.role-banner strong {
    font-weight: 700;
    white-space: nowrap;
}

.role-banner span {
    color: var(--text-secondary);
    font-size: 12.5px;
}

/* Modo Invitado: Tono sutil azulado/advertencia */
.role-banner.guest-mode {
    background: linear-gradient(90deg, rgba(0, 86, 179, 0.05) 0%, rgba(201, 107, 0, 0.02) 100%);
    border-bottom: 1px solid rgba(0, 86, 179, 0.1);
}

.role-banner.guest-mode i {
    color: var(--primary-light);
}

.role-banner.guest-mode strong {
    color: var(--primary-light);
}

/* Modo Administrador: Tono sutil verde/éxito */
.role-banner.admin-mode {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

.role-banner.admin-mode i {
    color: var(--success);
}

.role-banner.admin-mode strong {
    color: var(--success);
}

.role-banner-link {
    background: none;
    border: none;
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.role-banner-link:hover {
    color: var(--primary);
}

.role-banner-sep {
    color: var(--text-light);
    opacity: 0.5;
}

/* ==========================================================================
   17. ESTILOS DE LA PANTALLA DE AUTENTICACIÓN (LOGIN DESLIZABLE)
   ========================================================================== */

.auth-screen {
    --auth-teal: var(--primary-light); /* IUTEPAL Blue */
    --auth-teal-dark: var(--primary); /* Deep Navy */
    --auth-white: var(--bg-card);
    --auth-gray-bg: var(--bg-app);
    --auth-gray-input: rgba(200, 215, 235, 0.4);
    --auth-text-dark: var(--text-primary);
    --auth-text-muted: var(--text-light);
    --auth-radius-card: 24px;
    --auth-radius-input: 10px;
    --auth-transition-speed: 0.65s;

    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--auth-gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* Sobre todo el sistema */
    padding: 20px;
    font-family: var(--font-body);
}

/* Tarjeta principal */
.auth-screen .auth-card {
    position: relative;
    width: 100%;
    max-width: 850px;
    min-height: 520px;
    background: var(--auth-white);
    border-radius: var(--auth-radius-card);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
}

/* Panel lateral de color (círculo deslizante) */
.auth-screen .side-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 55%;
    left: 0;
    background: linear-gradient(160deg, var(--auth-teal), var(--auth-teal-dark));
    border-radius: 0 45% 45% 0 / 0 50% 50% 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: left var(--auth-transition-speed) ease-in-out,
                border-radius var(--auth-transition-speed) ease-in-out;
    padding: 40px;
}

.auth-screen .side-content {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--auth-white);
    max-width: 320px;
    animation: fadeIn 0.6s ease;
}

.auth-screen .side-content.active {
    display: flex;
}

.auth-screen .side-content h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2rem;
    margin: 0 0 16px;
    color: var(--auth-white);
}

.auth-screen .side-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.9;
    margin: 0 0 28px;
}

/* Estados deslizamiento */
.auth-screen .auth-card.show-register .side-panel {
    left: 0;
    border-radius: 0 45% 45% 0 / 0 50% 50% 0;
}

.auth-screen .auth-card.show-login .side-panel {
    left: 45%;
    border-radius: 45% 0 0 45% / 50% 0 0 50%;
}

/* Formulario panel */
.auth-screen .form-panel {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.auth-screen .form {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 45%;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--auth-transition-speed) ease-in-out,
                transform var(--auth-transition-speed) ease-in-out,
                visibility var(--auth-transition-speed) ease-in-out;
}

.auth-screen .form.active {
    opacity: 1;
    visibility: visible;
}

.auth-screen .form[id="auth-login-form"] {
    left: 0;
    transform: translateX(-50px);
}

.auth-screen .form[id="auth-login-form"].active {
    transform: translateX(0);
}

.auth-screen .form[id="auth-register-form"] {
    left: 55%;
    transform: translateX(50px);
}

.auth-screen .form[id="auth-register-form"].active {
    transform: translateX(0);
}

.auth-screen .form h1 {
    margin: 0 0 20px;
    font-size: 1.8rem;
    color: var(--auth-text-dark);
    font-weight: 700;
}

.auth-screen .form .hint {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    margin-bottom: 20px;
}

/* Campos de Formulario */
.auth-screen .field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--auth-gray-input);
    border-radius: var(--auth-radius-input);
    padding: 12px 16px;
    margin-bottom: 14px;
    border: 1.5px solid transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-screen .field:focus-within {
    border-color: var(--auth-teal);
    box-shadow: 0 0 0 3px var(--primary-glow-strong);
    background: var(--auth-white);
}

.auth-screen .field.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    background: var(--danger-light);
}

.auth-screen .field-icon {
    font-size: 0.95rem;
    color: var(--auth-text-muted);
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-screen .field:focus-within .field-icon {
    color: var(--auth-teal);
}

.auth-screen .field.error .field-icon {
    color: var(--danger);
}

.auth-screen .field input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    color: var(--auth-text-dark);
    font-family: var(--font-body);
}

.auth-screen .field input::placeholder {
    color: var(--auth-text-muted);
}

/* Botones */
.auth-screen .btn {
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.auth-screen .btn-solid-submit {
    cursor: pointer;
    background: var(--auth-teal);
    color: var(--auth-white);
    border: none;
    padding: 14px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-weight: 700;
    border-radius: 999px;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 10px;
    text-align: center;
}

.auth-screen .btn-solid-submit:hover {
    background: var(--accent); /* Cambiar a Amber Gold IUTEPAL al pasar el cursor */
    box-shadow: 0 4px 15px rgba(201, 107, 0, 0.3);
}

.auth-screen .btn-outline {
    background: transparent;
    border: 2px solid var(--auth-white);
    color: var(--auth-white);
    padding: 10px 32px;
    font-size: 0.9rem;
    margin-top: 15px;
}

.auth-screen .btn-outline:hover {
    background: var(--auth-white);
    color: var(--auth-teal);
}

/* Ocultar scrollbars dentro del form */
.auth-screen .form::-webkit-scrollbar {
    display: none;
}

/* Responsividad */
@media (max-width: 720px) {
    .auth-screen .auth-card {
        flex-direction: column;
        min-height: 580px;
        height: auto;
    }

    .auth-screen .side-panel {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 190px;
        left: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        z-index: 10;
        padding: 30px 20px;
    }

    .auth-screen .auth-card.show-login .side-panel {
        left: 0 !important;
        border-radius: 24px 24px 0 0 !important;
    }

    .auth-screen .settings-floating-btn {
        top: max(20px, env(safe-area-inset-top, 20px)) !important;
        right: max(20px, env(safe-area-inset-right, 20px)) !important;
    }

    .auth-screen .form-panel {
        position: relative;
        flex-grow: 1;
        height: 380px;
        overflow: hidden;
    }

    .auth-screen .form {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0 !important;
        width: 100%;
        padding: 24px 28px;
        transition: transform var(--auth-transition-speed) ease-in-out,
                    opacity var(--auth-transition-speed) ease-in-out,
                    visibility var(--auth-transition-speed) ease-in-out;
    }

    .auth-screen .form[id="auth-login-form"] {
        left: 0 !important;
        transform: translateX(0);
    }

    .auth-screen .form[id="auth-login-form"]:not(.active) {
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
    }

    .auth-screen .form[id="auth-register-form"] {
        left: 0 !important;
        transform: translateX(0);
    }

    .auth-screen .form[id="auth-register-form"]:not(.active) {
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
    }
}

/* Cabecera del formulario de autenticación con logo */
.auth-screen .auth-form-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.auth-screen .auth-brand-logo {
    height: 70px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-screen .side-panel-icon {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* ==========================================
   FOOTER INSTITUCIONAL PREMIUM
========================================== */
.app-footer {
    padding: 22px 30px;
    background: var(--bg-card);
    border-top: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.app-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--accent) 50%, var(--primary-light) 100%);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.footer-logo {
    height: 52px;
    width: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.footer-institution {
    display: flex;
    flex-direction: column;
}

.footer-institution strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-light);
    font-family: var(--font-heading);
    letter-spacing: 0.3px;
}

.footer-institution span {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.4;
    margin-top: 2px;
}

.footer-center {
    flex: 1;
    text-align: center;
    padding: 0 20px;
}

.footer-system-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.footer-system-name i {
    color: var(--primary-light);
}

.footer-description {
    font-size: 11px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.footer-link-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--primary-light);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: var(--transition-fast);
    font-family: var(--font-body);
}

.footer-link-btn:hover {
    background: var(--primary-glow);
    border-color: var(--primary-light);
}

.footer-copyright {
    font-size: 11px;
    color: var(--text-light);
    margin: 0;
}

/* ESTILOS PARA EL BANNER DE SUPER ADMINISTRADOR */
.role-banner.super-admin-mode {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.35);
}
.role-banner.super-admin-mode span,
.role-banner.super-admin-mode strong {
    color: #ffffff !important;
    opacity: 1 !important;
}
.role-banner.super-admin-mode i {
    color: #facc15 !important;
}
.role-banner.super-admin-mode .role-banner-link {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
}

@media (max-width: 900px) {
    .app-footer {
        padding: 10px 15px; /* Reducido drásticamente */
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 8px; /* Espacio mínimo */
    }
    .footer-logo-section {
        justify-content: center;
        flex-direction: row; /* Horizontal para ocupar menos espacio */
        gap: 6px;
    }
    .footer-logo {
        height: 28px; /* Logo super pequeño */
        width: 28px;
        border: 1px solid var(--border-color);
    }
    .footer-institution {
        align-items: flex-start;
        text-align: left;
    }
    .footer-institution strong {
        font-size: 11px; /* Letra compacta */
        line-height: 1.1;
    }
    .footer-institution span {
        display: none; /* Ocultar en móvil para ahorrar espacio vertical */
    }
    .footer-institution br {
        display: none;
    }
    .footer-center {
        padding: 0;
    }
    .footer-system-name {
        flex-direction: row;
        justify-content: center;
        gap: 4px;
        font-size: 10px; /* Texto compacto */
        margin-bottom: 2px;
    }
    .footer-description {
        display: none; /* Ocultar descripción larga en móviles */
    }
    .footer-right {
        align-items: center;
        flex-direction: row; /* En horizontal para ahorrar altura */
        justify-content: center;
        width: 100%;
        gap: 8px;
        margin-top: 4px;
    }
    .footer-right .footer-link-btn {
        width: auto;
        padding: 3px 8px;
        font-size: 9px; /* Botones diminutos */
        border-radius: 12px;
    }
    .footer-copyright {
        font-size: 9px;
        margin-top: 2px;
        width: 100%;
        text-align: center;
    }
}