@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Base Colors */
    --bg-deep: #0a0e14;
    --bg-sidebar: #111821;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    /* Brand Colors */
    --accent-primary: #00d2ff; /* Technological Cyan */
    --accent-primary-rgb: 0, 210, 255;
    --accent-secondary: #00b09b; /* Emerald */
    --accent-danger: #ff512f;
    --accent-warning: #fdbb2d;
    
    /* Text Colors */
    --text-primary: #f4f7f6;
    --text-secondary: #cbd5e1; /* Mejor contraste */
    --text-muted: #94a3b8; /* Mejor contraste */
    
    /* Glassmorphism */
    --glass-background: rgba(255, 255, 255, 0.02);
    --glass-blur: blur(12px);
    
    /* Sidebar Config */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    
    /* Transitions */
    --tr-fast: 0.2s ease;
    --tr-med: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Button Helpers */
    --btn-close-filter: invert(1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand-font {
    font-family: 'Outfit', sans-serif;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
}

.main-content {
    flex-grow: 1;
    padding: 40px;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--tr-med);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width var(--tr-med);
}

.sidebar-header {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--bg-deep);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand span {
    font-weight: 300;
    opacity: 0.6;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 10px 15px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 25px 15px 10px;
    opacity: 0.5;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: var(--tr-fast);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-glass);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: var(--tr-fast);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.06);
}

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

.user-info .name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info .role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Cards & Containers */
.glass-card {
    background: var(--glass-background);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.welcome-card {
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.05), transparent);
    border-left: 4px solid var(--accent-primary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform var(--tr-fast);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* UI Elements */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    transition: var(--tr-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #00a8d6);
    color: var(--bg-deep);
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
    transform: translateY(-2px);
}

.badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-outline {
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.badge-active {
    background: rgba(0, 176, 155, 0.1);
    color: var(--accent-secondary);
}

.badge-inactive {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    .main-content {
        margin-left: 0;
    }
}

/* Restore & Refine Components */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.95rem;
}

.glass-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-bottom: 1px solid var(--border-glass);
}

.glass-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.glass-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.whatsapp-link {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--tr-fast);
}

.whatsapp-link:hover {
    transform: scale(1.1);
    color: var(--accent-primary);
}

.whatsapp-link.verified {
    color: var(--accent-secondary);
    position: relative;
}

.verified-check {
    font-size: 0.65rem;
    position: absolute;
    bottom: -2px;
    right: -4px;
    background: var(--bg-deep);
    border-radius: 50%;
    color: var(--accent-secondary);
}

body.light-theme .verified-check {
    background: white;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--tr-fast);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
    color: var(--text-primary) !important;
}

/* Fix for browser autofill colors */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-sidebar) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

select.form-control option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}

/* Light Theme Definition */
body.light-theme {
    --bg-deep: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --border-glass: rgba(0, 0, 0, 0.1);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --glass-background: rgba(255, 255, 255, 0.8);
    --glass-blur: blur(0px);
    --btn-close-filter: none;
}

body.light-theme .glass-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: white;
}

body.light-theme .sidebar {
    background: white;
    border-right: 1px solid #e2e8f0;
}

body.light-theme .nav-link:hover {
    background: #f1f5f9;
}

body.light-theme .user-profile {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .form-control {
    background: white;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .glass-table th {
    background: #f8fafc;
    color: #475569;
}

body.light-theme .glass-table td {
    color: #0f172a;
}

/* Theme Toggle & Footer Refinement */
.theme-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    transition: var(--tr-fast);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.sidebar-footer-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    padding: 0 10px;
}

/* Edit & Small Buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    gap: 5px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08); /* Fondo visible en dark mode */
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-primary);
}

body.light-theme .btn-secondary {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.light-theme .btn-secondary:hover {
    background: #e2e8f0;
}
/* --- Accordion Course Cards --- */
.course-accordion {
    margin-bottom: 25px;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    overflow: hidden;
    background: var(--glass-background);
    transition: all 0.3s ease;
}

.course-accordion:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.accordion-header {
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.01);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.accordion-title-group h2 {
    margin: 5px 0;
    font-size: 1.4rem;
}

.accordion-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-accordion.active .accordion-icon {
    transform: rotate(180deg);
    background: var(--accent-primary);
    color: var(--bg-deep);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.5s ease;
    background: rgba(0, 0, 0, 0.1);
}

.course-accordion.active .accordion-content {
    max-height: 2000px; /* Suficiente para tablas grandes */
    padding-bottom: 30px;
    border-top: 1px solid var(--border-glass);
}

.accordion-inner {
    padding: 30px;
}

/* Tablas dentro de acordeón */
.accordion-inner .table-container {
    background: transparent;
}
/* --- Drag & Drop Enhancements --- */
.drop-zone {
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.drop-zone.drag-over {
    border-color: var(--accent-primary) !important;
    background: rgba(0, 210, 255, 0.08) !important;
    transform: scale(1.01);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.2);
    animation: pulse-border 1.5s infinite;
}

.drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-info {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 600;
    display: none;
    animation: fadeIn 0.4s ease;
}

@keyframes pulse-border {
    0% { border-color: var(--accent-primary); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.4); }
    50% { border-color: var(--accent-secondary); box-shadow: 0 0 20px 10px rgba(0, 210, 255, 0); }
    100% { border-color: var(--accent-primary); box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

/* --- SaaS Minimalist Theme Styles --- */

.bg-saas-body {
    background: var(--bg-deep) !important;
}

.saas-container {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-glass);
    overflow: hidden;
}

.saas-header {
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-glass);
}

