:root {
    /* Paleta de colores personalizados */
    --primary: #A8D5E2;
    --primary-dark: #7BB3C4;
    --primary-light: #D4EDF5;
    
    --secondary: #F4A5AE;
    --secondary-dark: #E87A87;
    --secondary-light: #F9D0D5;
    
    --accent: #FFD89B;
    --accent-dark: #FFC966;
    --accent-light: #FFE8C4;
    
    --success: #B8E6B8;
    --success-dark: #8FD98F;
    --success-light: #E1F5E1;
    
    --info: #B5D8FF;
    --info-dark: #8BC4FF;
    --info-light: #E1F0FF;
    
    --warning: #FFE5B4;
    --warning-dark: #FFD580;
    --warning-light: #FFF2E0;
    
    --danger: #FFB3BA;
    --danger-dark: #FF8A95;
    --danger-light: #FFE0E3;
    
    --purple: #D4B3E8;
    --purple-dark: #B88DD9;
    --purple-light: #E9D9F5;
    
    --text-primary: #000000;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
}

/* Fuente Poppins global */
* {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    color: #000000;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* ============================================
   ESTILOS GLOBALES DEL DASHBOARD
   ============================================ */

/* Fondo decorativo con patrón */
.page-container {
    position: relative;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

.page-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.page-content {
    position: relative;
    z-index: 1;
}

/* Hero Section con gradiente */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* Íconos flotantes decorativos */
.floating-icon {
    position: absolute;
    opacity: 0.15;
    animation: float 6s ease-in-out infinite;
}

.floating-icon:nth-child(1) {
    top: 20%;
    right: 15%;
    font-size: 4rem;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    top: 60%;
    right: 8%;
    font-size: 3rem;
    animation-delay: 1s;
}

.floating-icon:nth-child(3) {
    top: 40%;
    right: 25%;
    font-size: 2.5rem;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Cards con efectos modernos */
.modern-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Stat Cards */
.stat-card-modern {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.stat-card-icon-bg {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 8rem;
    opacity: 0.08;
    color: #000000;
    z-index: 0;
    line-height: 1;
}

.stat-card-content {
    position: relative;
    z-index: 1;
}

/* Item Cards con hover effect */
.item-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    background: white;
}

.item-card:hover {
    transform: translateX(8px);
    border-left-color: #667eea;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
    background: #f8f9ff;
}

.item-card:last-child {
    border-bottom: none !important;
}

/* Decorative icons in cards */
.card-decoration {
    position: absolute;
    right: -30px;
    top: -30px;
    font-size: 10rem;
    opacity: 0.03;
    transform: rotate(-15deg);
    pointer-events: none;
}

/* Empty state decorativo */
.empty-state-decorative {
    position: relative;
    height: 120px;
    margin-bottom: 1.5rem;
}

.empty-state-icon-bg {
    position: absolute;
    font-size: 4rem;
    opacity: 0.1;
}

.empty-state-icon-main {
    position: relative;
    z-index: 2;
}

/* Tabs modernos */
.modern-tabs .nav-link {
    border: none;
    color: #6B7280;
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.modern-tabs .nav-link:hover {
    color: #667eea;
    background: #f8f9ff;
}

.modern-tabs .nav-link.active {
    color: #667eea;
    background: #f8f9ff;
    border-bottom: 3px solid #667eea;
}

/* Botones con efectos */
.btn {
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
}

/* Form controls mejorados */
.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Badges modernos */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

/* Progress bar suave */
.progress {
    height: 8px;
    border-radius: 10px;
    background: #f3f4f6;
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Sidebar con fondo claro y texto negro */
.sidebar {
    min-height: calc(100vh - 80px);
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link {
    color: #000000;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    margin: 0.25rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.sidebar .nav-link i {
    font-size: 1.125rem;
    width: 24px;
    color: #000000;
}

.sidebar .nav-link:hover {
    background: #f3f4f6;
    color: #000000;
    transform: translateX(4px);
}

.sidebar .nav-link:hover i {
    color: #000000;
}

.sidebar .nav-link.active {
    background: #3b82f6;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.sidebar .nav-link.active i {
    color: #ffffff;
}

.sidebar hr {
    border-color: #e5e7eb;
    margin: 1rem 1rem;
    opacity: 1;
}

/* ============================================
   ESTILOS RESPONSIVE
   ============================================ */

/* Sidebar de Perfil Móvil */
.profile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.profile-sidebar.show {
    right: 0;
}

.profile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.profile-sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    display: flex;
    align-items: start;
    justify-content: space-between;
    flex-shrink: 0;
}

.profile-sidebar-close {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.profile-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.profile-sidebar-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.profile-sidebar-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.profile-sidebar-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.profile-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.profile-sidebar-item:hover {
    background: #f3f4f6;
    color: #667eea;
    transform: translateX(4px);
}

.profile-sidebar-item i {
    font-size: 1.25rem;
    width: 24px;
}

.profile-info-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
}

.profile-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

.profile-sidebar-footer .btn {
    font-weight: 600;
    padding: 0.875rem;
}

/* Tablet y Mobile */
@media (max-width: 991px) {
    /* Hero Section */
    .hero-section {
        padding: 2rem 1.5rem !important;
    }
    
    .hero-section h1 {
        font-size: 1.75rem !important;
    }
    
    .hero-section .lead {
        font-size: 1rem !important;
    }
    
    /* Statistics Cards */
    .stat-card-modern {
        margin-bottom: 1rem;
    }
    
    .stat-card-icon-bg {
        font-size: 5rem;
        right: -10px;
        bottom: -10px;
    }
    
    /* Item Cards */
    .item-card {
        padding: 1.25rem !important;
    }
    
    .item-card .d-flex {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .item-card .flex-shrink-0 {
        width: 100%;
    }
    
    .item-card .btn {
        width: 100%;
    }
    
    /* Modern Cards */
    .modern-card {
        margin-bottom: 1.5rem;
    }
    
    /* Empty State */
    .empty-state-decorative {
        height: 100px;
    }
    
    /* Sidebar oculto en móvil */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 56px;
        width: 280px;
        height: calc(100vh - 56px);
        z-index: 1040;
        transition: left 0.3s ease;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    /* Overlay para sidebar móvil */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1039;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Main content ajustado */
    main {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Navbar toggle para sidebar */
    .navbar-toggler {
        order: -1;
        margin-right: 1rem;
    }
}

/* Mobile específico */
@media (max-width: 767px) {
    /* Hero Section más compacto */
    .hero-section {
        padding: 1.5rem 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-section h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-section .lead {
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-section .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.25rem;
    }
    
    /* Statistics Cards compactas */
    .stat-card-modern .card-body {
        padding: 1.25rem !important;
    }
    
    .stat-card-modern .display-6 {
        font-size: 2rem !important;
    }
    
    .stat-card-modern .fs-3 {
        font-size: 1.5rem !important;
    }
    
    /* Badges más pequeños */
    .badge {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.5rem !important;
    }
    
    /* Card headers compactos */
    .card-header h5 {
        font-size: 1rem !important;
    }
    
    /* Empty states */
    .empty-state-decorative {
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .empty-state-icon-main {
        width: 70px !important;
        height: 70px !important;
    }
    
    .empty-state-icon-main i {
        font-size: 1.75rem !important;
    }
    
    /* Botones full width en móvil */
    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        flex: 1 1 auto;
        font-size: 0.875rem;
    }
    
    /* Tablas y listas responsive */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Spacing reducido */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .mb-5 {
        margin-bottom: 1.5rem !important;
    }
    
    .p-4 {
        padding: 1rem !important;
    }
    
    .p-5 {
        padding: 1.5rem !important;
    }
}

/* Docente Dashboard Responsive */
@media (max-width: 991px) {
    .stat-card .card-body {
        padding: 1.5rem 1.25rem !important;
    }
    
    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2.25rem;
        margin-bottom: 0.5rem;
    }
    
    .stat-label {
        font-size: 0.875rem;
    }
    
    .classroom-item {
        padding: 1.5rem 1rem !important;
    }
    
    .classroom-item .d-flex {
        flex-direction: column;
        gap: 1.5rem !important;
    }
    
    .classroom-item .rounded-circle {
        width: 48px !important;
        height: 48px !important;
    }
    
    .classroom-item .rounded-circle i {
        font-size: 1.25rem !important;
    }
    
    .classroom-item h6 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .classroom-item .btn {
        width: 100%;
        margin-left: 0 !important;
    }
    
    .empty-state {
        padding: 3rem 1.5rem;
        min-height: 250px;
    }
    
    .empty-state-icon {
        width: 64px;
        height: 64px;
    }
    
    .empty-state-icon i {
        font-size: 1.5rem;
    }
    
    .empty-state-title {
        font-size: 1.1rem;
    }
    
    .empty-state-description {
        font-size: 0.875rem;
    }
}

@media (max-width: 767px) {
    /* Header del dashboard */
    .d-flex.justify-content-between {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between h1 {
        font-size: 1.5rem !important;
    }
    
    .d-flex.justify-content-between .btn {
        width: 100%;
    }
    
    /* Stats cards en columna */
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .classroom-item .d-flex.gap-5 {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .classroom-item .d-flex.align-items-center.gap-4 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
}

/* Mejoras de navbar móvil */
@media (max-width: 991px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-brand {
        flex: 1;
        justify-content: center;
        margin: 0;
    }
    
    .navbar-brand span {
        font-size: 1.1rem;
    }
    
    .navbar-toggler {
        margin: 0;
        padding: 0.5rem;
    }
    
    #mobileMenuToggle {
        background: transparent;
        border: none;
        color: #374151;
        padding: 0.25rem;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }
    
    #mobileMenuToggle:hover {
        color: #667eea;
    }
    
    #mobileProfileToggle {
        background: transparent;
        padding: 0;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem 0;
        border-top: 1px solid #e5e7eb;
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* Animaciones suaves */
@media (prefers-reduced-motion: no-preference) {
    .sidebar,
    .sidebar-overlay,
    .profile-sidebar,
    .profile-sidebar-overlay {
        transition: all 0.3s ease;
    }
}