/**
 * Gestemas Glassmorphism v3 Pro Enhancements
 * Dashboard & UI Components
 * 
 * @version 3.1
 * @author Gestemas Team
 */

/* ============================================
   GLASSMORPHISM V3 VARIABLES
   ============================================ */
:root {
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-dark: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.45);
    --glass-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    --glass-shadow-hover: 0 20px 50px -10px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    --glass-backdrop: blur(24px) saturate(180%);

    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-blue: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);

    /* 360 Profile Fluid Tokens (Silicon Valley Standards) */
    --profile-gap: clamp(10px, 2.8vw, 24px);
    --profile-padding: clamp(12px, 2.5vw, 22px);
    --card-radius-premium: 20px;
    --glass-shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.06);
}

/* ============================================
   AVATAR GLASSMORPHISM V3
   ============================================ */
.profile-avatar-glass-v3 {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 32px rgba(102, 126, 234, 0.35),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar-glass-v3:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 12px 48px rgba(102, 126, 234, 0.45),
        inset 0 2px 6px rgba(255, 255, 255, 0.4);
}

.profile-avatar-glass-v3 .avatar-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-glow 3s ease-in-out infinite;
    pointer-events: none;
}

.avatar-initial {
    color: white;
    font-weight: 700;
    font-size: 28px;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.status-indicator-glass {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #10b981;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    z-index: 2;
}

.status-indicator-glass.online {
    animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.98);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes pulse-status {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 2px 12px rgba(16, 185, 129, 0.7);
    }
}

/* ============================================
   HEADER GLASSMORPHISM
   ============================================ */
.dashboard-header-glass-v3 {
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* ============================================
   GLASS BUTTONS & QUICK ACTIONS V3
   ============================================ */
.quick-action-tile-v3 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.quick-action-tile-v3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.quick-action-tile-v3:hover::before {
    transform: scaleX(1);
}

.quick-action-tile-v3:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow-hover);
    border-color: rgba(26, 115, 232, 0.3);
}

.quick-action-tile-v3:active {
    transform: translateY(-2px);
}

.tile-icon-v3 {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
    transition: all 0.3s ease;
}

.quick-action-tile-v3:hover .tile-icon-v3 {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
}

.tile-icon-v3 i,
.tile-icon-v3 svg {
    width: 24px;
    height: 24px;
    color: #ffffff !important;
    stroke: #ffffff !important;
}

.tile-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gestemas-gray-900);
    text-align: center;
}

.tile-desc {
    font-size: 11px;
    color: var(--gestemas-gray-600);
    text-align: center;
}

.quick-action-tile-v3.secondary .tile-icon-v3 {
    background: var(--gradient-purple);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.quick-action-tile-v3.secondary .tile-icon-v3 i {
    color: #ffffff !important;
}

/* ============================================
   RESPONSIVE QUICK ACTIONS
   ============================================ */
@media (min-width: 481px) and (max-width: 768px) {
    .quick-actions-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quick-action-tile-v3 {
        padding: 20px 12px;
    }

    .tile-icon-v3 {
        width: 40px;
        height: 40px;
    }

    .tile-icon-v3 i {
        width: 20px;
        height: 20px;
    }

    .tile-label {
        font-size: 13px;
    }

    .tile-desc {
        font-size: 10px;
    }
}

/* ============================================
   GLASS CARDS V3
   ============================================ */
.glass-v3-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-v3-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.glass-v3-card:hover {
    box-shadow: var(--glass-shadow-hover);
    transform: translateY(-2px);
}

/* ============================================
   GLASS PANELS
   ============================================ */
.glass-v3-panel {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 24px;
}

/* ============================================
   TOOLTIPS WITH GLASSMORPHISM
   ============================================ */
.gestemas-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted rgba(26, 115, 232, 0.5);
    text-decoration: none;
    transition: all 0.2s ease;
}

.gestemas-tooltip:hover {
    border-bottom-color: #1a73e8;
    color: #1a73e8;
}

.gestemas-tooltip[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--gestemas-gray-900);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 10000;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 120px;
    max-width: min(300px, 90vw);
    text-align: center;
    font-weight: 500;
    pointer-events: none;
    animation: tooltip-fade-in 0.2s ease;
}

.gestemas-tooltip[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.98);
    z-index: 10001;
    animation: tooltip-fade-in 0.2s ease;
}

@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   GLASS BADGES
   ============================================ */
.plan-badge-glass-v3,
.role-badge-glass-v3 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 12px;
    font-weight: 600;
    color: var(--gestemas-gray-800);
    transition: all 0.3s ease;
}

.plan-badge-glass-v3:hover,
.role-badge-glass-v3:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.plan-badge-glass-v3 i {
    width: 14px;
    height: 14px;
    color: #f59e0b;
}

/* ============================================
   DATE CAPSULE GLASS V3
   ============================================ */
.gestemas-glass-v3 {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gestemas-gray-700);
    transition: all 0.3s ease;
}

.gestemas-glass-v3:hover {
    box-shadow: var(--glass-shadow-hover);
    transform: translateY(-2px);
}

.gestemas-glass-v3 i {
    width: 18px;
    height: 18px;
    color: var(--gestemas-primary);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-header-glass-v3 {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .profile-avatar-glass-v3 {
        width: 56px;
        height: 56px;
    }

    .avatar-initial {
        font-size: 24px;
    }

    .status-indicator-glass {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .quick-action-tile-v3,
    .glass-v3-card,
    .glass-v3-panel {
        background: white !important;
        backdrop-filter: none !important;
        border: 1px solid #e5e7eb !important;
    }

    .gestemas-tooltip[title]::after,
    .gestemas-tooltip[title]::before {
        display: none !important;
    }
}


/* ============================================
   UPDATE NOTIFICATION PRO (TOAST)
   ============================================ */
.update-notification-pro {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 8px 4px;
}

.unp-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gestemas-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.unp-icon i {
    width: 20px;
    height: 20px;
    animation: spin-slow 4s linear infinite;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.unp-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.unp-text p {
    font-size: 0.85rem;
    color: var(--gestemas-gray-700);
    margin-bottom: 12px;
}

.btn-update-now {
    padding: 8px 16px;
    border-radius: 8px;
    background: white;
    color: var(--gestemas-primary);
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-update-now:hover {
    background: var(--gestemas-gray-100);
    transform: scale(1.05);
}


/* ============================================
   HOLOGRAPHIC DETAIL VIEW UTILITIES (v3.1)
   ============================================ */
.glass-v3-holographic-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 25px 60px -15px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.glass-v3-holographic-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.glass-v3-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gestemas-gray-900);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

.glass-v3-stat-chip i {
    width: 16px;
    height: 16px;
    color: var(--gestemas-primary);
}

.glass-v3-icon-blob {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--gestemas-primary-rgb), 0.1);
    color: var(--gestemas-primary);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.glass-v3-divider {
    height: 1px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.02));
    margin: 24px 0;
}

.drawer-header .plan-badge-glass-v3 {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 10px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.9);
}

/* Responsive Overrides for Mobile Sophistication */
@media (max-width: 640px) {
    .glass-v3-holographic-panel {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .drawer-header h2 {
        font-size: 1.5rem !important;
        line-height: 1.2;
    }

    .glass-v3-stat-chip {
        padding: 6px 12px;
        }
}

/* ============================================
   SMART WIZARD PREMIUM POPUPS (v3.2)
   ============================================ */
.gestemas-wizard-popup {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    width: 360px;
    max-width: calc(100vw - 40px);
    z-index: 1000000 !important;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 20px;
    overflow: visible !important;
    pointer-events: all;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    /* Enhanced Floating Effect */
    border: 1px solid rgba(255, 255, 255, 0.8);
    outline: 1px solid rgba(0, 0, 0, 0.03); /* Subtle contour */
    box-shadow: 
        0 15px 40px -10px rgba(0, 0, 0, 0.12),
        0 5px 15px -5px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gestemas-wizard-popup:hover {
    transform: translateY(-4px);
}

.wizard-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    padding-right: 40px; /* Space for the close control */
}

.wizard-icon-blob {
    width: 44px;
    height: 44px;
    background: var(--gradient-purple);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.25);
    margin-top: 2px;
}

.wizard-icon-blob i, .wizard-icon-blob svg { width: 22px; height: 22px; color: white !important; }

.wizard-title-area { flex: 1; margin-top: 2px; }
.wizard-tag { 
    display: block;
    font-size: 9px; 
    text-transform: uppercase; 
    font-weight: 800; 
    color: var(--gestemas-primary);
    letter-spacing: 0.1em;
}
.wizard-title { 
    margin: 2px 0 0; 
    font-size: 15px; 
    font-weight: 800; 
    color: var(--gestemas-gray-900); 
    line-height: 1.3;
}

.wizard-close-btn { 
    position: absolute; 
    top: -2px; 
    right: -2px; 
    background: rgba(15, 23, 42, 0.06); 
    border: 1px solid rgba(148, 163, 184, 0.18); 
    width: 34px; 
    height: 34px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
    z-index: 10;
    color: var(--gestemas-gray-700);
}
.wizard-close-btn i, .wizard-close-btn svg {
    width: 18px;
    height: 18px;
    color: inherit !important; 
    stroke-width: 2.5px; 
    pointer-events: none;
}
.wizard-close-btn:hover { 
    background: rgba(99, 102, 241, 0.08); 
    color: var(--gestemas-primary); 
    transform: scale(1.04);
}

.wizard-close-btn:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.45);
    outline-offset: 2px;
}

.wizard-body { 
    font-size: 14px; 
    line-height: 1.6; 
    color: var(--gestemas-gray-700); 
}

.wizard-footer { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding-top: 12px; 
    border-top: 1px solid rgba(0,0,0,0.05);
}

.wizard-dismiss-btn { 
    margin-left: auto; 
    font-size: 11px; 
    color: var(--gestemas-gray-400); 
    background: none; 
    border: none; 
    cursor: pointer; 
    text-decoration: underline;
}
.wizard-dismiss-btn:hover { color: var(--gestemas-gray-600); }

/* Animations */
@keyframes fade-left-wizard {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.animate-fade-left { animation: fade-left-wizard 0.5s cubic-bezier(0.2, 1, 0.3, 1) forwards; }

@keyframes fade-out-wizard {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}
.animate-fade-out { animation: fade-out-wizard 0.4s ease-in forwards; }

@media (max-width: 480px) {
    .gestemas-wizard-popup {
        width: calc(100vw - 40px) !important;
        bottom: 20px !important;
        right: 20px !important;
        left: 20px !important;
    }

    .wizard-header {
        padding-right: 38px;
    }

    .wizard-close-btn {
        width: 36px;
        height: 36px;
        top: 0;
        right: 0;
    }
}

/* ============================================
   SHARED MODAL INFRASTRUCTURE (Ported from _modals-shared.php)
   ============================================ */

/* 1. MODAL CONTAINER - Mobile First Responsive */
.gestemas-modal-premium {
    width: calc(100% - 32px);
    max-width: 500px; /* Default for small modals */
    max-height: 88vh;
    border-radius: 24px;
    margin: auto;
    background: var(--glass-bg, rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(var(--glass-blur, 28px));
    -webkit-backdrop-filter: blur(var(--glass-blur, 28px));
    box-shadow: var(--glass-shadow);
    animation: gestemas-modal-scale-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.45));
    overflow: hidden;
    position: relative;
}

.gestemas-modal-premium::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--glass-reflection);
    pointer-events: none;
    z-index: 0;
}

/* Desktop/Tablet: 769px+ */
@media (min-width: 769px) {
    .gestemas-modal-premium {
        width: 95%;
        max-width: 850px;
        max-height: 88vh;
        border-radius: 32px;
    }
}

@keyframes gestemas-modal-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.gestemas-glass-heavy {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.45));
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* 2. MODAL HEADER - Premium Edition - Unificado */
.gestemas-modal-header-premium {
    position: relative;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

@media (min-width: 640px) {
    .gestemas-modal-header-premium {
        padding: 24px 32px;
    }
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

@media (min-width: 640px) {
    .modal-header-title {
        gap: 20px;
    }
}

.gradient-icon {
    width: 40px;
    height: 40px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .gradient-icon {
        width: 56px;
        height: 56px;
        border-radius: 18px;
    }
}

.modal-header-title h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    color: var(--gestemas-gray-900);
    letter-spacing: -0.02em;
    font-family: 'Outfit', sans-serif;
}

@media (min-width: 640px) {
    .modal-header-title h3 {
        font-size: 1.75rem;
    }
}

.modal-header-title p {
    font-size: 0.80rem;
    font-weight: 500;
    margin: 2px 0 0 0;
    color: var(--gestemas-gray-500);
}

@media (min-width: 640px) {
    .modal-header-title p {
        font-size: 0.9rem;
        margin-top: 4px;
    }
}

.dimension-block .icon-btn-delete {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dimension-block .icon-btn-delete i,
.dimension-block .icon-btn-delete svg {
    width: 16px !important;
    height: 16px !important;
    stroke-width: 2.5px;
}

.dimension-block .icon-btn-delete:hover {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    transform: scale(1.1) rotate(8deg);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.modal-close-premium-hero {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.modal-close-premium-hero:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* Utility Classes for Clean Modals */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--gestemas-primary), #6366f1);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--gestemas-accent, #f59e0b), #ef4444);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #ef4444, #f472b6);
}

.shadow-primary {
    box-shadow: 0 6px 12px rgba(var(--gestemas-primary-rgb), 0.2);
}

.shadow-accent {
    box-shadow: 0 6px 12px rgba(245, 158, 11, 0.2);
}

.shadow-danger {
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.2);
}

.modal-title-text {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--gestemas-gray-900);
    letter-spacing: -0.02em;
}