.saas-header h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 0;
}

.saas-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.btn-saas-primary {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-saas-primary:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-saas-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-saas-secondary:hover {
    background: #dbeafe;
    color: #1e40af;
}

.saas-filters {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.saas-select {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
}

.saas-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.saas-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.saas-table th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: capitalize;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
}

.saas-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
    vertical-align: middle;
    font-size: 0.95rem;
}

.saas-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

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

/* Badges for grades */
.saas-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 40px;
}

.saas-badge-success {
    background: #dcfce7;
    color: #166534;
}

.saas-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.saas-badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.saas-badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

/* Avatar styling */
.saas-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.75rem;
}

.saas-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 0.75rem;
}

.saas-search {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: var(--text-primary);
    width: 250px;
}

.saas-search-wrapper {
    position: relative;
}

.saas-search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Custom layout wrapper for SaaS view */
.saas-layout {
    min-height: 100vh;
    padding: 2rem;
}

/* --- Top Navbar & Themes --- */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 40px;
    background: var(--glass-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: -40px -40px 30px -40px;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.top-navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-navbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Breadcrumbs */
.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    padding: 6px 15px;
    border-radius: 50px;
    border: 1px solid var(--border-glass);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--tr-fast);
}

.breadcrumb-item i {
    font-size: 0.8rem;
}

.breadcrumb-item a:hover {
    color: var(--accent-primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb-separator {
    opacity: 0.2;
    font-size: 0.7rem;
}


.btn-back-saas {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-back-saas:hover {
    background: rgba(var(--accent-primary-rgb), 0.1);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateX(-5px);
}

.btn-back-saas i {
    font-size: 1.1rem;
}



.top-search-bar {
    position: relative;
    width: 300px;
}

.top-search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.top-search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.02);
    color: var(--text-primary);
    transition: var(--tr-fast);
}

.top-search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 10px rgba(0,210,255,0.1);
}

.notification-icon {
    position: relative;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--tr-fast);
}

.notification-icon:hover {
    color: var(--accent-primary);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-danger);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid var(--bg-card);
}

.top-profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    transition: all 0.3s ease;
}

.top-profile-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

.avatar-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

.status-ring {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
}

