/* ===========================================
   Studiapps - IPSA
   Premium Aerospace Dark Theme
   =========================================== */

:root {
    /* IPSA Brand Colors */
    --ipsa-blue-dark: #0B3D91;
    --ipsa-blue: #1E5FAA;
    --ipsa-blue-light: #3B82C4;
    --ipsa-cyan: #00B4D8;
    --ipsa-cyan-light: #48CAE4;
    --ipsa-gradient: linear-gradient(135deg, var(--ipsa-blue) 0%, var(--ipsa-cyan) 100%);
    
    /* Space Theme */
    --bg-space: #030712;
    --bg-space-light: #0a1628;
    --bg-card: rgba(11, 61, 145, 0.06);
    --bg-card-solid: #0c1a30;
    --bg-hover: rgba(11, 61, 145, 0.12);
    
    /* Text */
    --text-primary: #f0f4ff;
    --text-secondary: #a0b4d0;
    --text-muted: #5a6f8c;
    
    /* Borders */
    --border-color: rgba(59, 130, 196, 0.15);
    --border-hover: rgba(59, 130, 196, 0.3);
    
    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Glows */
    --glow-blue: rgba(30, 95, 170, 0.5);
    --glow-cyan: rgba(0, 180, 216, 0.4);
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 72px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-space);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

/* ===========================================
   Animated Background
   =========================================== */

.app-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.app-bg-stars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.app-bg-star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: starTwinkle var(--duration) ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { opacity: var(--min-opacity); }
    50% { opacity: 0.8; }
}

.app-bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(30, 95, 170, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 95, 170, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

.app-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    animation: glowPulse 15s ease-in-out infinite;
}

.app-bg-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(11, 61, 145, 0.2) 0%, transparent 70%);
    top: -200px;
    left: -100px;
}

.app-bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.15) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: 7s;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Animated Objects */
.flying-plane,
.flying-satellite {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.flying-plane {
    animation: planeMove var(--duration, 25s) linear infinite;
    animation-delay: var(--delay, 0s);
}

.flying-plane svg {
    width: 40px;
    height: 40px;
    fill: var(--ipsa-cyan);
    filter: drop-shadow(0 0 15px var(--glow-cyan));
}

@keyframes planeMove {
    0% { opacity: 0; transform: translate(-80px, 0) rotate(-10deg); }
    5% { opacity: 0.6; }
    95% { opacity: 0.6; }
    100% { opacity: 0; transform: translate(calc(100vw + 80px), -200px) rotate(-10deg); }
}

.flying-satellite {
    animation: satelliteMove var(--duration, 40s) linear infinite;
    animation-delay: var(--delay, 0s);
}

.flying-satellite svg {
    width: 30px;
    height: 30px;
    fill: var(--ipsa-blue-light);
    filter: drop-shadow(0 0 12px var(--glow-blue));
}

@keyframes satelliteMove {
    0% { opacity: 0; transform: translate(100vw, 0) rotate(0deg); }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { opacity: 0; transform: translate(-100px, 100px) rotate(180deg); }
}

/* Plane Trail Effect */
.plane-trail {
    position: absolute;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ipsa-cyan), transparent);
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    animation: trailPulse 1.5s ease-in-out infinite;
}

@keyframes trailPulse {
    0%, 100% { opacity: 0.3; width: 80px; }
    50% { opacity: 0.7; width: 120px; }
}

/* Satellite Signal Effect */
.satellite-signal {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 1px solid var(--ipsa-cyan);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: signalPulse 3s ease-out infinite;
}

@keyframes signalPulse {
    0% { 
        transform: translate(-50%, -50%) scale(0.5); 
        opacity: 0.6; 
    }
    100% { 
        transform: translate(-50%, -50%) scale(2.5); 
        opacity: 0; 
    }
}

/* Shooting Stars */
.shooting-star {
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, var(--ipsa-cyan), rgba(0, 180, 216, 0.5), transparent);
    opacity: 0;
    animation: shootingStar var(--duration, 10s) ease-out infinite;
    animation-delay: var(--delay, 0s);
    transform: rotate(-45deg);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--ipsa-cyan), 0 0 20px rgba(0, 180, 216, 0.5);
}

.shooting-star::before {
    content: '';
    position: absolute;
    left: 0;
    top: -1px;
    width: 6px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white, 0 0 20px var(--ipsa-cyan);
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(-45deg);
    }
    5% { opacity: 1; }
    15% {
        opacity: 0;
        transform: translate(-400px, 400px) rotate(-45deg);
    }
    100% { opacity: 0; }
}

/* Orbit Rings */
.orbit-ring {
    position: absolute;
    border: 1px solid rgba(59, 130, 196, 0.08);
    border-radius: 50%;
    animation: orbitRotate var(--duration, 60s) linear infinite;
    pointer-events: none;
}