.modal-subtitle-text {
    font-size: 0.80rem;
    font-weight: 500;
    margin-top: 2px;
}

.step-badge {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: white;
    margin-right: 10px;
}

.step-title {
    font-weight: 800;
    color: var(--gestemas-gray-800);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.bg-primary {
    background: var(--gestemas-primary);
}

.bg-accent {
    background: var(--gestemas-accent, #f59e0b);
}

.bg-danger {
    background: #ef4444;
}

/* 4. MODAL BODY - Unificado según estándar PONE */
.gestemas-modal-body-premium {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--gestemas-primary) transparent;
    position: relative;
    z-index: 1;
    background: transparent;
}

@media (min-width: 640px) {
    .gestemas-modal-body-premium {
        padding: 32px;
    }
}

.gestemas-modal-body-premium::-webkit-scrollbar {
    width: 8px;
}

.gestemas-modal-body-premium::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.gestemas-modal-body-premium::-webkit-scrollbar-thumb {
    background: var(--gestemas-primary, #6366f1);
    border-radius: 4px;
    min-height: 40px;
    transition: background 0.3s ease;
}

.gestemas-modal-body-premium::-webkit-scrollbar-thumb:hover {
    background: var(--gestemas-accent, #8b5cf6);
}

/* 5. SECTION GLASS - Unificado según estándar PONE */
.pone-section-glass {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.pone-section-glass:hover {
    border-color: rgba(var(--gestemas-primary-rgb, 99, 102, 241), 0.3);
}

/* 5b. GLASS PANEL V3 - Pro Section Container */
.glass-panel-v3 {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    padding: 24px;
    margin: 16px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel-v3:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* 6. SECTION HEADING */
.section-heading {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--gestemas-primary, #6366f1);
    letter-spacing: 0.05em;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

/* 6b. SECTIONS TEXT STANDARDS (Legibility Fix) */
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.block-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gestemas-gray-700); /* Forced High Contrast */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gestemas-gray-800); /* Forced High Contrast */
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle i {
    width: 18px;
    height: 18px;
}

.section-description {
    font-size: 0.85rem;
    color: var(--gestemas-gray-500);
    margin: 0;
    font-weight: 500;
}

.strategic-link-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.task-view-summary {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    padding: 14px;
    margin-bottom: 14px;
}

.task-view-summary p {
    margin: 0 0 8px 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--gestemas-gray-700);
}

.task-view-summary p:last-child {
    margin-bottom: 0;
}

.health-link-grid,
.health-medication-grid {
    width: 100%;
}

.section-step-badge {
    background: var(--gestemas-primary, #6366f1);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

/* 7. FORM GROUPS */
.g-floating-group {
    position: relative;
    margin-bottom: 16px;
}

.g-floating-group label {
    position: absolute;
    top: 0;
    left: 16px;
    font-size: 11px;
    font-weight: 800;
    color: var(--gestemas-gray-500);
    text-transform: uppercase;
    pointer-events: none;
    transition: all 0.2s;
    transform: translateY(12px);
}

.g-input {
    width: 100%;
    height: 56px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px 16px 8px;
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    outline: none;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--gestemas-gray-900);
    font-weight: 600;
}

.g-input:focus {
    border-color: var(--gestemas-primary, #6366f1);
    background: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.g-floating-group:focus-within label,
.g-floating-group .g-input:not(:placeholder-shown)~label {
    transform: translateY(-8px) scale(0.85);
}

/* 9. CHIP SELECTORS */
.student-chip-selectable {
    flex-shrink: 0;
    min-width: 180px;
    padding: 12px 16px;
    background: var(--glass-bg, white);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.student-chip-selectable input {
    display: none;
}

.student-chip-selectable.is-selected {
    background: white !important;
    border-color: var(--gestemas-primary, #6366f1) !important;
    box-shadow: 0 4px 15px rgba(var(--gestemas-primary-rgb, 99, 102, 241), 0.15);
}

.nexus-horizontal-selector {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 5px 15px;
    -webkit-overflow-scrolling: touch;
}

/* 10. TOPIC CHIPS */
.topico-chip {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--theme-border, rgba(0,0,0,0.08));
    background: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--gestemas-gray-700);
    border: 1px solid rgba(255, 255, 255, 0.5);
    white-space: normal;
    word-break: break-word;
    max-width: min(100%, 280px);
    text-align: left;
}

.topico-chip:hover,
.topico-chip:focus-visible {
    background: rgba(248, 250, 252, 0.98) !important;
    color: var(--gestemas-gray-900) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.topico-chip.is-selected {
    background: var(--gestemas-primary, #6366f1);
    color: white;
    border-color: var(--gestemas-primary, #6366f1);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.topico-chip.is-selected:hover,
.topico-chip.is-selected:focus-visible {
    background: var(--gestemas-primary, #6366f1) !important;
    color: white !important;
    border-color: var(--gestemas-primary, #6366f1) !important;
}

.topico-chip:hover .chip-icon,
.topico-chip:focus-visible .chip-icon,
.topico-chip.is-selected .chip-icon {
    color: inherit;
}

.topico-chip .chip-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.topicos-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    width: 100%;
    /* Ensure no overflow */
    overflow: visible;
}

/* 11. DIMENSION BLOCKS (Forms) */
.dimension-blocks-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.dimension-block {
    margin-bottom: 20px;
}

.glass-block-inner {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s ease;
}

.glass-block-inner:hover {
    border-color: var(--gestemas-primary-light);
    background: rgba(255, 255, 255, 0.5);
}

.dimension-block .block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dimension-block .block-label {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gestemas-primary);
}

.dimension-block .icon-btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.dimension-block .icon-btn-delete:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* 13. MODAL FOOTER - Unificado según estándar PONE */
.gestemas-modal-footer-premium {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-direction: column-reverse;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .gestemas-modal-footer-premium {
        flex-direction: row;
        padding: 20px 24px;
    }
}

.g-btn-premium {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    font-weight: 800;
    background: var(--gestemas-primary, #6366f1);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (min-width: 640px) {
    .g-btn-premium {
        width: auto;
        min-width: 200px;
        height: 52px;
    }
}

.gestemas-btn--ghost {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 13px;
    background: transparent;
    color: var(--gestemas-gray-500);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .gestemas-btn--ghost {
        width: auto;
        min-width: 160px;
        height: 52px;
        padding: 0 24px;
    }
}

.gestemas-btn--ghost:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--gestemas-gray-400);
    color: var(--gestemas-gray-800);
}

/* 19. RESPONSIVE BREAKPOINTS & GRID SYSTEM (Enhanced v5.4 - Unificado PONE) */
/* Base: Mobile First - 1 columna */
.g-grid-responsive {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

/* Tablet 640px+ - 2 columnas */
@media (min-width: 640px) {
    .g-grid-responsive {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* Desktop 1024px+ - 3 columnas (estándar PONE) */
@media (min-width: 1024px) {
    .g-grid-responsive {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Grid 2 columnas fijo */
.g-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Touch optimization helper */
.g-touch-target {
    min-height: 48px;
    touch-action: manipulation;
}

@media (min-width: 481px) and (max-width: 768px) {
    .gestemas-modal-premium {
        border-radius: 24px 24px 0 0 !important;
        max-height: 92vh;
    }

    .student-chip-selectable {
        min-width: 140px;
    }

    /* Force single column on smaller tablets/mobiles if needed */
    .g-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    /* Layout Adjustments - Mobile First */
    .g-grid-2,
    .g-grid-3,
    .g-grid-responsive {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .gestemas-modal-header-premium {
        padding: 16px 20px;
    }

    .gestemas-modal-body-premium {
        padding: 16px;
    }
    
    /* Section glass más compacto en móvil */
    .pone-section-glass {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 20px;
    }

    /* Improved Inputs for Touch */
    .g-input, 
    .g-input-select,
    select.g-input {
        height: 54px !important;
        font-size: 16px !important; /* Prevents iOS search zoom */
        border-radius: 14px !important;
    }

    /* Horizontal Selectors */
    .nexus-horizontal-selector {
        padding-bottom: 10px;
        scroll-padding-left: 20px;
    }

    .student-chip-selectable {
        min-width: 85vw; /* Show next card hint */
    }
    
    /* Floating Labels Correction for larger inputs */
    .g-floating-group label {
        transform: translateY(14px);
    }
    
    .g-floating-group:focus-within label,
    .g-floating-group .g-input:not(:placeholder-shown)~label {
        transform: translateY(-6px) scale(0.85);
    }
}

/* DARK MODE */
@media (prefers-color-scheme: dark) {
    .gestemas-modal-premium {
        background: rgba(25, 25, 25, 0.95);
        color: #f0f0f0;
        backdrop-filter: blur(28px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .gestemas-modal-body-premium {
        background: transparent;
        scrollbar-color: rgba(99, 102, 241, 0.8) rgba(255, 255, 255, 0.05);
    }

    .gestemas-modal-body-premium::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }

    .gestemas-modal-body-premium::-webkit-scrollbar-thumb {
        background: rgba(99, 102, 241, 0.8);
    }

    .gestemas-modal-body-premium::-webkit-scrollbar-thumb:hover {
        background: rgba(139, 92, 246, 0.95);
    }

    .g-input {
        background: #2a2a2a;
        color: white;
        border-color: #333;
    }

    .pone-section-glass {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* LIGHT MODE - Ensure scrollbar is visible */
@media (prefers-color-scheme: light) {
    .gestemas-modal-body-premium {
        scrollbar-color: var(--gestemas-primary, #6366f1) rgba(0, 0, 0, 0.05);
    }

    .gestemas-modal-body-premium::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.02);
    }

    .gestemas-modal-body-premium::-webkit-scrollbar-thumb {
        background: var(--gestemas-primary, #6366f1);
    }

    .gestemas-modal-body-premium::-webkit-scrollbar-thumb:hover {
        background: var(--gestemas-accent, #8b5cf6);
    }
}

/* SPECIFIC: Internal Scroll Optimization for ALL modals */
.gestemas-modal-body-premium {
    max-height: 100%;
    overflow-y: auto !important;
    scroll-behavior: smooth;
    flex: 1 1 auto;
    min-height: 0;
}

/* 20. VALIDATION & FEEDBACK (Nexus V5.3) */
.g-input.is-invalid {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.02) !important;
    animation: gestemas-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes gestemas-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Ensure header stays at top */
.gestemas-modal-header-premium {
    flex-shrink: 0;
    z-index: 10;
}

/* Ensure footer stays at bottom */
.gestemas-modal-footer-premium {
    flex-shrink: 0;
    z-index: 10;
    margin-top: auto; /* Push to bottom if content is short */
}

/* FORM LAYOUT FIX - The Critical Update */
.gestemas-premium-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    flex: 1;
}

/* BODY SCROLL FIX */
.gestemas-premium-form .gestemas-modal-body-premium {
    flex: 1;
    overflow-y: auto !important;
    max-height: none !important; /* Remove fragile calcs */
    min-height: 0; /* Webkit flex bug fix */
    padding-bottom: 20px; /* Safe space */
}

/* Alternative selectors for strong targeting */
#form-intervention-premium,
#gestemas-task-premium-form,
#gestemas-health-form,
#form-task-premium,
#form-health-premium {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 20. GLASSMORPHISM PRO FILTERS (Silicon Valley Standard) */
.glass-v3-filters-panel {
    display: none;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 24px;
    margin-bottom: 24px;
}

.glass-v3-filters-panel.is-expanded {
    display: block !important;
}

/* ---- Universal Integrity Guards (Restored) ---- */
.nexus-pro-card, 
.nexus-pro-grid, 
.gestemas-card, 
.glass-card-v3 {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.gestemas-card p,
.glass-card-v3 p {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

/* ---- Canvas Fluidity (Safe Version) ---- */
canvas {
    max-width: 100% !important;
}

.profile-chart-shell canvas {
    height: 100% !important;
    width: 100% !important;
}

.control-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    align-items: center;
}

.premium-select {
    appearance: none;
    width: 100%;
    padding: 14px 44px 14px 20px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--gestemas-gray-800);
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 18px center;
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.03);
}

.premium-select:hover {
    background-color: white;
    border-color: var(--gestemas-primary-light);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.08);
}

.premium-select:focus {
    outline: none;
    border-color: var(--gestemas-primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

@keyframes slideDownGlass {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .control-filters {
        grid-template-columns: 1fr;
    }
}
/* [Nexus V5.2] UI Refinements & Consumption Indicators */
.version-badge {
    font-size: 0.5em;
    opacity: 0.5;
    vertical-align: middle;
    background: rgba(var(--gestemas-primary-rgb), 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 8px;
}

.gestemas-consumption-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 15px;
}

.gestemas-module-hero .gestemas-actions-group {
    align-items: flex-start;
    flex-wrap: wrap;
}

.gestemas-module-hero .gestemas-consumption-kpi {
    flex: 1 1 280px;
    min-width: 260px;
    max-width: 420px;
    margin-bottom: 0;
}

.gestemas-consumption-kpi {
    margin-bottom: 20px;
}

.gestemas-consumption-kpi__shell {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.72)),
        radial-gradient(circle at top right, rgba(var(--gestemas-primary-rgb), 0.18), transparent 42%);
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.gestemas-consumption-kpi__shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 40%);
    pointer-events: none;
}

.gestemas-consumption-kpi__header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.gestemas-consumption-kpi__title-block,
.gestemas-consumption-kpi__value-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gestemas-consumption-kpi__eyebrow {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gestemas-gray-500);
}

.gestemas-consumption-kpi__title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--gestemas-gray-900);
}

.gestemas-consumption-kpi__value {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--gestemas-gray-900);
    text-align: right;
}

.gestemas-consumption-kpi__status {
    display: inline-flex;
    align-self: flex-end;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--kpi-status, var(--gestemas-primary));
}

.gestemas-consumption-kpi__bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 10px;
    background: rgba(148, 163, 184, 0.16);
}

.gestemas-consumption-kpi__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--kpi-fill, var(--gestemas-primary)), rgba(99, 102, 241, 0.72));
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.24);
    transition: width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.gestemas-consumption-kpi__fill.is-limit {
    background: linear-gradient(90deg, #ef4444, #f97316);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.25);
}

.gestemas-consumption-kpi__footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.gestemas-consumption-kpi__meta {
    font-size: 11px;
    font-weight: 700;
    color: var(--gestemas-gray-500);
}

.gestemas-consumption-kpi__meta strong {
    color: var(--gestemas-gray-900);
    font-weight: 900;
}

.gestemas-consumption-kpi__upgrade {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #b45309;
}

.gestemas-consumption-kpi__upgrade i {
    width: 12px;
    height: 12px;
}

@media (max-width: 640px) {
    .gestemas-consumption-kpi {
        margin-bottom: 16px;
    }

    .gestemas-consumption-kpi__shell {
        padding: 14px 14px 13px;
        border-radius: 18px;
    }

    .gestemas-consumption-kpi__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .gestemas-consumption-kpi__value-block {
        align-items: flex-start;
    }

    .gestemas-consumption-kpi__value {
        text-align: left;
    }

    .gestemas-consumption-kpi__footer {
        align-items: flex-start;
    }
}

.consumption-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gestemas-gray-500);
}

.consumption-label.is-limit {
    color: #ef4444;
}

.consumption-bar {
    width: 100px;
    height: 4px;
    background: var(--gestemas-gray-200);
    border-radius: 4px;
    margin-top: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--gestemas-primary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill.is-limit {
    background: #ef4444;
}

.gestemas-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
}

.control-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 1;
    transform: translateY(0);
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out forwards;
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Fix for feedback charts layout in Glass panels */
.glass-v3-filters-panel .feedback-indicators-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 1024px) {
    .gestemas-control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-actions {
        margin-left: 0;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

/* ============================================
   NEXUS LAYOUT STANDARDIZATION [v5.6]
   Master Controller for Margins and Paddings
   ============================================ */
:root {
    /* Fallbacks - Overridden by app.php injection */
    --gst-layout-margin-desktop: 40px;
    --gst-layout-margin-mobile: 8px;
    --gst-layout-padding-panel: 20px;
}

/* 1. Global Page Margins — aplicado SOLO al wrapper externo para evitar doble padding */
.gestemas-content-wrapper,
.gestemas-page,
.gestemas-page-premium,
.gestemas-container,
.nexus-container,
#gestemas-content {
    padding-left: var(--gst-layout-margin-desktop) !important;
    padding-right: var(--gst-layout-margin-desktop) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 2. Responsive Margins (Mobile & XS) */
@media (max-width: 768px) {
    .gestemas-content-wrapper,
    .gestemas-page,
    .gestemas-page-premium,
    .gestemas-container,
    .nexus-container,
    #gestemas-content {
        padding-left: var(--gst-layout-margin-mobile, 16px) !important;
        padding-right: var(--gst-layout-margin-mobile, 16px) !important;
    }
}

@media (max-width: 480px) {
    .gestemas-content-wrapper,
    .gestemas-page,
    .gestemas-page-premium,
    .gestemas-container,
    .nexus-container,
    #gestemas-content {
        padding-left: var(--gst-layout-margin-xs, 10px) !important;
        padding-right: var(--gst-layout-margin-xs, 10px) !important;
    }

    /* Reduce internal padding for panels on XS to gain space */
    .glass-v3-panel,
    .glass-v3-filters-panel,
    .nexus-card,
    .gestemas-card,
    .nexus-section-glass,
    .gestemas-block,
    .glass-block-inner,
    .resource-body-v3,
    .gestemas-page-header {
        padding: 12px !important;
        border-radius: 20px !important;
    }
}

/* 3. Panel/Card Internal Padding (20px) */
.glass-v3-panel,
.glass-v3-filters-panel,
.nexus-card,
.gestemas-card,
.nexus-section-glass,
.gestemas-block,
.glass-block-inner,
.resource-body-v3,
.gestemas-page-header {
    padding: var(--gst-layout-padding-panel) !important;
    border-radius: 24px !important;
}

/* 4. Filter Panels & Control Bar Refinement */
.glass-v3-filters-panel, .gestemas-control-bar {
    margin-bottom: 24px !important;
}

/* 4.1 Student Profile Tab Standardization */
.gestemas-view-perfil-v2 .profile-view-tab,
.gestemas-profile-view-container > .tab-content-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gestemas-view-perfil-v2 .gestemas-content-wrapper,
.gestemas-view-perfil-v2 .gestemas-page-wrapper,
.gestemas-view-perfil-v2 .gestemas-page,
.gestemas-view-perfil-v2 .gestemas-page-premium,
.gestemas-view-perfil-v2 .gestemas-container,
.gestemas-view-perfil-v2 .nexus-container,
.gestemas-view-perfil-v2 #gestemas-content {
    padding-left: clamp(0px, 0.8vw, 8px) !important;
    padding-right: clamp(0px, 0.8vw, 8px) !important;
}

.gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-grid,
.gestemas-view-perfil-v2 .profile-view-tab .gestemas-grid,
.gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpis-grid {
    gap: var(--profile-gap, 24px) !important;
}

.gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-card,
.gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-glass,
.gestemas-view-perfil-v2 .profile-view-tab .gestemas-card,
.gestemas-view-perfil-v2 .profile-view-tab .glass-card-v3 {
    padding: var(--profile-padding, clamp(16px, 3vw, 32px)) !important;
    border-radius: var(--profile-radius, 24px) !important;
    max-width: 100%;
    box-sizing: border-box;
}

.gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__header,
.gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__body,
.gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__footer {
    padding-left: var(--profile-padding, clamp(16px, 3vw, 32px));
    padding-right: var(--profile-padding, clamp(16px, 3vw, 32px));
    box-sizing: border-box;
}

.gestemas-view-perfil-v2 .profile-view-tab .chart-container,
.gestemas-view-perfil-v2 .profile-view-tab .feedback-chart-canvas-wrap,
.gestemas-view-perfil-v2 .profile-view-tab canvas[id*="pone-trend"],
.gestemas-view-perfil-v2 .profile-view-tab canvas[id*="pone-radar"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    height: auto !important;
}

.gestemas-view-perfil-v2 .profile-view-tab .chart-container {
    min-width: 0;
}

.gestemas-view-perfil-v2 .profile-view-tab h2,
.gestemas-view-perfil-v2 .profile-view-tab h3,
.gestemas-view-perfil-v2 .profile-view-tab h4 {
    overflow-wrap: anywhere;
    word-break: normal;
}

.profile-panel-soft {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.profile-stat-card {
    padding: var(--profile-padding, clamp(16px, 3vw, 32px));
    border-radius: 18px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.profile-stat-card--warning {
    border-left: 3px solid var(--gestemas-warning);
}

.profile-stat-card--success {
    border-left: 3px solid var(--gestemas-success);
}

.profile-stat-card--muted {
    border-left: 3px solid rgba(148,163,184,0.45);
}

.profile-kpi-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gestemas-gray-900);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.profile-kpi-value__sub {
    font-size: 1rem;
    color: var(--gestemas-gray-500);
    font-weight: 700;
}

.profile-kpi-caption {
    font-size: 0.8rem;
    color: var(--gestemas-gray-500);
    margin-top: 4px;
}

.profile-chart-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.profile-chart-tall {
    min-height: 180px;
}

.profile-chart-medium {
    min-height: 220px;
}

.profile-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--profile-gap, 24px);
    margin-bottom: var(--profile-gap, 24px);
}

@media (max-width: 1024px) {
    .profile-hero-grid,
    .profile-section-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .profile-hero-card,
    .profile-card-shell {
        padding: clamp(12px, 3vw, 20px) !important;
        width: 100% !important;
        box-sizing: border-box;
    }
}

.profile-stack {
    display: flex;
    flex-direction: column;
    gap: var(--profile-gap, 24px);
    min-width: 0;
    max-width: 100%;
}

.profile-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.profile-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
}

.profile-row > *,
.profile-row-between > *,
.profile-hero-grid > *,
.profile-section-grid > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.profile-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: var(--profile-gap, 32px);
    gap: var(--profile-gap, 32px);
}