.status-ring.online { background: #25D366; box-shadow: 0 0 10px rgba(37, 211, 102, 0.5); }
.status-ring.offline { background: #ff4b2b; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online { background: #25D366; box-shadow: 0 0 8px rgba(37, 211, 102, 0.8); }
.status-dot.offline { background: #ff4b2b; }

.text-online { color: var(--accent-secondary) !important; }
.text-offline { color: var(--text-muted) !important; }

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

.top-profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.top-profile-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.user-dropdown-premium {
    min-width: 320px;
    background: rgba(17, 24, 33, 0.85) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 24px !important;
    padding: 12px !important;
    margin-top: 15px !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    z-index: 2000 !important;
    overflow: hidden;
}

.user-dropdown-header {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 18px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-dropdown-premium .dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
}

.user-dropdown-premium .dropdown-item:hover {
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-primary);
    transform: translateX(8px);
}

.user-dropdown-premium .dropdown-item i {
    width: 22px;
    font-size: 1.15rem;
    color: var(--accent-primary);
    opacity: 0.8;
}

.user-dropdown-premium .dropdown-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.notif-unread { border-left: 3px solid var(--accent-primary) !important; }

.dropdown-divider-custom {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 12px 0;
}

.btn-logout-premium {
    background: linear-gradient(135deg, rgba(255, 81, 47, 0.1), rgba(255, 81, 47, 0.05));
    color: #ff512f;
    border: 1px solid rgba(255, 81, 47, 0.2);
    border-radius: 14px;
    padding: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.btn-logout-premium:hover {
    background: #ff512f;
    color: white;
    box-shadow: 0 10px 25px rgba(255, 81, 47, 0.4);
    transform: translateY(-2px);
}

/* Animations */
.animate {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

@keyframes slideIn {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.slideIn { animation-name: slideIn; }

.theme-switcher-pro {
    background: rgba(255, 255, 255, 0.03);
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid var(--border-glass);
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    cursor: pointer;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-primary);
    transform: scale(1.15);
}

.theme-btn.active {
    background: var(--accent-primary);
    color: var(--bg-deep);
    box-shadow: 0 0 15px var(--accent-primary);
}

/* Colores específicos para cada botón al pasar el mouse (opcional) */
.theme-btn[data-theme="ocean"]:hover { color: #0ea5e9; }
.theme-btn[data-theme="forest"]:hover { color: #10b981; }
.theme-btn[data-theme="sunset"]:hover { color: #f97316; }
.theme-btn[data-theme="midnight"]:hover { color: #8b5cf6; }

/* --- Grade Management Premium Dashboard --- */
.grade-header-box {
    background: var(--glass-background);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.grade-card-premium {
    background: var(--glass-background);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.grade-card-premium:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.grade-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grade-card-premium:hover::before {
    opacity: 1;
}

.grade-badge-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.grade-badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grade-badge-code {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.grade-badge-edition {
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.grade-course-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.3rem;
}

.grade-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
}

.grade-metric-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.grade-metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.grade-metric-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.grade-metric-value i {
    color: var(--accent-primary);
    font-size: 0.8rem;
}

.grade-progress-section {
    margin-top: auto;
}

.grade-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
}

.grade-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.grade-progress-pct {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-primary);
}

.grade-progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.grade-progress-bar-fill {
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, var(--accent-primary), #00f2fe);
    border-radius: 10px;
    transition: width 1s ease-in-out;
    box-shadow: 0 0 10px var(--accent-primary);
}

.btn-grade-action {
    background: var(--accent-primary);
    color: var(--bg-deep);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-grade-action:hover {
    background: white;
    color: var(--bg-deep);
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.grade-search-pro {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px !important;
    color: white !important;
    padding: 10px 20px 10px 45px !important;
    width: 300px;
    transition: all 0.3s ease;
}

.grade-search-pro:focus {
    width: 350px;
    border-color: var(--accent-primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2) !important;
}

.theme-selector {
    position: relative;
}

.theme-selector select {
    appearance: none;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 8px 30px 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
}

.theme-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.theme-selector i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Theme Definitions */
body[data-theme="light"], body.light-theme {
    --bg-deep: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --border-glass: rgba(0, 0, 0, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --glass-background: rgba(255, 255, 255, 0.8);
    --accent-primary-rgb: 59, 130, 246; /* Blue for light mode */
}

body[data-theme="ocean"] {
    --bg-deep: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(56, 189, 248, 0.2);
    --accent-primary: #38bdf8;
    --accent-primary-rgb: 56, 189, 248;
    --accent-secondary: #0ea5e9;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
}

body[data-theme="forest"] {
    --bg-deep: #064e3b;
    --bg-sidebar: #065f46;
    --bg-card: rgba(6, 95, 70, 0.7);
    --border-glass: rgba(52, 211, 153, 0.2);
    --accent-primary: #34d399;
    --accent-primary-rgb: 52, 211, 153;
    --accent-secondary: #10b981;
    --text-primary: #ecfdf5;
    --text-secondary: #a7f3d0;
    --text-muted: #6ee7b7;
}

body[data-theme="sunset"] {
    --bg-deep: #431407;
    --bg-sidebar: #7c2d12;
    --bg-card: rgba(124, 45, 18, 0.7);
    --border-glass: rgba(251, 146, 60, 0.2);
    --accent-primary: #fb923c;
    --accent-primary-rgb: 251, 146, 60;
    --accent-secondary: #f97316;
    --text-primary: #fff7ed;
    --text-secondary: #fed7aa;
    --text-muted: #fdba74;
}

body[data-theme="midnight"] {
    --bg-deep: #2e1065;
    --bg-sidebar: #4c1d95;
    --bg-card: rgba(76, 29, 149, 0.7);
    --border-glass: rgba(167, 139, 250, 0.2);
    --accent-primary: #a78bfa;
    --accent-primary-rgb: 167, 139, 250;
    --accent-secondary: #8b5cf6;
    --text-primary: #f5f3ff;
    --text-secondary: #ddd6fe;
    --text-muted: #c4b5fd;
}

/* Redefinición de clases globales para temas */
.text-muted {
    color: var(--text-muted) !important;
}

.modal-content {
    background-color: var(--bg-sidebar) !important;
    border: 1px solid var(--border-glass) !important;
}

.modal-header, .modal-footer {
    border-color: var(--border-glass) !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-secondary) !important;
    transition: all 0.3s ease !important;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent-primary) !important;
}