.orbit-ring::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--ipsa-cyan);
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--ipsa-cyan);
    opacity: 0.6;
}

@keyframes orbitRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===========================================
   Layout
   =========================================== */

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===========================================
   Sidebar
   =========================================== */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.95) 100%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 100;
    backdrop-filter: blur(20px);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-logo-img {
    width: 50px;
    height: auto;
    filter: drop-shadow(0 0 20px var(--glow-blue));
}

.sidebar-logo-text h2 {
    font-size: 20px;
    font-weight: 700;
    background: var(--ipsa-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo-text span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 14px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--ipsa-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0 14px;
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--ipsa-gradient);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s ease;
}

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

.nav-item.active {
    background: linear-gradient(90deg, rgba(30, 95, 170, 0.2) 0%, transparent 100%);
    color: var(--ipsa-cyan-light);
}

.nav-item.active::before {
    height: 60%;
}

.nav-item.active .nav-icon {
    color: var(--ipsa-cyan);
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-badge {
    margin-left: auto;
    background: var(--ipsa-gradient);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 10px var(--glow-cyan);
}

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

.user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-hover);
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ipsa-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--glow-blue);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===========================================
   Main Content
   =========================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.header {
    height: var(--header-height);
    background: linear-gradient(180deg, rgba(11, 61, 145, 0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    background: var(--ipsa-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.header-btn:hover {
    background: rgba(30, 95, 170, 0.2);
    border-color: var(--ipsa-blue-light);
    color: var(--ipsa-cyan);
    box-shadow: 0 0 20px var(--glow-blue);
}

.header-btn svg {
    width: 22px;
    height: 22px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

/* Custom Scrollbar */
.content-area::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.content-area::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.content-area::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--ipsa-blue);
}

/* ===========================================
   Pages
   =========================================== */

.page {
    display: none;
    animation: pageIn 0.4s ease;
}

.page.active {
    display: block;
}

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

/* ===========================================
   Cards
   =========================================== */

.card {
    background: linear-gradient(180deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 10px 50px rgba(11, 61, 145, 0.15), 0 0 30px rgba(0, 180, 216, 0.1);
    transform: translateY(-2px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ipsa-cyan), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

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

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===========================================
   Dashboard Grid
   =========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(11, 61, 145, 0.1) 0%, rgba(0, 180, 216, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ipsa-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 40px rgba(11, 61, 145, 0.15);
}

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

/* ===========================================
   Enhanced Button Animations
   =========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--ipsa-gradient);
    color: white;
    box-shadow: 0 4px 20px var(--glow-cyan), 0 0 40px rgba(0, 180, 216, 0.15);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 35px var(--glow-cyan), 0 0 60px rgba(0, 180, 216, 0.25);
}

.btn-primary:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(30, 95, 170, 0.25);
    border-color: var(--ipsa-cyan);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 180, 216, 0.2);
}

/* Ripple Effect */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Sync Button Animation */
.header-btn.syncing svg {
    animation: syncSpin 1s linear infinite;
}

@keyframes syncSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.blue {
    background: linear-gradient(135deg, rgba(30, 95, 170, 0.2) 0%, rgba(30, 95, 170, 0.1) 100%);
    color: var(--ipsa-blue-light);
    box-shadow: 0 0 20px rgba(30, 95, 170, 0.2);
}

.stat-icon.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.stat-icon.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--warning);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.stat-icon.cyan {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.2) 0%, rgba(0, 180, 216, 0.1) 100%);
    color: var(--ipsa-cyan);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.2);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
    background: var(--ipsa-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===========================================
   Calendar Styles
   =========================================== */

.calendar-container {
    background: linear-gradient(180deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    height: calc(100vh - 160px);
    backdrop-filter: blur(10px);
}

.fc {
    height: 100%;
}

.fc-theme-standard .fc-scrollgrid {
    border-color: var(--border-color);
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border-color);
}

.fc .fc-daygrid-day-number {
    color: var(--text-primary);
    padding: 10px;
    font-weight: 500;
}

.fc .fc-col-header-cell-cushion {
    color: var(--ipsa-cyan);
    font-weight: 600;
    padding: 14px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.fc .fc-button-primary {
    background: var(--ipsa-gradient);
    border: none;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--glow-blue);
}

.fc .fc-button-primary:hover {
    filter: brightness(1.1);
}

.fc .fc-button-primary:disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    box-shadow: none;
}

.fc .fc-today-button {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
}

.fc .fc-today-button:hover {
    background: rgba(30, 95, 170, 0.2);
    border-color: var(--ipsa-blue-light);
}

.fc .fc-daygrid-day.fc-day-today {
    background: linear-gradient(135deg, rgba(30, 95, 170, 0.15) 0%, rgba(0, 180, 216, 0.1) 100%);
}

.fc-event {
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fc-timegrid-slot {
    height: 48px;
}

.fc .fc-timegrid-slot-label-cushion {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

/* ===========================================
   Grades Module
   =========================================== */

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.grade-card {
    background: linear-gradient(135deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.grade-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at top right, var(--glow-blue) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grade-card:hover {
    border-color: var(--ipsa-blue-light);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(11, 61, 145, 0.15);
}

.grade-card:hover::after {
    opacity: 0.5;
}

.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.grade-subject {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.grade-module {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.grade-score {
    font-size: 28px;
    font-weight: 800;
}

.grade-score.good {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grade-score.average {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grade-score.poor {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.grade-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

.grade-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===========================================
   Average Display
   =========================================== */

.average-card {
    background: var(--ipsa-gradient);
    border-radius: 20px;
    padding: 32px;
    color: white;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 50px var(--glow-blue);
}

.average-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: averageGlow 5s ease-in-out infinite;
}

@keyframes averageGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.average-value {
    font-size: 56px;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.average-label {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 4px;
}

.average-details {
    display: flex;
    gap: 28px;
    margin-top: 20px;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.average-details span {
    opacity: 0.9;
    font-weight: 500;
}

/* ===========================================
   Absences Table
   =========================================== */

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-size: 11px;
    font-weight: 700;
    color: var(--ipsa-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(11, 61, 145, 0.1);
}

td {
    font-size: 14px;
    color: var(--text-secondary);
}

tr:hover td {
    background: var(--bg-hover);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.absent {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-badge.late {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-badge.excused {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.justified-badge {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.justified-badge.yes {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.justified-badge.no {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ===========================================
   Messages Module
   =========================================== */

.messages-container {
    display: flex;
    gap: 24px;
    height: calc(100vh - 160px);
}

.conversations-list {
    width: 340px;
    background: linear-gradient(180deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.conversations-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.conversations-scroll {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.conversation-item:hover,
.conversation-item.active {
    background: var(--bg-hover);
}

.conversation-item.active {
    border-left: 3px solid var(--ipsa-cyan);
}

.conversation-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--ipsa-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px var(--glow-blue);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.conversation-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    text-align: right;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-muted);
}

.conversation-unread {
    background: var(--ipsa-gradient);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 6px;
    display: inline-block;
    box-shadow: 0 2px 10px var(--glow-cyan);
}

.chat-area {
    flex: 1;
    background: linear-gradient(180deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message-bubble {
    max-width: 70%;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.message-bubble.sent {
    background: var(--ipsa-gradient);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px var(--glow-blue);
}

.message-bubble.received {
    background: var(--bg-hover);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.message-bubble.sent .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 14px;
}

.chat-input input {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.chat-input input:focus {
    border-color: var(--ipsa-blue-light);
    box-shadow: 0 0 20px var(--glow-blue);
}

.chat-input input::placeholder {
    color: var(--text-muted);
}

.chat-input button {
    background: var(--ipsa-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--glow-blue);
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--glow-cyan);
}

/* ===========================================
   Neo AI Assistant
   =========================================== */

.neo-container {
    display: flex;
    gap: 24px;
    height: calc(100vh - 160px);
}

.neo-chat {
    flex: 1;
    background: linear-gradient(180deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.neo-chat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse at top, var(--glow-cyan) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

.neo-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.neo-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--ipsa-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 30px var(--glow-cyan);
}

.neo-avatar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 18px;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--ipsa-cyan) 0%, var(--ipsa-blue) 50%, var(--ipsa-cyan) 100%) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: neoRing 3s linear infinite;
}

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

.neo-avatar svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.neo-info h3 {
    font-size: 18px;
    font-weight: 700;
    background: var(--ipsa-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.neo-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.neo-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

.neo-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.neo-messages {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.neo-message {
    display: flex;
    gap: 14px;
    max-width: 85%;
    animation: messageIn 0.4s ease;
}

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

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

.neo-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ipsa-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px var(--glow-blue);
}

.neo-message-avatar svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.neo-message.user .neo-message-avatar {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.neo-message-content {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.neo-message.user .neo-message-content {
    background: var(--ipsa-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 20px var(--glow-blue);
}

.neo-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}

.neo-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--ipsa-cyan);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.neo-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.neo-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.neo-input {
    padding: 24px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 14px;
}

.neo-input textarea {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    min-height: 56px;
    max-height: 150px;
    transition: var(--transition);
}

.neo-input textarea:focus {
    border-color: var(--ipsa-blue-light);
    box-shadow: 0 0 25px var(--glow-blue);
}

.neo-input textarea::placeholder {
    color: var(--text-muted);
}

.neo-input button {
    width: 56px;
    height: 56px;
    background: var(--ipsa-gradient);
    border: none;
    border-radius: 14px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--glow-cyan);
}

.neo-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px var(--glow-cyan);
}

.neo-input button svg {
    width: 24px;
    height: 24px;
}

/* ===========================================
   Directory Module
   =========================================== */

.directory-header {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 24px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--ipsa-blue-light);
    box-shadow: 0 0 25px var(--glow-blue);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filter-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--ipsa-blue-light);
    color: var(--ipsa-cyan);
    background: rgba(30, 95, 170, 0.15);
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.user-card-item {
    background: linear-gradient(135deg, rgba(11, 61, 145, 0.08) 0%, rgba(3, 7, 18, 0.6) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: var(--transition);
}

.user-card-item:hover {
    border-color: var(--ipsa-blue-light);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(11, 61, 145, 0.15);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.user-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--ipsa-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 20px var(--glow-blue);
}

.user-card-name {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 15px;
}

.user-card-role {
    font-size: 13px;
    color: var(--ipsa-cyan);
    font-weight: 500;
}

.user-card-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.user-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(30, 95, 170, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--ipsa-cyan-light);
    font-weight: 500;
}

/* ===========================================
   Profile Module
   =========================================== */

.profile-header {
    background: linear-gradient(135deg, rgba(11, 61, 145, 0.12) 0%, rgba(3, 7, 18, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    gap: 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at top right, var(--glow-cyan) 0%, transparent 70%);
    opacity: 0.1;
}

.profile-avatar {
    width: 130px;
    height: 130px;
    border-radius: 20px;
    background: var(--ipsa-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 44px;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--glow-blue);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.profile-avatar-edit:hover {
    background: var(--ipsa-cyan);
}

.profile-info {
    flex: 1;
    position: relative;
    z-index: 1;
}

.profile-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
    background: var(--ipsa-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-email {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 15px;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-hover);
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

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

.form-input,
.form-textarea,
.form-select {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--ipsa-blue-light);
    box-shadow: 0 0 20px var(--glow-blue);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6f8c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
}

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

/* ===========================================
   Buttons
   =========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn-primary {
    background: var(--ipsa-gradient);
    color: white;
    box-shadow: 0 4px 20px var(--glow-blue);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--glow-cyan);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--ipsa-blue-light);
    background: rgba(30, 95, 170, 0.2);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* ===========================================
   Empty State
   =========================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
    color: var(--ipsa-cyan);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

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

/* ===========================================
   Loading States
   =========================================== */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--ipsa-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===========================================
   Today's Courses
   =========================================== */

.course-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px;
    background: var(--bg-hover);
    border-radius: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.course-item:hover {
    border-color: var(--ipsa-cyan);
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.15), -4px 0 0 var(--ipsa-cyan);
    background: linear-gradient(90deg, rgba(0, 180, 216, 0.08), var(--bg-hover));
}

.course-time {
    text-align: center;
    min-width: 70px;
}

.course-time-start {
    font-size: 16px;
    font-weight: 700;
    color: var(--ipsa-cyan);
}

.course-time-end {
    font-size: 12px;
    color: var(--text-muted);
}

.course-divider {
    width: 4px;
    height: 50px;
    background: var(--ipsa-gradient);
    border-radius: 2px;
}

.course-info {
    flex: 1;
}

.course-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 15px;
}

.course-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.course-details span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===========================================
   Recent Grades
   =========================================== */

.recent-grade-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--bg-hover);
    border-radius: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.recent-grade-item:hover {
    border-color: var(--ipsa-cyan);
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.15);
}

.recent-grade-info {
    flex: 1;
}

.recent-grade-subject {
    font-weight: 600;
    margin-bottom: 4px;
}

.recent-grade-date {
    font-size: 12px;
    color: var(--text-muted);
}

.recent-grade-score {
    font-size: 22px;
    font-weight: 800;
}

/* ===========================================
   Toast Notifications
   =========================================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: linear-gradient(135deg, rgba(11, 61, 145, 0.95) 0%, rgba(3, 7, 18, 0.98) 100%);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s ease;
    backdrop-filter: blur(20px);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--ipsa-cyan); }

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 200;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .header-left #menuBtn {
        display: flex !important;
    }

    .messages-container,
    .neo-container {
        flex-direction: column;
        height: auto;
    }

    .conversations-list {
        width: 100%;
        max-height: 300px;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .content-area {
        padding: 18px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .grades-grid,
    .users-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 26px;
    }

    .average-card {
        padding: 24px;
    }

    .average-value {
        font-size: 42px;
    }

    .directory-header {
        flex-direction: column;
    }
}