.profile-hero-card {
    min-width: 0;
    max-width: 100%;
    min-height: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.profile-hero-glow {
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.profile-card-shell {
    min-width: 0;
    max-width: 100%;
}

.profile-chart-shell {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 180px;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-chart-shell--medium {
    height: 220px;
}

.profile-chart-shell--tall {
    height: 250px;
}

.profile-heatmap-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.profile-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: 12px;
}

.profile-table-fixed {
    width: 100%;
    min-width: 0;
}

.profile-chart-shell canvas,
.profile-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
}

.profile-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, var(--gestemas-primary) 0%, var(--gestemas-secondary) 100%);
}

.profile-pill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    flex-wrap: wrap;
}

.profile-legend-card {
    margin-top: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profile-legend-item {
    flex: 1 1 110px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gestemas-gray-600);
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.profile-narrative-card {
    background: linear-gradient(135deg, #fff 0%, rgba(99, 102, 241, 0.03) 100%);
}

.profile-narrative-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--gestemas-gray-800);
    font-style: italic;
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--gestemas-primary-light);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.profile-meta-row {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    min-width: 0;
}

.profile-meta-row > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.profile-surface-card {
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    border-radius: 16px;
}

.profile-surface-card--soft {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.profile-sos-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-sos-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-heatmap-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.6rem;
    color: var(--gestemas-gray-400);
}

.profile-heatmap-cell {
    flex: 1;
    min-width: 28px;
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
}

.profile-context-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gestemas-gray-50);
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
}

.profile-context-item__lead {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.profile-context-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.profile-context-item__meta {
    text-align: right;
    flex: 0 0 auto;
    min-width: 0;
}

.profile-context-item__title {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.profile-context-item__count {
    font-size: 0.65rem;
    color: var(--gestemas-gray-400);
}

.profile-sos-card {
    padding: 14px;
    border-radius: 16px;
    transition: transform 0.2s;
}

.profile-sos-card__head,
.profile-sos-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-sos-card__head {
    margin-bottom: 10px;
}

.profile-sos-user-item {
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.profile-sos-user-item > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-alert-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    border-left: 4px solid var(--gestemas-error);
    background: rgba(239, 68, 68, 0.05);
}

.profile-alert-item__body {
    flex: 1;
    min-width: 0;
}

.profile-pattern-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    min-width: 0;
}

.profile-pattern-item__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.profile-pattern-item__label {
    flex: 1;
    font-size: 0.85rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-pattern-item__count {
    font-size: 0.85rem;
}

.pone-mini-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pone-mini-scale__pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--gestemas-gray-600);
    font-size: 11px;
    font-weight: 800;
}

.profile-observer-empty,
.profile-sos-empty {
    text-align: center;
    padding: 20px;
    color: var(--gestemas-gray-400);
}

.profile-observer-table {
    width: 100%;
}

.profile-observer-table th {
    font-size: 0.75rem;
}

.profile-observer-table td {
    font-size: 0.8rem;
}

.profile-observer-table td:first-child {
    font-weight: 600;
}

.profile-sos-category {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gestemas-gray-600);
}

.profile-sos-category__empty {
    background: var(--gestemas-gray-50);
    border-radius: 12px;
}

.profile-sos-category__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-sos-category__list--users {
    gap: 8px;
}

.profile-sos-card--interactive {
    transition: transform 0.2s;
}

.profile-sos-card--interactive:hover {
    transform: translateY(-2px);
}

.profile-sos-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    min-width: 0;
}

.profile-stack--spacious {
    gap: 32px;
}

.profile-sos-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-sos-progress__track {
    flex: 1;
    height: 8px;
    background: var(--gestemas-gray-100);
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}

.profile-sos-progress__fill {
    height: 100%;
}

.profile-sos-card__lead {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.profile-sos-card__lead > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-sos-card__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-evolution-summary {
    display: flex;
    gap: clamp(12px, 3vw, 24px);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 16px;
    border-radius: 24px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.profile-evolution-score {
    background: linear-gradient(135deg, var(--gestemas-primary), #8b5cf6);
    border-radius: 24px;
    padding: clamp(14px, 3vw, 20px) clamp(16px, 4vw, 28px);
    color: #fff;
    flex-shrink: 0;
    text-align: center;
    min-width: min(140px, 100%);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    box-sizing: border-box;
}

.profile-evolution-score__value {
    font-size: clamp(2rem, 8vw, 3.2rem);
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    letter-spacing: -2px;
}

.profile-evolution-score__label {
    font-size: 11px;
    font-weight: 800;
    opacity: 0.9;
    margin-top: 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.profile-evolution-summary__body {
    flex: 1;
    min-width: min(240px, 100%);
    box-sizing: border-box;
}

.profile-evolution-summary__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.profile-evolution-callout {
    font-size: 0.9rem;
    color: var(--gestemas-gray-600);
    line-height: 1.6;
    font-weight: 500;
}

.profile-evolution-selector {
    display: flex;
    gap: 8px;
    background: var(--gestemas-gray-100);
    padding: 5px;
    border-radius: 14px;
    flex-wrap: wrap;
}

.profile-evolution-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--gestemas-gray-100);
    padding: 6px;
    border-radius: 14px;
    box-sizing: border-box;
}

.profile-evolution-chipset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.profile-evolution-empty {
    text-align: center;
    padding: 40px 20px;
    border: 2px dashed var(--gestemas-gray-200);
    border-radius: 20px;
}

.profile-evolution-glossary {
    padding: 20px;
    background: rgba(99, 102, 241, 0.04);
    border-radius: 24px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-sizing: border-box;
    max-width: 100%;
}

.profile-evolution-glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.profile-evolution-note {
    font-size: 0.85rem;
    color: var(--gestemas-gray-500);
    line-height: 1.6;
    margin-top: 24px;
    padding: 16px 8px 0;
    border-top: 1px solid rgba(0,0,0,0.04);
    box-sizing: border-box;
    max-width: 100%;
}

.profile-evolution-timeline {
    position: relative;
    padding-left: 20px;
}

.profile-evolution-timeline__line {
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, var(--gestemas-primary), transparent);
    opacity: 0.2;
}

.profile-kpi-grid {
    display: grid;
    gap: var(--profile-gap, 24px);
    margin-bottom: var(--profile-gap, 24px);
}

.profile-kpi-card {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.profile-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-subheader-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.profile-section-title {
    margin: 0;
    font-weight: 850;
}

.profile-muted-note {
    font-size: 0.8rem;
    color: var(--gestemas-gray-500);
    margin-top: 4px;
}

.profile-list-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profile-list-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--profile-padding) var(--profile-padding) 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    background: rgba(0,0,0,0.02);
}

.profile-list-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.profile-list-item {
    padding: var(--profile-padding);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.profile-chart-card {
    min-height: 480px;
    display: flex;
    flex-direction: column;
    padding: var(--profile-padding);
}

.profile-chart-body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(360px, 52vw, 540px);
    padding: 12px 4px 4px;
    overflow: hidden;
}

.profile-chart-body canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.profile-divider-top {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0,0,0,0.05);
}

.profile-card-shell--pad {
    padding: var(--profile-padding);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.profile-card-shell--pad-bottom {
    padding: var(--profile-padding);
    margin-bottom: var(--profile-gap, 24px);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.profile-card-shell--pad-tight {
    padding: var(--profile-padding);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.profile-space-bottom {
    margin-bottom: var(--profile-gap, 24px);
}

.profile-space-bottom-lg {
    margin-bottom: 32px;
}

.profile-space-top {
    margin-top: 24px;
}

.profile-align-start {
    align-items: flex-start;
}

.profile-mini-stat-v3 {
    flex: 1 1 140px;
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    background: white;
    border: 1px solid rgba(0,0,0,0.04);
    border-left: 4px solid var(--mini-stat-accent, var(--gestemas-primary));
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.profile-mini-stat-v3--success {
    --mini-stat-accent: var(--gestemas-success);
}

.profile-mini-stat-v3--secondary {
    --mini-stat-accent: var(--gestemas-secondary);
}

.profile-mini-stat-v3--danger {
    --mini-stat-accent: var(--gestemas-error);
}

.profile-mini-stat-v3 .label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gestemas-gray-500);
}

.profile-mini-stat-v3 .value {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 1rem;
    font-weight: 900;
    color: var(--gestemas-gray-900);
    line-height: 1.1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.iee-badge-premium {
    flex: 1 1 auto;
    max-width: 200px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-evolution-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 900;
    padding: 6px 16px;
    border-radius: 24px;
}

.profile-evolution-status-chip--success {
    background: rgba(16,185,129,0.12);
    color: #10b981;
}

.profile-evolution-status-chip--danger {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}

.profile-evolution-status-chip--neutral {
    background: rgba(100,116,139,0.12);
    color: #64748b;
}

.profile-evolution-glossary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-sizing: border-box;
}

.profile-evolution-glossary__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: white;
    color: var(--gestemas-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    border: 1px solid rgba(99, 102, 241, 0.14);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.06);
    box-sizing: border-box;
}

.profile-evolution-glossary__badge i {
    width: 12px;
    height: 12px;
    stroke-width: 2.4px;
}

.profile-evolution-glossary__text {
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--gestemas-gray-600);
    font-weight: 600;
}

.profile-evolution-summary__chip-text {
    font-weight: 600;
    opacity: 0.8;
}

.profile-evolution-glossary-item {
    font-size: 0.8rem;
    line-height: 1.5;
}

.profile-evolution-glossary-item strong {
    display: block;
    margin-bottom: 2px;
}

.profile-evolution-glossary-item em {
    color: var(--gestemas-gray-500);
}

.profile-evolution-support-label {
    font-size: 0.7em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.health-hub-layout {
    display: flex;
    flex-wrap: wrap;
    gap: var(--profile-gap, 24px);
}

.health-hub-layout > div {
    min-width: 0;
}

.gestemas-health-hero {
    margin-bottom: var(--profile-gap, 24px);
    padding: var(--profile-padding);
    border-left: 6px solid var(--gestemas-primary);
    background: linear-gradient(to right, rgba(255,255,255,0.8), rgba(248,250,252,0.5));
}

.gestemas-health-hero__wrap {
    display: flex;
    flex-wrap: wrap;
    gap: var(--profile-gap, 24px);
    justify-content: space-between;
    align-items: center;
}

.gestemas-health-hero__lead {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1 1 min(100%, 400px);
    min-width: 0;
}

.health-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.gestemas-health-hero__stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1 1 250px;
}

.gestemas-health-stat {
    flex: 1;
    min-width: 110px;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--gestemas-gray-100);
}

.gestemas-health-hero__alert {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 12px;
}

.gestemas-health-history,
.gestemas-medication-sidebar {
    min-width: 0;
    max-width: 100%;
}

.health-filter-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.health-valuations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.health-valuation-item {
    padding: var(--profile-padding);
    margin-bottom: 12px;
    border-radius: 16px;
    background: white;
    border: 1px solid var(--gestemas-gray-100);
}

.health-med-card {
    padding: var(--profile-padding);
    border: 1px solid rgba(0,0,0,0.03);
}

.health-med-item {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.health-med-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.health-med-item__text {
    flex: 1;
    min-width: 0;
}

.health-med-item__name {
    font-size: 13px;
    font-weight: 850;
    color: var(--gestemas-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.health-med-item__meta {
    font-size: 10px;
    color: var(--gestemas-gray-500);
    font-weight: 700;
    margin-top: 2px;
}

.health-alert-card {
    margin-top: var(--profile-gap);
    border-top: 4px solid var(--gestemas-error);
    background: #fffcfc;
    padding: var(--profile-padding);
}

.gestia-history-shell {
    padding: var(--profile-padding);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.gestia-history-shell--standard {
    background: rgba(255, 255, 255, 0.96);
}

.gestia-task-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.gestia-task-item > div {
    min-width: 0;
}

.gestia-history-toolbar,
.gestia-history-tabs,
.gestia-history-intro,
.gestia-history-filters,
.gestia-history-section-head,
.gestia-history-summary {
    box-sizing: border-box;
    max-width: 100%;
}

.gestia-history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--profile-gap, 24px);
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.gestia-history-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 240px;
}

.gestia-history-title__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.5);
    flex-shrink: 0;
}

.gestia-history-title__text {
    min-width: 0;
    flex: 1 1 auto;
}

.gestia-history-title__text h3,
.gestia-history-title__copy {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
}

#btn-export-history {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
}

.gestia-history-title__copy {
    margin: 0;
    font-size: 12px;
    color: var(--gestemas-gray-500);
    font-weight: 500;
}

.gestia-history-tabs {
    display: flex;
    gap: 6px;
    background: var(--gestemas-gray-50);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: var(--profile-gap, 20px);
    border: 1px solid rgba(0,0,0,0.03);
    flex-wrap: wrap;
}

.gestia-history-tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.gestia-history-tab-btn.is-active {
    background: white;
    color: #ec4899;
    box-shadow: 0 4px 12px rgba(236,72,153,0.15);
}

.gestia-history-tab-btn__icon {
    width: 16px;
    vertical-align: middle;
    margin-right: 6px;
}

.gestia-history-intro {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    padding: var(--profile-padding);
    margin-bottom: var(--profile-gap, 24px);
    position: relative;
    overflow: hidden;
}

.gestia-history-intro--reco {
    background: linear-gradient(135deg, rgba(236,72,153,0.04), rgba(168,85,247,0.06));
    border-color: rgba(236,72,153,0.15);
    box-shadow: 0 4px 15px rgba(236,72,153,0.05);
}

.gestia-history-intro--tasks {
    background: linear-gradient(135deg, rgba(16,185,129,0.04), rgba(20,184,166,0.06));
    border-color: rgba(16,185,129,0.15);
    box-shadow: 0 4px 15px rgba(16,185,129,0.05);
}

.gestia-history-intro__accent {
    position: absolute;
    right: -20px;
    top: -10px;
    opacity: 0.04;
}

.gestia-history-intro__title {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.gestia-history-intro__copy {
    font-size: 13px;
    color: var(--gestemas-gray-700);
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 12px;
    max-width: 90%;
}

.gestia-history-intro__highlight {
    color: #db2777;
    font-weight: 800;
}

.gestia-history-intro__list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--gestemas-gray-800);
    font-weight: 600;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 8px;
}

.gestia-history-intro__list-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.5);
    padding: 6px 10px;
    border-radius: 6px;
}

.gestia-history-intro__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--gestemas-gray-800);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid rgba(0,0,0,0.05);
}

.gestia-history-filters {
    margin-bottom: 24px;
    position: relative;
}

.gestia-history-filters-panel {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: var(--profile-padding);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gestia-history-filters__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(0,0,0,0.05);
    background: white;
    border-radius: 12px;
    margin-bottom: var(--profile-padding);
    font-weight: 600;
}

.gestia-history-filter-row {
    display: flex;
    gap: 8px;
}

.gestia-history-filter-row--wrap {
    flex-wrap: wrap;
}

.gestia-history-filter-group {
    flex: 1 1 200px;
}

.gestia-history-filter-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--gestemas-gray-500);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.gestia-history-filter-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.gestia-history-pagination {
    display: none;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.gestia-history-pagination__meta {
    font-size: 12px;
    color: var(--gestemas-gray-500);
}

.gestia-history-pagination__controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.gestia-history-pagination__page {
    font-size: 12px;
    font-weight: 700;
    color: var(--gestemas-gray-700);
    min-width: 60px;
    text-align: center;
}

.gestia-history-page-btn {
    border-radius: 8px;
}

.gestia-history-page-btn.is-active {
    background: var(--gestemas-primary);
    color: #fff;
    border-color: transparent;
}

.gestia-history-loading {
    text-align: center;
    padding: 20px;
    color: var(--gestemas-gray-500);
}

.gestia-history-stats {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

@media (min-width: 481px) and (max-width: 768px) {
    .gestia-history-shell {
        padding: 12px 10px !important;
        margin-bottom: 10px;
    }

    .gestia-history-toolbar {
        align-items: stretch;
    }

    .gestia-history-title {
        flex: 1 1 100%;
    }

    #btn-export-history {
        width: 100%;
        justify-content: center;
    }

    .gestia-history-tab-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
        padding: 10px 8px !important;
        font-size: 11px !important;
        white-space: normal;
        line-height: 1.2;
    }

    .gestia-history-intro {
        padding: 12px !important;
    }

    .gestia-history-intro__title {
        font-size: 14px !important;
    }

    .gestia-history-intro__copy {
        font-size: 11px !important;
    }

    .gestia-history-filters {
        gap: 6px !important;
    }

    .gestia-history-filters select,
    .gestia-history-filters input {
        flex: 1 1 calc(50% - 6px) !important;
        min-width: unset !important;
    }

    .gestia-history-intro__list {
        grid-template-columns: 1fr;
    }

    .gestia-history-pagination__controls {
        width: 100%;
        justify-content: flex-start;
    }
}

.gestia-history-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

.gestia-history-section-head h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--gestemas-gray-900);
}

.gestia-history-section-head p {
    margin: 0;
    font-size: 12px;
    color: var(--gestemas-gray-500);
}

#gestia-history-list,
#gestia-tasks-history-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    contain: inline-size;
}

#gestia-panel-recomendaciones,
#gestia-panel-tareas {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    contain: inline-size;
}

.gestia-history-summary {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gestia-history-card {
    background: white;
    padding: 18px;
    border-radius: 18px;
    border: var(--history-card-border, 1px solid rgba(0, 0, 0, 0.06));
    box-shadow: var(--history-card-shadow, 0 4px 12px rgba(0, 0, 0, 0.02));
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.gestia-history-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--history-card-hover-shadow, 0 8px 20px rgba(0, 0, 0, 0.05));
}

.gestia-history-card--hero {
    background: var(--history-hero-bg, linear-gradient(135deg, #6366f1, #a855f7));
    color: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--history-hero-shadow, 0 10px 25px rgba(99, 102, 241, 0.4));
    border: var(--history-hero-border, none);
}

.gestia-history-card__float-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    opacity: 0.1;
    transform: rotate(15deg);
    color: white;
    pointer-events: none;
}

.gestia-history-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.gestia-history-card__top > *,
.gestia-history-card__footer > * {
    min-width: 0;
    max-width: 100%;
}

.gestia-history-card__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
}

.gestia-history-card__icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 18px;
    background: var(--history-icon-bg, var(--gestemas-gray-50));
    color: var(--history-icon-color, inherit);
}

.gestia-history-card__icon--hero {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.gestia-history-card__text {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
}

.gestia-history-card__kicker {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gestia-history-card__title {
    font-size: 18px;
    font-weight: 900;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: initial;
    white-space: normal;
    min-width: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gestia-history-card__title--entry {
    font-size: 14px;
    font-weight: 800;
    color: var(--gestemas-gray-900);
}

.gestia-history-card__new {
    background: #ef4444;
    color: white;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.gestia-history-card__new--hero {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 999px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
    text-transform: uppercase;
    line-height: 1;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.gestia-history-card__body {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gestia-history-card__body--entry {
    font-size: 13px;
    color: var(--gestemas-gray-700);
    margin-bottom: 16px;
    text-shadow: none;
    font-weight: 400;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gestia-history-richtext,
.gestia-history-richtext--entry {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.gestia-history-richtext > *,
.gestia-history-richtext--entry > * {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.gestia-history-richtext p,
.gestia-history-richtext h1,
.gestia-history-richtext h2,
.gestia-history-richtext h3,
.gestia-history-richtext h4,
.gestia-history-richtext h5,
.gestia-history-richtext h6,
.gestia-history-richtext ul,
.gestia-history-richtext ol,
.gestia-history-richtext div,
.gestia-history-richtext span,
.gestia-history-richtext li,
.gestia-history-richtext strong,
.gestia-history-richtext em,
.gestia-history-richtext a,
.gestia-history-richtext--entry p,
.gestia-history-richtext--entry h1,
.gestia-history-richtext--entry h2,
.gestia-history-richtext--entry h3,
.gestia-history-richtext--entry h4,
.gestia-history-richtext--entry h5,
.gestia-history-richtext--entry h6,
.gestia-history-richtext--entry ul,
.gestia-history-richtext--entry ol,
.gestia-history-richtext--entry div,
.gestia-history-richtext--entry span,
.gestia-history-richtext--entry li,
.gestia-history-richtext--entry strong,
.gestia-history-richtext--entry em,
.gestia-history-richtext--entry a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gestia-history-richtext img,
.gestia-history-richtext svg,
.gestia-history-richtext canvas,
.gestia-history-richtext iframe,
.gestia-history-richtext video,
.gestia-history-richtext table,
.gestia-history-richtext pre,
.gestia-history-richtext code,
.gestia-history-richtext--entry img,
.gestia-history-richtext--entry svg,
.gestia-history-richtext--entry canvas,
.gestia-history-richtext--entry iframe,
.gestia-history-richtext--entry video,
.gestia-history-richtext--entry table,
.gestia-history-richtext--entry pre,
.gestia-history-richtext--entry code {
    max-width: 100% !important;
}

.gestia-history-richtext table,
.gestia-history-richtext pre,
.gestia-history-richtext code,
.gestia-history-richtext--entry table,
.gestia-history-richtext--entry pre,
.gestia-history-richtext--entry code {
    display: block;
    overflow-x: auto;
}

.gestia-history-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.15);
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.gestia-history-card__footer--entry {
    background: transparent;
    margin-top: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.gestia-history-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}

.gestia-history-card__meta-label {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: initial;
    white-space: normal;
    max-width: 100%;
}

.gestia-history-card__meta-date {
    font-size: 12px;
    white-space: nowrap;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    opacity: 0.9;
}

.gestia-history-card__meta-date--entry {
    border-left: 1px solid var(--gestemas-gray-100);
    color: var(--gestemas-gray-400);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gestia-history-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
    min-width: 0;
}

.gestia-history-card__comment {
    width: 100%;
    font-size: 12px;
    font-style: italic;
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gestia-history-card__comment--entry {
    font-size: 11px;
    color: var(--gestemas-gray-500);
    background: var(--gestemas-gray-50);
    padding: 6px 10px;
    border-radius: 6px;
}

.gestia-history-card__divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--gestemas-gray-500);
}

.gestia-history-card__divider-line {
    flex: 1;
    height: 1px;
    background: var(--gestemas-gray-100);
    min-width: 0;
}

.gestia-history-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
}

.gestia-history-rating--positive {
    color: var(--gestemas-success);
}

.gestia-history-rating--negative {
    color: var(--gestemas-error);
}

.gestia-history-rating--neutral {
    color: var(--gestemas-gray-400);
}

.gestia-history-empty {
    text-align: center;
    padding: 40px;
    color: var(--gestemas-gray-400);
}

.gestia-history-empty--compact {
    padding: 20px;
    font-size: 12px;
}

.gestia-history-empty i {
    width: 32px;
    margin: 0 auto 8px;
    display: block;
}

.gestemas-tasks-grid {
    display: grid;
    grid-template-columns: 2fr minmax(320px, 1fr);
    gap: var(--profile-gap, 2rem);
    align-items: start;
}

.gestemas-source-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.gestemas-source-filters > button {
    flex: 1;
    justify-content: center;
}

.gestemas-advanced-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.gestemas-advanced-filters-panel {
    background: white;
    border: 1px solid var(--gestemas-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.task-checkbox-wrapper {
    margin-top: 4px;
}

.sc-period-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    color: var(--gestemas-gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.sc-period-btn:hover {
    color: var(--gestemas-primary);
    background: rgba(0, 0, 0, 0.03);
}

.sc-period-btn.active {
    background: white;
    color: var(--gestemas-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.profile-evolution-periods .sc-period-btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

.profile-evolution-tab-shell {
    width: 100%;
    min-width: 0;
}

.profile-evolution-tab-shell .nexus-pro-card,
.profile-evolution-tab-shell .profile-panel-soft,
.profile-evolution-tab-shell .profile-chart-shell,
.profile-evolution-tab-shell .profile-evolution-summary,
.profile-evolution-tab-shell .profile-evolution-glossary,
.profile-evolution-tab-shell .profile-evolution-note {
    min-width: 0;
}

@media (max-width: 768px) {
    .profile-row-between {
        gap: 10px;
    }

    .profile-evolution-selector,
    .profile-evolution-periods,
    .profile-evolution-chipset {
        width: 100%;
    }

    .profile-evolution-selector {
        justify-content: flex-start;
    }

    .profile-evolution-periods {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .profile-evolution-periods .sc-period-btn {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .profile-evolution-chipset {
        justify-content: flex-start;
    }

    .profile-evolution-tab-shell .profile-row-between {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-evolution-tab-shell .profile-evolution-selector,
    .profile-evolution-tab-shell .profile-evolution-chipset {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 8px;
        padding-bottom: 2px;
    }

    .profile-evolution-tab-shell .profile-evolution-selector .sc-period-btn,
    .profile-evolution-tab-shell .profile-evolution-chipset .iep-chip {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .profile-evolution-tab-shell .profile-evolution-summary {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-evolution-tab-shell .profile-evolution-score {
        width: 100%;
    }

    .profile-evolution-tab-shell .profile-evolution-summary__body {
        width: 100%;
    }

    .profile-evolution-tab-shell .nexus-pro-grid.profile-section-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .profile-evolution-tab-shell .profile-chart-shell {
        min-height: 260px;
    }

    .profile-evolution-tab-shell .profile-chart-shell--tall {
        min-height: 300px;
    }

    .profile-evolution-tab-shell .profile-panel-soft,
    .profile-evolution-tab-shell .nexus-pro-card {
        padding: 14px !important;
    }

    .profile-evolution-tab-shell .profile-pill-row {
        flex-wrap: wrap;
        gap: 8px;
        line-height: 1.2;
    }
}

@media (max-width: 375px) {
    .profile-evolution-tab-shell .profile-panel-soft,
    .profile-evolution-tab-shell .nexus-pro-card {
        padding: 12px !important;
    }

    .profile-evolution-tab-shell .profile-evolution-selector .sc-period-btn,
    .profile-evolution-tab-shell .profile-evolution-chipset .iep-chip {
        font-size: 11px;
        padding-inline: 12px;
    }
}

.iep-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--gestemas-gray-200);
    background: white;
    color: var(--gestemas-gray-500);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.iep-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--chip-color);
}

.iep-chip--active {
    border-color: var(--chip-color);
    background: rgba(99, 102, 241, 0.06);
    color: var(--gestemas-gray-900);
    box-shadow: 0 4px 15px -5px rgba(99, 102, 241, 0.2);
}

@media (max-width: 768px) {
    .sc-period-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .iep-chip {
        padding: 6px 10px;
        font-size: 11px;
    }

    .profile-hero-grid,
    .profile-section-grid {
        gap: 16px;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-card,
    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-glass,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card,
    .gestemas-view-perfil-v2 .profile-view-tab .glass-card-v3 {
        padding: 12px !important;
        border-radius: 18px !important;
    }

    .profile-subheader-row {
        gap: 8px;
        margin-bottom: 14px;
    }

    .profile-chart-shell--medium {
        height: 200px;
    }

    .profile-chart-shell--tall {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpis-grid {
        gap: 12px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-card,
    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-glass,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card,
    .gestemas-view-perfil-v2 .profile-view-tab .glass-card-v3 {
        padding: 12px !important;
        border-radius: 18px !important;
    }
}

/* --- MIGRATED FROM ESTUDIANTES.PHP --- */

    /* ═══════════════════════════════════════════════════════════
       STUDENTS V3 PRO - Glassmorphism Evolution
       ═══════════════════════════════════════════════════════════ */

    .gestemas-estudiantes-page,
    .gestemas-view-estudiantes-v2 {
        --card-radius: var(--gestemas-radius-lg, 28px);
        --avatar-size: 80px;
        --glass-v3-bg: var(--glass-bg, rgba(255, 255, 255, 0.65));
        --glass-v3-border: var(--glass-border, rgba(255, 255, 255, 0.45));
        --glass-v3-shadow: var(--glass-shadow);
        --glass-v3-glow: 0 0 20px rgba(var(--gestemas-primary-rgb), 0.2);
        
        /* [V2.0 RESPONSIVE STANDARD PADDINGS] */
        padding: var(--page-padding-desktop, 40px);
        box-sizing: border-box;
    }

    .gestemas-view-agenda-v2,
    .gestemas-view-tareas-v2,
    .gestemas-view-intervenciones-v2,
    .gestemas-view-pone-v2,
    .gestemas-view-reportes-v2,
    .gestemas-view-manual-v2,
    .gestemas-view-consultoria-v2,
    .gestemas-view-consultoria-admin-v2,
    .gestemas-view-planes-v2,
    .gestemas-view-soporte-v2,
    .gestemas-view-settings-v2,
    .gestemas-view-perfil-v2,
    .gestemas-view-salud-v2 {
        box-sizing: border-box !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
}

/* Campus/Recursos views: layout lateral manejado por body.gestemas-campus-fullwidth-view
   (campus-master.css). El page-wrapper interno no debe añadir padding lateral. */
.gestemas-view-campus-v2,
.gestemas-view-campus-player-v2,
.gestemas-view-campus-single-v2,
.gestemas-view-campus-single-v3,
.gestemas-view-campus-quiz-v3,
.gestemas-view-recursos-v2 {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}


@media (max-width: 1024px) {
        .gestemas-view-estudiantes-v2,
        .gestemas-view-agenda-v2,
        .gestemas-view-tareas-v2,
        .gestemas-view-intervenciones-v2,
        .gestemas-view-pone-v2,
        .gestemas-view-reportes-v2,
        .gestemas-view-recursos-v2,
        .gestemas-view-manual-v2,
        .gestemas-view-consultoria-v2,
        .gestemas-view-consultoria-admin-v2,
        .gestemas-view-planes-v2,
        .gestemas-view-soporte-v2,
        .gestemas-view-settings-v2,
        .gestemas-view-perfil-v2,
        .gestemas-view-salud-v2 {
            padding: var(--page-padding-tablet, 24px) !important;
        }
    }
    @media (max-width: 768px) {
        .gestemas-view-estudiantes-v2,
        .gestemas-view-agenda-v2,
        .gestemas-view-tareas-v2,
        .gestemas-view-intervenciones-v2,
        .gestemas-view-pone-v2,
        .gestemas-view-reportes-v2,
        .gestemas-view-recursos-v2,
        .gestemas-view-manual-v2,
        .gestemas-view-consultoria-v2,
        .gestemas-view-consultoria-admin-v2,
        .gestemas-view-planes-v2,
        .gestemas-view-soporte-v2,
        .gestemas-view-settings-v2,
        .gestemas-view-perfil-v2,
        .gestemas-view-salud-v2 {
            padding: var(--page-padding-mobile, 16px) !important;
        }
    }
    @media (max-width: 480px) {
        .gestemas-view-estudiantes-v2,
        .gestemas-view-agenda-v2,
        .gestemas-view-tareas-v2,
        .gestemas-view-intervenciones-v2,
        .gestemas-view-pone-v2,
        .gestemas-view-reportes-v2,
        .gestemas-view-recursos-v2,
        .gestemas-view-manual-v2,
        .gestemas-view-consultoria-v2,
        .gestemas-view-consultoria-admin-v2,
        .gestemas-view-planes-v2,
        .gestemas-view-soporte-v2,
        .gestemas-view-settings-v2,
        .gestemas-view-perfil-v2,
        .gestemas-view-salud-v2 {
            padding: var(--page-padding-xs, 10px) !important;
        }
    }

    /* Hyper-Wide Mobile Standard Override */
    


    /* Responsive Control Bar */
    @media (max-width: 768px) {
        .gestemas-control-bar {
            flex-direction: column !important;
            gap: 12px;
            height: auto !important;
            padding: 16px !important;
            position: relative;
            z-index: 10;
        }

        .control-search,
        .control-filters,
        .control-actions {
            width: 100%;
            margin: 0 !important;
            flex-wrap: wrap;
            position: relative;
            z-index: 10;
        }

        .control-search {
            order: 1 !important;
            margin-bottom: 8px !important;
            position: relative;
            z-index: 200 !important;
        }

        .control-search input {
            width: 100% !important;
            min-height: 48px !important;
            /* Larger touch target */
            font-size: 16px !important;
            /* Prevent zoom on iOS */
            padding: 12px 40px 12px 14px !important;
            border: 2px solid var(--gestemas-primary) !important;
            border-radius: 14px !important;
            background: white !important;
            -webkit-appearance: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
        }

        .control-search input:focus {
            outline: none;
            border-color: var(--gestemas-primary) !important;
            box-shadow: 0 0 0 4px rgba(var(--gestemas-primary-rgb), 0.15) !important;
        }

        .control-search i {
            pointer-events: none;
            position: absolute;
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 201;
            color: var(--gestemas-primary);
        }

        .control-filters {
            display: flex;
            gap: 8px;
            order: 2;
        }

        .premium-select {
            flex: 1;
            min-width: 120px;
            min-height: 44px;
            /* Touch-friendly */
            font-size: 16px !important;
            /* Prevent zoom on iOS */
        }

        .control-actions {
            justify-content: flex-end;
            order: 3;
        }
    }

    /* Grid View: Premium Glass Cards */
    .estudiantes-grid-view {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
        padding-bottom: 40px;
    }

    @media (min-width: 1025px) {
        .estudiantes-grid-view {
            grid-template-columns: repeat(auto-fill, minmax(320px, 420px)) !important;
            justify-content: start !important;
            gap: 30px !important;
        }

        .student-card-v3 {
            height: 100% !important;
            display: flex !important;
            flex-direction: column !important;
        }
    }


    .student-card-v3 {
        background: var(--glass-v3-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--glass-v3-border);
        border-radius: var(--card-radius);
        position: relative;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-shadow: var(--glass-v3-shadow);
    }

    .student-card-v3:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), var(--glass-v3-glow);
        border-color: rgba(var(--gestemas-primary-rgb), 0.3);
    }

    .card-banner {
        height: 100px;
        background: linear-gradient(135deg, var(--gestemas-primary) 0%, var(--gestemas-indigo) 100%);
        position: relative;
    }

    .card-banner::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: linear-gradient(to top, var(--glass-v3-bg), transparent);
    }

    .card-profile-wrapper {
        position: absolute;
        top: 60px;
        left: 24px;
        width: var(--avatar-size);
        height: var(--avatar-size);
        border-radius: 22px;
        padding: 4px;
        background: white;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        z-index: 2;
    }

    .card-profile-img {
        width: 100%;
        height: 100%;
        border-radius: 18px;
        object-fit: cover;
        background: var(--gestemas-gray-100);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        color: var(--gestemas-primary);
        font-size: 24px;
    }

    .card-content {
        padding: 50px 24px 24px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .card-title {
        font-size: 1.25rem;
        font-weight: 800;
        margin-bottom: 4px;
        color: var(--gestemas-gray-900);
        letter-spacing: -0.01em;
    }

    .card-subtitle {
        font-size: 13px;
        color: var(--gestemas-gray-500);
        font-weight: 600;
        margin-bottom: 20px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .card-stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .card-stat-pill {
        background: rgba(var(--gestemas-primary-rgb), 0.05);
        border: 1px solid rgba(var(--gestemas-primary-rgb), 0.1);
        padding: 10px;
        border-radius: 16px;
        text-align: center;
    }

    .card-stat-value {
        display: block;
        font-size: 16px;
        font-weight: 800;
        color: var(--gestemas-gray-900);
    }

    .card-stat-label {
        font-size: 9px;
        font-weight: 700;
        color: var(--gestemas-gray-400);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .badge-status {
        position: absolute;
        top: 16px;
        right: 16px;
        padding: 6px 12px;
        border-radius: 99px;
        font-size: 11px;
        font-weight: 800;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        color: var(--gestemas-primary);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    /* List View: Rich Nexus Style */
    .estudiantes-list-view {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .nexus-student-block {
        background: var(--glass-v3-bg);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid var(--glass-v3-border);
        border-radius: 20px;
        padding: 16px 24px;
        display: flex;
        align-items: center;
        gap: 20px;
        transition: all 0.3s ease;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    }

    .nexus-student-block:hover {
        transform: translateX(8px);
        background: white;
        border-color: var(--gestemas-primary);
        box-shadow: 0 10px 30px rgba(var(--gestemas-primary-rgb), 0.1);
    }

    .nexus-avatar {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        background: var(--gestemas-primary-light);
        color: var(--gestemas-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 16px;
        flex-shrink: 0;
    }

    .nexus-info {
        flex: 1;
        min-width: 0;
    }

    .nexus-name {
        font-weight: 800;
        font-size: 16px;
        color: var(--gestemas-gray-900);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nexus-meta {
        font-size: 12px;
        color: var(--gestemas-gray-500);
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .nexus-stats-strip {
        display: flex;
        gap: 24px;
        padding: 0 24px;
        border-left: 1px solid var(--gestemas-gray-100);
        border-right: 1px solid var(--gestemas-gray-100);
    }

    .nexus-stat {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nexus-action-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: var(--gestemas-gray-50);
        color: var(--gestemas-gray-600);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        transition: all 0.2s;
        flex-shrink: 0;
    }

    .nexus-action-btn:hover {
        background: var(--gestemas-primary);
        color: white;
        transform: scale(1.05);
    }

    .btn-profile-premium {
        width: 100%;
        padding: 12px;
        background: white;
        color: var(--gestemas-primary);
        border: 1px solid rgba(var(--gestemas-primary-rgb), 0.2);
        border-radius: 12px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s;
        margin-top: auto;
    }

    .btn-profile-premium:hover {
        background: var(--gestemas-primary);
        color: white;
        box-shadow: 0 4px 12px rgba(var(--gestemas-primary-rgb), 0.2);
    }

    /* Mobile Adaptability */
    @media (max-width: 768px) {
        

        .nexus-student-block {
            padding: 12px 16px;
            gap: 12px;
        }

        .nexus-stats-strip {
            display: none;
        }

        .nexus-avatar {
            width: 44px;
            height: 44px;
        }
    }

    /* Onboarding Card Styles */
    .gestemas-onboarding-card {
        background: white;
        border-radius: 32px;
        padding: 50px 40px;
        text-align: center;
        max-width: 700px;
        margin: 60px auto;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
        border: 1px solid var(--gestemas-border-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
        position: relative;
        overflow: hidden;
    }

    .onboarding-icon-wrapper {
        position: relative;
        width: 100px;
        height: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 10px;
    }

    .onboarding-icon-wrapper .icon-main {
        width: 60px;
        height: 60px;
        color: var(--gestemas-primary);
        position: relative;
        z-index: 2;
    }

    .onboarding-icon-wrapper .icon-glow {
        position: absolute;
        width: 100px;
        height: 100px;
        color: var(--gestemas-primary);
        opacity: 0.15;
        animation: gestemas-float 4s infinite ease-in-out;
    }

    .onboarding-content h2 {
        font-size: 2.2rem;
        font-weight: 800;
        color: var(--gestemas-gray-900);
        margin-bottom: 16px;
    }

    .onboarding-content p {
        font-size: 1.1rem;
        line-height: 1.7;
        color: var(--gestemas-gray-600);
        margin-bottom: 32px;
    }

    .onboarding-benefits {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        width: 100%;
        margin-bottom: 40px;
    }

    .benefit-item {
        display: flex;
        align-items: center;
        gap: 12px;
        background: var(--gestemas-gray-50);
        padding: 14px 18px;
        border-radius: 16px;
        font-size: 13px;
        font-weight: 700;
        color: var(--gestemas-gray-700);
        transition: all 0.3s;
    }

    .benefit-item:hover {
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        transform: translateY(-2px);
    }

    .benefit-item i {
        color: var(--gestemas-success);
        width: 18px;
        height: 18px;
    }

    @keyframes gestemas-float {

        0%,
        100% {
            transform: translateY(0) scale(1.1) rotate(0);
            opacity: 0.1;
        }

        50% {
            transform: translateY(-15px) scale(1.3) rotate(10deg);
            opacity: 0.25;
        }
    }

    @media (max-width: 600px) {
        .gestemas-onboarding-card {
            padding: 40px 24px;
            margin: 30px 10px;
        }

        .onboarding-content h2 {
            font-size: 1.7rem;
        }

        .onboarding-content p {
            font-size: 1rem;
        }

        .onboarding-benefits {
            grid-template-columns: 1fr;
        }
    }

    /* Advanced Filters Panel */
    .advanced-filters-panel {
        background: rgba(255, 255, 255, 0.5);
        border-top: 1px solid var(--gestemas-gray-100);
        padding: 16px;
        width: 100%;
        animation: slideDown 0.3s ease-out;
    }

    .advanced-filters-panel.is-expanded {
        display: block !important;
        opacity: 1;
        visibility: visible;
        margin-bottom: 20px;
    }

    @keyframes skeleton-shimmer {
        0% {
            background-position: -200% 0;
        }

        100% {
            background-position: 200% 0;
        }
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .filter-toggle-btn {
        background: white;
        border: 1px solid var(--gestemas-gray-200);
        border-radius: 12px;
        padding: 8px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 700;
        color: var(--gestemas-gray-700);
    }

    .filter-toggle-btn:hover,
    .filter-toggle-btn.active {
        background: var(--gestemas-primary-light);
        color: var(--gestemas-primary);
        border-color: var(--gestemas-primary);
    }


/* --- MIGRATED FROM ESTUDIANTE-PERFIL.PHP --- */

/* Glassmorphism v3 - Premium Design System */
:root {
    --glass-background: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(24px) saturate(160%);
    --glass-inner-glow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    --glass-shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.03);
    --glass-shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.06); /* Standardized shadow without inset interference */
    --accent-v3: #6366f1;
    --gestemas-card-p: var(--profile-padding, 20px);
}

/* Gestia Action Buttons Standard (scoped to history/task cards only) */
.gestia-history-card .gestia-action-btn,
.gestia-task-item .gestia-action-btn {
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    padding: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.gestia-history-card .gestia-action-btn:hover,
.gestia-task-item .gestia-action-btn:hover {
    transform: translateY(-2px) scale(1.1) !important;
}

@media (max-width: 480px) {
    .gestia-history-card__top,
    .gestia-history-card__meta {
        gap: 8px;
    }

    .gestia-history-card__meta-date {
        white-space: normal;
        padding-left: 0;
        border-left: none;
    }

    .gestia-history-card__footer,
    .gestia-task-item > div:last-of-type {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .gestia-history-card__actions,
    .gestia-task-item > div:last-of-type {
        width: 100%;
    }
    .gestia-history-card .gestia-action-btn,
    .gestia-task-item .gestia-action-btn {
        width: 40px !important; /* Larger touch target on mobile */
        height: 40px !important;
    }
}

.gestia-history-card .gestia-action-btn i,
.gestia-history-card .gestia-action-btn svg,
.gestia-task-item .gestia-action-btn i,
.gestia-task-item .gestia-action-btn svg {
    width: 18px !important; /* Slightly larger icons */
    height: 18px !important;
    stroke-width: 2.2px !important;
}

@media (max-width: 1024px) {
    .gestemas-profile-360--expanded {
        width: 100% !important;
        max-width: 100% !important; overflow-x: hidden;
        position: relative;
        left: auto;
        right: auto;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 20px !important;
        box-sizing: border-box;
    }
}

.gestemas-view-perfil-v2.gestemas-profile-360--expanded {
    padding: var(--page-padding-desktop, 40px) !important;
    --profile-padding: clamp(10px, 2vw, 18px);
    --profile-gap: clamp(12px, 2vw, 20px);
}

@media (max-width: 1024px) {
    .gestemas-view-perfil-v2.gestemas-profile-360--expanded {
        padding: var(--page-padding-tablet, 24px) !important;
        --profile-padding: 12px;
        --profile-gap: 14px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .gestemas-view-perfil-v2.gestemas-profile-360--expanded {
        padding: 10px !important;
        --profile-padding: 12px;
        --profile-gap: 10px;
    }
}

.gestemas-profile-grid {
    display: grid;
    grid-template-columns: 350px 1fr !important;
    gap: var(--profile-gap, 24px);
    width: 100%;
    max-width: 100%;
    margin-top: clamp(8px, 2vw, 16px);
    overflow-x: hidden;
}

@media (min-width: 481px) and (max-width: 768px) {
    .gestemas-profile-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

.glass-v3-header {
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 24px;
    box-shadow: var(--glass-shadow-soft);
    margin-bottom: 24px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 24px 24px;
    gap: 12px;
}



@media (min-width: 481px) and (max-width: 768px) {
    .gestemas-profile-360--expanded {
        padding: 10px !important;
    }
    .glass-v3-header {
        padding: 12px 10px;
        flex-wrap: wrap;
        gap: 12px;
        height: auto;
    }
    
    .header-left-group {
        max-width: 100%;
        flex: 1 1 100%;
        justify-content: space-between;
    }
    .header-identity-pill {
        flex: 1;
        margin-right: 0;
        max-width: none;
        justify-content: flex-start;
    }
    .header-student-name-v3 {
        font-size: 1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px; /* More space for name */
    }
    .header-actions-group-v3 {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        margin-top: 4px;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    .action-btn-glass-v3 {
        flex: 1; /* Distribute buttons evenly */
        border-radius: 12px;
    }

    /* Ajustes Responsivos Vista Resumen */
    .gestemas-kpis-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .gestemas-strategic-indicators > div {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .gestemas-strategic-indicators {
        padding: 16px !important;
    }
    .gestemas-profile-view-container .gestemas-grid--2 {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .gestemas-kpi-card {
        padding: 16px 12px !important;
        gap: 8px !important;
        flex-direction: column !important;
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
    }
    .gestemas-kpi-card .kpi-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        margin: 0 auto !important;
    }
    .gestemas-kpi-card .kpi-icon i {
        width: 18px !important;
    }
    .gestemas-kpi-card .kpi-value {
        font-size: 22px !important;
        line-height: 1 !important;
        margin-bottom: 4px !important;
    }
    .gestemas-kpi-card .kpi-label {
        font-size: 10px !important;
        line-height: 1.2 !important;
        word-break: normal !important;
        white-space: normal !important;
        display: block !important;
    }
    .st-kpi-box {
        padding: 12px !important;
    }
    .st-kpi-value {
        font-size: 16px !important;
    }
    /* Gamification Responsive Layouts */
    .gamification-hero-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .gamification-stats-group {
        width: 100% !important;
        justify-content: center !important;
    }
    .gamification-stats-group > div {
        flex: 1 !important;
    }
    .gamification-coach-banner > div {
        flex-wrap: wrap;
    }
    
    /* Colaboradores Layout */
    .colaboradores-header-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    .subscriber-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    .subscriber-actions-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .subscriber-actions-container > div:first-child {
        text-align: left !important;
    }

    /* PONE Summary section fixes */
    #view-resumen > .gestemas-card > .gestemas-card__body > div {
        flex-direction: column !important;
    }
    .chart-container {
        height: 280px !important;
    }
    .gestemas-kpis-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

.back-btn-profile-v3 {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: white;
    border: 1px solid rgba(0,0,0,0.08);
    color: var(--gestemas-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-btn-profile-v3 i, 
.action-btn-glass-v3 i {
    width: 24px !important;
    height: 24px !important;
    stroke-width: 2px;
}

.mini-avatar-v3--sticky {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gestemas-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.action-btn-glass-v3 {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: var(--gestemas-gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.action-btn-glass-v3 span {
    display: none; /* Icon only */
}

.action-btn-glass-v3:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: auto;
    transform: translateX(-50%);
    background: var(--gestemas-gray-900);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1001;
}

.gestemas-identity-card {
    background: white;
    
    text-align: left !important;
}

.gestemas-identity-avatar {
    margin: 0 0 20px 0 !important;
    left: 0 !important;
    transform: none !important;
    position: relative !important;
    width: 80px !important;
    height: 80px !important;
    font-size: 2rem !important;
}

.action-btn-glass-v3:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.action-btn-glass-v3--primary {
    background: var(--gestemas-primary);
    color: white;
    border: none;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.25);
}

.action-btn-glass-v3--primary:hover {
    background: var(--gestemas-primary);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.35);
}

/* Sub-navigation V3 */
.gestemas-profile-subnav-v3 {
    margin: 0 auto 20px;
    max-width: 100%;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    backdrop-filter: blur(20px);
    border: 1px solid var(--gestemas-gray-200);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.subnav-container-v3 {
    display: flex;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
    min-width: 0;
    padding-bottom: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
    -webkit-overflow-scrolling: touch;
}

.subnav-container-v3::-webkit-scrollbar {
    height: 4px;
}
.subnav-container-v3::-webkit-scrollbar-track {
    background: transparent;
}
.subnav-container-v3::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}

.subnav-item-v3 {
    padding: 8px 12px;
    min-height: 44px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--gestemas-gray-500);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}

.subnav-item-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    line-height: 1;
}

.subnav-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    order: 2;
}

.subnav-item-badge i {
    width: 11px;
    height: 11px;
    stroke-width: 2.6px;
}

.subnav-item-badge--ai {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(168, 85, 247, 0.18));
    color: var(--gestemas-primary);
    border: 1px solid rgba(99, 102, 241, 0.22);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.08);
}

.subnav-item-v3 i {
    width: 18px;
    height: 18px;
    stroke-width: 2.2px;
}

.subnav-item-v3 span {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.subnav-item-v3:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--gestemas-primary);
}

.subnav-item-v3.is-active {
    background: white;
    color: var(--gestemas-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: rgba(99, 102, 241, 0.12);
}

.subnav-item-v3.is-active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 12px;
    width: calc(100% - 24px);
    height: 2px;
    background: var(--gestemas-primary);
    border-radius: 3px 3px 0 0;
}

@media (min-width: 481px) and (max-width: 768px) {
    .gestemas-profile-360--expanded {
        padding: 10px !important;
        --profile-padding: 12px;
        --profile-gap: 10px;
    }
    .subnav-container-v3 {
        overflow-x: auto;
        max-width: 100%;
        padding-bottom: 0;
        gap: 6px;
    }
    .subnav-item-v3 span {
        display: none;
    }
    .subnav-item-v3 {
        padding: 10px;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .gestemas-view-perfil-v2.gestemas-profile-360--expanded {
        padding: 8px !important;
        --profile-padding: 10px;
        --profile-gap: 8px;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpis-grid {
        gap: 8px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-card,
    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-glass,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card,
    .gestemas-view-perfil-v2 .profile-view-tab .glass-card-v3 {
        padding: 10px !important;
        border-radius: 16px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__header,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__body,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__footer {
        padding: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card {
        padding: 10px !important;
        gap: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-value {
        font-size: 18px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-label {
        font-size: 9px !important;
    }

    .profile-evolution-glossary {
        align-items: flex-start;
        padding: 9px 10px;
        gap: 6px;
    }

    .profile-evolution-glossary__text {
        font-size: 0.8rem;
    }

    .subnav-item-badge {
        padding: 2px 7px;
        font-size: 9px;
    }
}

@media (max-width: 375px) {
    .gestemas-view-perfil-v2.gestemas-profile-360--expanded {
        padding: 6px 8px !important;
        --profile-padding: 10px;
        --profile-gap: 6px;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpis-grid {
        gap: 6px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-card,
    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-glass,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card,
    .gestemas-view-perfil-v2 .profile-view-tab .glass-card-v3 {
        padding: 10px !important;
        border-radius: 14px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__header,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__body,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__footer {
        padding: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card {
        padding: 10px !important;
        gap: 8px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-value {
        font-size: 17px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-label {
        font-size: 9px !important;
        line-height: 1.15 !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .gestemas-view-perfil-v2 .profile-view-tab {
        overflow-x: hidden;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpis-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-card,
    .gestemas-view-perfil-v2 .profile-view-tab .nexus-pro-glass,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card,
    .gestemas-view-perfil-v2 .profile-view-tab .glass-card-v3 {
        padding: 12px !important;
        border-radius: 18px !important;
        min-width: 0 !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__header,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__body,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-card__footer {
        padding: 12px !important;
        box-sizing: border-box;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card {
        flex-direction: row !important;
        text-align: left !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-icon {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-value {
        font-size: 20px !important;
        line-height: 1 !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-kpi-card .kpi-label {
        font-size: 10px !important;
        line-height: 1.2 !important;
        white-space: normal !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-profile-grid,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-grid--2 {
        gap: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab #view-resumen > .gestemas-kpis-grid {
        margin-bottom: 16px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab #view-resumen > .nexus-pro-grid,
    .gestemas-view-perfil-v2 .profile-view-tab #view-resumen > .gestemas-grid.gestemas-grid--2 {
        margin-top: 16px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-neuro-evo-layout {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-neuro-evo-main,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-neuro-evo-side {
        min-width: 100% !important;
        width: 100% !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .pone-summary-stats-card {
        padding: 12px !important;
        margin-top: 0 !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .dim-legend-grid {
        gap: 6px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .dim-legend-item {
        flex: 1 1 100% !important;
        justify-content: flex-start !important;
        padding: 6px 8px !important;
        font-size: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .support-item {
        padding: 10px 12px !important;
        gap: 10px !important;
    }

    .gestemas-view-perfil-v2 .profile-view-tab .markdown-content,
    .gestemas-view-perfil-v2 .profile-view-tab .markdown-section,
    .gestemas-view-perfil-v2 .profile-view-tab .gestemas-text-muted {
        overflow-wrap: anywhere;
        word-break: normal;
    }
}

                                    @media (max-width: 768px) {
                                        .pone-summary-stats-card {
                                            min-width: 100% !important;
                                            margin-top: 10px;
                                        }
                                        .dim-legend-grid {
                                            gap: 8px !important;
                                        }
                                        .dim-legend-item {
                                            flex: 1 1 120px;
                                            justify-content: center;
                                        }
                                        .gestemas-grid--2 {
                                            grid-template-columns: 1fr !important;
                                        }
                                    }

/* ============================================
   EMERGENCY LAYOUT RESTORATION (Nexus Pro)
   ============================================ */

.nexus-pro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--profile-gap, 24px);
    width: 100%;
}

.nexus-pro-card, .nexus-pro-glass {
    background: var(--glass-bg, rgba(255, 255, 255, 0.7));
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.4));
    border-radius: var(--card-radius-premium, 20px);
    padding: var(--profile-padding, 24px);
    box-shadow: var(--glass-shadow-premium, 0 12px 40px rgba(0, 0, 0, 0.06));
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.gestemas-profile-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--profile-gap, 24px);
    max-width: 100%;
}

@media (max-width: 1024px) {
    .gestemas-profile-grid,
    .nexus-pro-grid,
    .profile-hero-grid,
    .profile-section-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
}

.profile-chart-shell {
    width: 100%;
    height: 300px;
    max-height: 50vh;
    position: relative;
    display: block;
}

.profile-chart-shell canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   PWA MODULE - Glass V3 Native Style
   ============================================ */

.glass-v3 {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 12px 40px -8px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.glass-v3-dark {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 12px 40px -8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#gestemas-pwa-banner {
    position: fixed;
    z-index: 99999;
    left: 16px;
    right: 16px;
    bottom: 24px;
    padding: 16px 20px;
    border-radius: 20px;
    transform: translateY(120%) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    overflow: hidden;
}

#gestemas-pwa-banner.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

#gestemas-pwa-banner[data-position="top"] {
    bottom: auto;
    top: 24px;
}

#gestemas-pwa-banner[data-position="center"] {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) scale(0.95);
}

#gestemas-pwa-banner[data-position="center"].visible {
    transform: translateY(-50%) scale(1);
}

.pwa-banner-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    pointer-events: none;
    animation: pwa-glow-pulse 4s ease-in-out infinite;
}

@keyframes pwa-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.pwa-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pwa-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.pwa-banner-icon svg {
    color: white;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.pwa-banner-text span {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-dismiss-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.pwa-dismiss-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

#gestemas-offline-indicator {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.9);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

body.gestemas-offline #gestemas-offline-indicator {
    display: flex;
}

body:not(.gestemas-offline) #gestemas-offline-indicator {
    display: none;
}

@media (max-width: 480px) {
    #gestemas-pwa-banner {
        left: 12px;
        right: 12px;
        bottom: 16px;
        padding: 14px 16px;
    }

    .pwa-banner-content {
        gap: 12px;
    }

    .pwa-banner-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .pwa-banner-text strong {
        font-size: 14px;
    }

    .pwa-install-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .pwa-dismiss-btn {
        width: 32px;
        height: 32px;
    }
}

@supports (padding: max(0px)) {
    #gestemas-pwa-banner {
        padding-bottom: max(16px, env(safe-area-inset-bottom) + 8px);
    }
}

.pwa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) scale(0.95);
}

#gestemas-pwa-banner[data-position="center"].visible {
    transform: translateY(-50%) scale(1);
}

.pwa-banner-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    pointer-events: none;
    animation: pwa-glow-pulse 4s ease-in-out infinite;
}

@keyframes pwa-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.pwa-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pwa-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.pwa-banner-icon svg {
    color: white;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.pwa-banner-text span {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-dismiss-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.pwa-dismiss-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

#gestemas-offline-indicator {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #fef3c7;
    background: rgba(245, 158, 11, 0.9);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-100%); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

body.gestemas-offline #gestemas-offline-indicator {
    display: flex;
}

body:not(.gestemas-offline) #gestemas-offline-indicator {
    display: none;
}

@media (max-width: 480px) {
    #gestemas-pwa-banner {
        left: 12px;
        right: 12px;
        bottom: 16px;
        padding: 14px 16px;
    }

    .pwa-banner-content {
        gap: 12px;
    }

    .pwa-banner-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .pwa-banner-text strong {
        font-size: 14px;
    }

    .pwa-install-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .pwa-dismiss-btn {
        width: 32px;
        height: 32px;
    }
}

@supports (padding: max(0px)) {
    #gestemas-pwa-banner {
        padding-bottom: max(16px, env(safe-area-inset-bottom) + 8px);
    }
}

.pwa-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    z-index: 10;
}

.pwa-toast-install {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 99997;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pwa-toast-install.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-toast-install svg {
    color: #6366f1;
    flex-shrink: 0;
}

.pwa-toast-install strong {
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.pwa-toast-install span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.pwa-toast-actions {
    display: flex;
    gap: 8px;
}

.pwa-toast-actions button {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-toast-install-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
}

.pwa-toast-dismiss-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border: none;
}

.pwa-toast-install-btn:hover {
    transform: scale(1.05);
}

.pwa-toast-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   NEXUS PRO STANDARD CORE v2 (Standardization Engine)
   ========================================================================== */

/* Universal Containment & Layout Tokens */
.nexus-pro-grid, .gestemas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--gst-gap, 1.5rem);
    width: 100%;
    box-sizing: border-box;
}

.nexus-pro-card, .gestemas-card, .glass-card-v3 {
    padding: clamp(16px, 3vw, 32px);
    border-radius: var(--gst-radius-lg, 1.25rem);
    background: var(--gst-glass-bg, rgba(255, 255, 255, 0.7));
    backdrop-filter: var(--gst-glass-blur, blur(20px));
    -webkit-backdrop-filter: var(--gst-glass-blur, blur(20px));
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--gst-shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    word-break: normal;
}

.nexus-pro-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--gst-shadow-premium);
}

/* Rule of Four: Strict Mobile Margins (Standard 4px Hyper-Wide) */
@media (max-width: 768px) {
    .gestemas-page-wrapper, .gestemas-module-root {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .nexus-pro-grid, .gestemas-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .nexus-pro-card, .gestemas-card, .glass-card-v3 {
        padding: 12px !important;
        border-radius: 18px !important;
    }
}

/* Single Scroll Hierarchy */
html {
    overflow-y: auto !important;
    height: auto !important;
}

body {
    overflow-y: visible !important;
    overflow-x: clip !important;
}

/* ==========================================================================
   CAMPUS LAYOUT - Uses same pattern as dashboard
   ========================================================================== */
/* Ensure main content is not squeezed - standard with sidebar */
@media (min-width: 1025px) {
    body.gestemas-campus-fullwidth-view .gestemas-main-content {
        width: auto !important;
        margin-left: var(--gestemas-sidebar-width, 280px) !important;
    }
}

@media (max-width: 1024px) {
    body.gestemas-campus-fullwidth-view .gestemas-main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

.campus-layout-root {
    --campus-accent: #6366f1;
    --campus-success: #10b981;
    width: 100%;
    max-width: none;
}

/* Campus Flexible Layout System (70/30 Hybrid) */
.campus-layout-system {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: var(--gst-gap, 24px);
    align-items: start;
    width: 100%;
    margin-top: 24px;
}

@media (max-width: 1100px) {
    .campus-layout-system {
        grid-template-columns: 1fr;
    }
    .campus-layout-system .course-sidebar,
    .campus-layout-system .course-sidebar-pro {
        order: -1;
    }
}

.campus-layout-root .course-sidebar-pro {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.campus-layout-root .sticky-card {
    position: sticky;
    top: 120px;
}

/* Campus Course - Ensure full width */
.gestemas-view-campus-v2 .campus-standard-container {
    max-width: none;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    padding-left: 40px;
    padding-right: 40px;
}


/* Unified Full-Width Standard for GLM 5.1 */
body.gestemas-is-guest-view .gestemas-view-campus-v2 .campus-standard-container,
body.gestemas-app-body .gestemas-view-campus-v2 .campus-standard-container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0;
    padding-right: 0;
}

/* Sidebar Margin removal for Guests */
body.gestemas-is-guest-view .gestemas-main-content {
    margin-left: 0 !important;
}

/* Override for app body */
body.gestemas-app-body .gestemas-view-campus-v2 .campus-standard-container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.campus-layout-root .course-main-content {
    min-width: 0;
    width: 100%;
}

.campus-layout-root .gestemas-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: var(--gst-gap);
    padding: 0 8px;
}

.campus-layout-root .course-img-standard {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--gst-radius-md) var(--gst-radius-md) 0 0;
}

.campus-layout-root .btn-nexus-premium {
    background: linear-gradient(135deg, var(--gestemas-primary) 0%, #8b5cf6 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.campus-layout-root .btn-nexus-premium.ghost {
    background: transparent;
    border: 1px solid var(--gst-gray-200);
    color: var(--gestemas-gray-700);
}

.campus-layout-root .btn-nexus-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Campus Dedicated Sections */
.campus-layout-root .course-section {
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

.campus-layout-root .section-title {
    font-size: var(--gst-fs-h3);
    color: var(--gst-gray-900);
    margin-bottom: 20px;
    font-weight: 800;
    font-family: var(--gst-font-heading);
}

.campus-layout-root .nexus-pro-card.hero-glass-v3 {
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Sidebar & Sticky Components */
.campus-layout-root .sticky-top {
    position: sticky;
    top: 100px;
    z-index: 10;
}

@media (max-width: 900px) {
    .campus-layout-root .course-layout {
        grid-template-columns: 1fr !important;
    }
    .campus-layout-root .course-sidebar,
    .campus-layout-root .course-sidebar-pro {
        order: -1;
    }
}

/* Mobile Sticky CTA Standard */
.campus-layout-root .mobile-sticky-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gst-white);
    padding: 12px 16px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
    z-index: var(--z-header);
    border-top: 1px solid var(--gst-gray-100);
}

@media (max-width: 768px) {
    .campus-layout-root .mobile-sticky-cta {
        display: flex;
        align-items: center;
        gap: 12px;
    }
}
/* Player Dashboard & Stats */
.campus-layout-root .gestemas-player-dashboard {
    background: var(--gst-white);
    border: 1px solid var(--gst-gray-100);
    border-radius: var(--gst-radius-lg);
    padding: clamp(16px, 3vw, 24px);
    margin-bottom: var(--gst-gap);
    box-shadow: var(--gst-shadow-sm);
}

.campus-layout-root .dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.campus-layout-root .dash-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gst-gray-50);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--gst-gray-100);
}

/* Player Layout Controls */
.campus-layout-root .campus-player-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--gst-gap);
    align-items: start;
}

@media (max-width: 1024px) {
    .campus-layout-root .campus-player-layout {
        grid-template-columns: 1fr;
    }
}

.campus-layout-root .player-sidebar {
    background: var(--gst-white);
    border: 1px solid var(--gst-gray-100);
    border-radius: var(--gst-radius-lg);
    overflow: hidden;
    position: sticky;
    top: 100px;
}

/* Lesson Items Standard */
.campus-layout-root .lesson-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--gst-gray-700);
    border-bottom: 1px solid var(--gst-gray-50);
    transition: all 0.2s ease;
}

.campus-layout-root .lesson-item.active {
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--gestemas-primary);
    color: var(--gestemas-primary);
}

.campus-layout-root .lesson-item:hover:not(.active) {
    background: var(--gst-gray-50);
}

/* Override for app body */

/* =========================================================================
   GLM 5.1 - CAMPUS VIEW (Uses same standard as recursos)
   All styles inherited from .gestemas-view-recursos-v2
   ========================================================================== */
/* Layout fullwidth unificado — solo al wrapper externo, el page-wrapper no debe tener padding
   lateral (provoca compactación doble). Consolidado con campus-master.css:40 */
body.gestemas-campus-fullwidth-view .gestemas-page-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

body.gestemas-campus-fullwidth-view .gst-standard-viewport {
    padding-inline: 0 !important;
}
