:root {
    --primary-gradient: linear-gradient(135deg, #FF80AB, #FF4081);
    --secondary-gradient: linear-gradient(135deg, #7986CB, #3F51B5);
    --success-gradient: linear-gradient(135deg, #4DB6AC, #009688);
    --dark-glass: rgba(0, 0, 0, 0.4);
    --light-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-main: #FFFFFF;
    --text-dim: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-inter), 'Inter', sans-serif;
}

body {
    background: #090d16;
    min-height: 100vh;
    color: var(--text-main);
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Ambient glow layer — subtle, same on all screen sizes */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 10% 10%, rgba(255, 128, 171, 0.08) 0px, transparent 55%),
        radial-gradient(ellipse at 90% 5%,  rgba(121, 134, 203, 0.09) 0px, transparent 55%),
        radial-gradient(ellipse at 90% 90%, rgba(63, 81, 181, 0.08)  0px, transparent 55%),
        radial-gradient(ellipse at 5%  90%, rgba(255, 64, 129, 0.07)  0px, transparent 55%);
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Login Page Layout */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    width: 100%;
}

.login-container {
    width: 100%;
    max-width: 480px;
    z-index: 1;
}

.glass-card {
    background: var(--light-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.form-section {
    width: 100%;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-10deg);
}

.logo-icon i {
    color: white;
}

h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-dim);
    margin-bottom: 40px;
    font-size: 16px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 18px;
}

.toggle-password {
    position: absolute;
    right: 15px !important;
    left: auto !important;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
    pointer-events: auto;
    touch-action: manipulation;
}

.toggle-password:hover {
    color: #FF4081 !important;
}

input {
    width: 100%;
    padding: 16px 20px 16px 45px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #FF4081;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(255, 64, 129, 0.1);
}

/* Fix browser autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #111625 inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-dim);
}

.remember-me input {
    width: auto;
    margin: 0;
}

.sign-in-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -5px rgba(255, 64, 129, 0.4);
}

.sign-in-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(255, 64, 129, 0.6);
    filter: brightness(1.1);
}

.info-section {
    flex: 0.8;
    background: rgba(0, 0, 0, 0.4);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.info-section::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: var(--primary-gradient);
    filter: blur(100px);
    opacity: 0.3;
    z-index: -1;
}

.quote-icon {
    font-size: 40px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.quote-text {
    font-size: 24px;
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 30px;
}

.author-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.author-info p {
    color: var(--text-dim);
    font-size: 14px;
}

.nav-controls {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.floating-card {
    background: white;
    color: #333;
    padding: 30px;
    border-radius: 30px;
    margin-top: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.floating-card h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #1a1a2e;
}

.floating-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.avatars {
    display: flex;
    align-items: center;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -10px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.avatar:first-child {
    margin-left: 0;
}

.avatar.more {
    background: #333;
    color: white;
}

.error-message {
    background: rgba(255, 64, 129, 0.1);
    border-left: 4px solid #FF4081;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dashboard Layout */
.dashboard-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    padding: 20px;
}

.glass-panel {
    background: var(--light-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 30px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Sidebar Profile */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: sticky;
    top: 20px;
    align-self: start;
    z-index: 100;
}

.profile-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

.avatar-large {
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    border-radius: 30px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    transform: rotate(-10deg);
    box-shadow: 0 10px 20px rgba(255, 64, 129, 0.3);
    color: white;
}

.profile-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.profile-header p {
    color: var(--text-dim);
    font-size: 14px;
}

.info-list {
    list-style: none;
    margin-top: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item:last-child { border: none; }

.info-item i {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #FF80AB;
}

.info-content label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-content span {
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
}

.logout-btn {
    width: 100%;
    padding: 15px;
    background: rgba(255, 64, 129, 0.1);
    border: 1px solid rgba(255, 64, 129, 0.2);
    border-radius: 15px;
    color: #FF80AB;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: block;
    transition: all 0.3s;
    margin-top: auto;
    cursor: pointer;
}

.logout-btn:hover {
    background: #FF4081;
    color: white;
    box-shadow: 0 10px 20px rgba(255, 64, 129, 0.2);
}

/* Main Dashboard Panels */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: 28px;
    font-weight: 700;
}

.welcome-text p {
    color: var(--text-dim);
    font-size: 14px;
}

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

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.stat-info h4 {
    font-size: 24px;
    font-weight: 700;
}

.stat-info p {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Notifications Card */
.notification-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}

.notification-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 15px;
    margin-bottom: 12px;
    transition: transform 0.3s;
}

.notification-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.05);
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.note-by {
    font-weight: 600;
    font-size: 13px;
    color: #FF80AB;
}

.note-date {
    font-size: 11px;
    color: var(--text-dim);
}

.note-msg {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.notif-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 15px;
    background: var(--primary-gradient);
    color: white !important;
    text-decoration: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 64, 129, 0.2);
}

.notif-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 64, 129, 0.4);
    filter: brightness(1.1);
}

/* Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 15px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-glass);
}

td {
    padding: 18px 15px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success { background: rgba(77, 182, 172, 0.2); color: #4DB6AC; }
.badge-warning { background: rgba(255, 128, 171, 0.2); color: #FF80AB; }

.progress-mini {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
}

.smart-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.tag-safe { background: rgba(77, 182, 172, 0.15); color: #4DB6AC; border: 1px solid rgba(77, 182, 172, 0.2); }
.tag-danger { background: rgba(255, 64, 129, 0.15); color: #FF4081; border: 1px solid rgba(255, 64, 129, 0.2); }

/* Loading / Sync Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.loading-content {
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 64, 129, 0.1);
    border-top: 4px solid #FF4081;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-status {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    height: 30px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

/* Responsiveness */
@media (max-width: 1100px) {
    .dashboard-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        position: static;
    }
    .sidebar .glass-panel { flex: 1; }
}

@media (max-width: 900px) {
    .glass-card {
        flex-direction: column;
        border-radius: 30px;
    }

    .info-section {
        display: none;
    }

    .form-section {
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .desktop-only-credits {
        display: none !important;
    }
    .desktop-doughnut-text {
        display: none !important;
    }
    .mobile-doughnut-text {
        display: flex !important;
    }

    body { padding: 10px; }
    .sidebar { flex-direction: column; position: static; }
    .top-bar { flex-direction: column; align-items: flex-start; gap: 15px; }
}

@media (max-width: 480px) {
    h1 { font-size: 28px; }
    .form-section { padding: 30px 20px; }
}

/* ==========================================
   Visual Analytics & Attendance Calculator
   ========================================== */

/* SVG Circular Progress Ring */
.circular-progress-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.circular-progress-text {
    position: absolute;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

/* Grade Distribution Chart */
.grade-chart-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.grade-bar-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.grade-label {
    width: 25px;
    font-weight: 700;
    font-size: 14px;
    color: #FF80AB;
}

.grade-bar-track {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.grade-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 6px;
    transition: width 0.8s ease-in-out;
}

.grade-count {
    width: 30px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dim);
}

/* Bunk Calculator */
.bunk-planner-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bunk-planner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Give the completed courses table more width on desktop */
@media (min-width: 769px) {
    .completed-courses-panel .bunk-planner-grid {
        grid-template-columns: 2.2fr 1fr;
    }
}

@media (max-width: 768px) {
    .bunk-planner-grid {
        grid-template-columns: 1fr;
    }
}

.bunk-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bunk-input-group label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}

.bunk-select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.bunk-select:focus {
    border-color: #FF4081;
}

.bunk-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bunk-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.bunk-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF4081;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 64, 129, 0.5);
    transition: transform 0.2s;
}

.bunk-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.bunk-target-badge {
    padding: 6px 12px;
    background: rgba(255, 64, 129, 0.2);
    border: 1px solid rgba(255, 64, 129, 0.4);
    color: #FF80AB;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

/* Calculator Output Results */
.bunk-result-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
}

.bunk-result-box {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.bunk-result-box.safe {
    background: rgba(77, 182, 172, 0.1);
    border-color: rgba(77, 182, 172, 0.2);
    color: #4DB6AC;
}

.bunk-result-box.danger {
    background: rgba(255, 64, 129, 0.1);
    border-color: rgba(255, 64, 129, 0.2);
    color: #FF4081;
}

.bunk-result-icon {
    font-size: 24px;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.safe .bunk-result-icon {
    background: rgba(77, 182, 172, 0.15);
}

.danger .bunk-result-icon {
    background: rgba(255, 64, 129, 0.15);
}

.bunk-result-info h5 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
    color: white;
}

.bunk-result-info p {
    font-size: 13px;
    color: var(--text-dim);
}


/* ==========================================
   Mobile-Only UI Overrides for Student Portal
   ========================================== */

/* Bottom nav bar layout (Hidden on desktop) */
.mobile-bottom-nav {
    display: none;
}

/* Week-based inline alert banners: hidden on desktop, shown only on mobile */
.today-notification-alert {
    display: none;
}

/* Desktop: increase stat card label font size for better visibility */
@media (min-width: 769px) {
    .stat-card-label {
        font-size: 11px !important;
        letter-spacing: 0.6px !important;
        color: rgba(255, 255, 255, 0.6) !important;
    }
    /* Profile tap hint only makes sense on mobile where sidebar is hidden */
    .profile-tap-hint {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Main Layout Adaptations & Overflow Protection */
    html {
        max-width: 100% !important;
        /* NOTE: do NOT set overflow-x:hidden on html — it breaks position:fixed modals on mobile */
    }

    body {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body {
        padding: 0 !important; /* Reset desktop padding: 10px completely on mobile */
        padding-bottom: 20px !important;
    }

    .dashboard-wrapper {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        max-width: 100% !important;
        padding: 12px !important; /* Reduced padding for cleaner spacing */
    }

    .main-content {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Hide Top Welcome Header & Sync Panel on Mobile */
    .top-bar {
        display: none !important;
    }

    /* Hide Notifications panel on Mobile (replaced by popup modal) */
    .notifications-panel {
        display: none !important;
    }

    /* Show week-based inline alert banners only on Mobile */
    .today-notification-alert {
        display: block !important;
    }

    /* 1. Profile Card Layout (The Sidebar becomes the top Profile Card) */
    .sidebar {
        display: flex !important;
        flex-direction: column !important;
        position: static !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    .sidebar .profile-card-panel {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 14px 16px !important; /* Reduced padding */
        border-radius: 20px !important;
        background: rgba(20, 24, 33, 0.6) !important; /* Darker Slate-Grey background */
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        gap: 15px !important; /* Ensure proper gap to prevent overlap */
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Left column of profile card (contains photo, name, semester details) */
    .sidebar .profile-photo-wrapper {
        flex: 1 !important;
        min-width: 0 !important;
        position: static !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        background: transparent !important;
        width: auto !important;
        height: auto !important; /* Override inline height 280px */
    }
    
    .sidebar .profile-photo-wrapper img {
        width: 58px !important;
        height: 58px !important;
        border-radius: 50% !important;
        border: 2px solid rgba(255, 128, 171, 0.4) !important; /* Pink-ish border */
        box-shadow: 0 0 10px rgba(255, 128, 171, 0.2) !important;
        object-fit: cover !important;
        flex-shrink: 0 !important;
    }
    
    /* Overlay turns into a regular block text next to the image */
    .sidebar .profile-overlay-info {
        flex: 1 !important;
        min-width: 0 !important;
        position: static !important;
        height: auto !important;
        background: transparent !important;
        padding: 0 !important;
        padding-right: 10px !important; /* Spacing gap before CGPA capsule */
        text-align: left !important;
        align-items: flex-start !important;
        max-width: calc(100vw - 200px) !important; /* Prevent collision and card stretch */
    }
    
    .sidebar .profile-overlay-info h2 {
        font-size: 15px !important;
        font-weight: 700 !important;
        color: white !important;
        text-shadow: none !important;
        margin: 0 !important;
        line-height: 1.2 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important; /* Truncate name cleanly if it collides */
    }
    
    /* Show student registration number under the name */
    .sidebar .profile-overlay-info p {
        font-size: 11px !important;
        font-weight: 500 !important;
        color: var(--text-dim) !important;
        text-shadow: none !important;
        margin: 4px 0 0 0 !important;
        display: block !important;
        opacity: 0.8 !important;
    }

    /* Hide the Semester 6 override content, so it prints the register number from database */
    .sidebar .profile-overlay-info p::after {
        display: none !important;
    }

    /* Fallback avatar wrapper style formatted next to text */
    .sidebar .avatar-fallback-wrapper {
        flex: 1 !important;
        min-width: 0 !important;
        position: static !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        background: transparent !important;
        width: auto !important;
        height: auto !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    
    .sidebar .avatar-fallback-wrapper .avatar-large {
        width: 58px !important;
        height: 58px !important;
        border-radius: 50% !important;
        margin: 0 !important;
        font-size: 20px !important;
        flex-shrink: 0 !important;
    }
    
    /* Fallback text fields aligned side-by-side with circle on mobile */
    .sidebar .avatar-fallback-wrapper h2 {
        font-size: 15px !important;
        font-weight: 700 !important;
        color: white !important;
        margin: 0 !important;
        line-height: 1.2 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: block !important;
        max-width: calc(100vw - 200px) !important;
    }
    
    .sidebar .avatar-fallback-wrapper p {
        font-size: 11px !important;
        font-weight: 500 !important;
        color: var(--text-dim) !important;
        margin: 4px 0 0 0 !important;
        display: block !important;
        opacity: 0.8 !important;
    }
    
    /* Remove padding of the inner wrapper div of the profile card panel */
    .sidebar .profile-card-panel > div:last-child {
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
    }

    /* Hide the info-list fields (Email, Mobile, DOB) except the CGPA box */
    .sidebar .info-item:not(:last-child) {
        display: none !important;
    }
    
    .sidebar .info-list {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Style the CGPA box into a clean vertical capsule on the right side */
    .sidebar .info-item:last-child {
        margin: 0 !important;
        padding: 6px 12px !important;
        background: rgba(168, 85, 247, 0.05) !important;
        border: 1.5px solid rgba(168, 85, 247, 0.4) !important; /* purple border */
        border-radius: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 2px !important;
        width: 75px !important;
        height: 56px !important;
        box-shadow: 0 0 8px rgba(168, 85, 247, 0.1) !important;
        flex-shrink: 0 !important; /* Prevent squeezing */
    }
    
    .sidebar .info-item:last-child i {
        display: none !important;
    }
    
    .sidebar .info-item:last-child .info-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .sidebar .info-item:last-child .info-content label {
        display: none !important;
    }
    
    .sidebar .info-item:last-child .info-content::before {
        content: "CURRENT";
        font-size: 7px;
        font-weight: 700;
        color: rgba(168, 85, 247, 0.8);
        letter-spacing: 0.5px;
    }
    
    .sidebar .info-item:last-child .info-content span {
        font-size: 16px !important;
        font-weight: 800 !important;
        color: white !important;
        line-height: 1.1 !important;
    }
    
    .sidebar .info-item:last-child .info-content::after {
        content: "CGPA";
        font-size: 7px;
        font-weight: 700;
        color: rgba(168, 85, 247, 0.8);
        letter-spacing: 0.5px;
    }
    
    /* 2. Quick Stats Summary Grid (3-column layout) */
    .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
    }
    
    .stat-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 12px 4px !important; /* Reduced padding */
        gap: 6px !important;
        border-radius: 16px !important;
        background: rgba(20, 24, 33, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
    }
    
    .stat-card .stat-icon {
        margin: 0 !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }
    
    .stat-card .stat-info h4 {
        font-size: 16px !important; /* Slightly smaller to prevent grid item clipping */
        font-weight: 800 !important;
        line-height: 1 !important;
        margin: 4px 0 2px 0 !important;
    }
    
    .stat-card .stat-info p {
        font-size: 8px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        color: var(--text-dim) !important;
        line-height: 1.1 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    /* 3. Attendance Insights Card Stack */
    .attendance-insights-panel {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
    
    .attendance-insights-panel .section-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        padding: 0 4px !important;
    }
    
    .attendance-insights-panel .section-header h3 {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: white !important;
    }

    .attendance-insights-panel .section-header h3 i {
        display: none !important; /* Hide icon to match mockup */
    }

    /* Hide Details button from Attendance Insights on Mobile */
    .attendance-insights-panel .section-header::after {
        display: none !important;
    }
    
    /* Hide default header span details if they exist */
    .attendance-insights-panel .section-header span {
        display: none !important;
    }

    /* Transform Table to Card list stack on mobile */
    .table-container {
        display: none !important;
    }
    
    /* We can turn the table rows into cards purely using CSS! */
    .attendance-insights-panel .table-container {
        display: block !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
    
    .attendance-insights-panel table,
    .attendance-insights-panel thead,
    .attendance-insights-panel tbody,
    .attendance-insights-panel tr,
    .attendance-insights-panel td {
        display: block !important;
    }
    
    .attendance-insights-panel thead {
        display: none !important; /* Hide table headers */
    }
    
    .attendance-insights-panel tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .attendance-insights-panel tr {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 12px 14px 12px 70px !important; /* Left padding makes space for centered progress circle */
        border-radius: 18px !important;
        background: rgba(20, 24, 33, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-wrap: wrap !important;
        position: relative !important; /* Enable absolute positioning for course code badge and circle */
    }
    
    /* Style td elements to sit horizontally */
    .attendance-insights-panel td:nth-child(1) {
        order: 1 !important;
        flex: 1 !important;
        min-width: 100% !important; /* Spans full width of text column */
        margin: 0 !important;
        padding: 0 !important;
        padding-right: 75px !important; /* Prevent text colliding with course code box */
        text-align: left !important;
    }
    
    .attendance-insights-panel td:nth-child(1) div:first-child {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: white !important;
        line-height: 1.3 !important;
    }
    
    /* Make the course code badge in the top right box */
    .attendance-insights-panel td:nth-child(1) div:last-child {
        position: absolute !important;
        top: 12px !important;
        right: 14px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 6px !important;
        padding: 3px 6px !important;
        font-size: 9px !important;
        font-weight: 700 !important;
        color: var(--text-dim) !important;
        line-height: 1 !important;
        opacity: 0.9 !important;
        margin: 0 !important;
    }
    
    /* Attended classes count (aligns perfectly under the name starting edge) */
    .attendance-insights-panel td:nth-child(2) {
        order: 2 !important;
        display: inline-block !important;
        font-size: 11px !important;
        color: var(--text-dim) !important;
        margin-left: 0 !important; /* Automatically aligns with the left edge of name */
        margin-top: 4px !important;
        padding: 0 !important;
        width: auto !important;
        flex: none !important;
        text-align: left !important;
    }
    
    .attendance-insights-panel td:nth-child(2)::after {
        content: " Classes" !important; /* Replace sessions with classes */
    }
    
    /* Progress ring column - centered vertically on the left side of the card */
    .attendance-insights-panel td:nth-child(3) {
        order: 0 !important;
        position: absolute !important;
        left: 14px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Percentage ring size overrides */
    .attendance-insights-panel .circular-progress-wrapper {
        width: 44px !important;
        height: 44px !important;
    }
    
    .attendance-insights-panel .circular-progress-wrapper svg {
        width: 44px !important;
        height: 44px !important;
    }
    
    .attendance-insights-panel .circular-progress-wrapper svg circle {
        cx: 22 !important;
        cy: 22 !important;
        r: 18 !important;
        stroke-width: 3.5 !important;
    }
    
    .attendance-insights-panel .circular-progress-text {
        font-size: 10px !important;
        font-weight: 700 !important;
        color: white !important;
    }
    
    /* Status tag column (Can Bunk / Safe / Need text beside count classes) */
    .attendance-insights-panel td:nth-child(4) {
        order: 2 !important;
        display: inline-block !important;
        padding: 0 !important;
        margin-left: 10px !important; /* Small gap directly beside count classes */
        margin-top: 1px !important;
        width: auto !important;
        flex: none !important;
    }
    
    .attendance-insights-panel .smart-tag {
        font-size: 10px !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
        font-weight: 700 !important;
        display: inline-block !important;
    }
    
    .attendance-insights-panel .tag-safe {
        background: rgba(77, 182, 172, 0.12) !important;
        border: 1px solid rgba(77, 182, 172, 0.25) !important;
        color: #4DB6AC !important;
    }
    
    .attendance-insights-panel .tag-danger {
        background: rgba(255, 64, 129, 0.12) !important;
        border: 1px solid rgba(255, 64, 129, 0.25) !important;
        color: #FF4081 !important;
    }

    /* 4. Grade Distribution Section on Mobile */
    .completed-courses-panel {
        display: block !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .completed-courses-panel .section-header {
        margin-bottom: 15px !important;
        padding: 0 4px !important;
    }

    .completed-courses-panel .section-header h3 {
        font-size: 0 !important; /* Hide original completed courses & grade header text */
    }

    .completed-courses-panel .section-header h3::after {
        content: "Grade Distribution";
        font-size: 16px !important;
        font-weight: 700 !important;
        color: white !important;
    }

    /* Show completed courses table container as a list of vertical cards below doughnut chart */
    .completed-courses-panel .table-container {
        display: block !important;
        margin-top: 20px !important;
        width: 100% !important;
    }

    .completed-courses-panel table,
    .completed-courses-panel tbody,
    .completed-courses-panel tbody tr,
    .completed-courses-panel td {
        display: block !important;
    }

    .completed-courses-panel thead {
        display: flex !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
        border: 1px solid var(--border-glass) !important;
    }

    .completed-courses-panel thead tr {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
        padding: 5px !important;
        background: transparent !important;
        border: none !important;
    }

    .completed-courses-panel thead th {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 1 !important;
        padding: 8px 5px !important;
        font-size: 11px !important;
        border-bottom: none !important;
        color: var(--text-dim) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .completed-courses-panel tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .completed-courses-panel tbody tr {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 12px 14px 12px 60px !important; /* Left padding for vertical centered grade badge */
        border-radius: 18px !important;
        background: rgba(20, 24, 33, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-wrap: wrap !important;
        position: relative !important; /* Enable absolute badge positioning */
    }

    /* Course code badge on top right */
    .completed-courses-panel td:nth-child(1) {
        position: absolute !important;
        top: 12px !important;
        right: 14px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 6px !important;
        padding: 3px 6px !important;
        font-size: 9px !important;
        font-weight: 700 !important;
        color: var(--text-dim) !important;
        line-height: 1 !important;
        opacity: 0.9 !important;
        margin: 0 !important;
        width: auto !important;
    }

    /* Course Name next to grade badge */
    .completed-courses-panel td:nth-child(2) {
        order: 1 !important;
        flex: 1 !important;
        min-width: 100% !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: white !important;
        padding: 0 !important;
        padding-right: 75px !important; /* Avoid overlap with course code */
        text-align: left !important;
    }

    /* Grade circle badge on the left side centered vertically */
    .completed-courses-panel td:nth-child(3) {
        order: 0 !important;
        position: absolute !important;
        left: 14px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 0 !important;
        width: 34px !important;
        height: 34px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .completed-courses-panel td:nth-child(3) .badge {
        width: 34px !important;
        height: 34px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        line-height: 1 !important;
        padding: 0 !important;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1) !important;
    }

    /* Session text */
    .completed-courses-panel td:nth-child(4) {
        order: 2 !important;
        font-size: 11px !important;
        color: var(--text-dim) !important;
        margin-top: 4px !important;
        padding: 0 !important;
        width: auto !important;
        text-align: left !important;
    }

    .completed-courses-panel td:nth-child(4)::before {
        content: "Passed in " !important;
    }

    .completed-courses-panel .bunk-planner-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .completed-courses-panel .grade-chart-container {
        order: 1 !important; /* Render Grade Distribution circle box first */
        border-left: none !important;
        padding-left: 0 !important;
        width: 100% !important;
    }

    .completed-courses-panel .table-container {
        order: 2 !important; /* Render Grade List cards directly after the circle box */
    }

    .completed-courses-panel .grade-chart-container > div {
        background: rgba(20, 24, 33, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        border-radius: 20px !important;
        padding: 20px 15px !important;
        flex-direction: row !important; /* doughnut left, legend right */
        align-items: center !important;
        justify-content: space-between !important;
        gap: 20px !important;
        width: 100% !important;
    }

    /* Doughnut size and positioning (scaled down cleanly using transform to prevent broken shapes) */
    .completed-courses-panel .circular-progress-wrapper {
        width: 110px !important;
        height: 110px !important;
        transform: scale(0.85) !important;
        transform-origin: center !important;
        margin-left: -5px !important;
        flex-shrink: 0 !important;
    }

    /* Override doughnut chart inner text (Courses -> CREDITS) */
    .completed-courses-panel .circular-progress-wrapper span:last-child {
        font-size: 0 !important;
    }
    .completed-courses-panel .circular-progress-wrapper span:last-child::after {
        content: "CREDITS";
        font-size: 8px !important;
        color: var(--text-dim) !important;
        letter-spacing: 0.5px !important;
        font-weight: 700 !important;
    }

    /* Legend grid formatting (optimized to 2-column layout on mobile to reduce vertical space) */
    .completed-courses-panel .legend-grid-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px 16px !important;
        flex: 1 !important;
        margin-left: 10px !important;
    }

    .completed-courses-panel .legend-item-pill {
        background: transparent !important;
        border: none !important;
        padding: 4px 0 !important;
        border-radius: 0 !important;
        opacity: 1 !important;
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* Style the inner flex wrapper div inside demo page to stretch 100% */
    .completed-courses-panel .legend-item-pill > div {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        flex: 1 !important;
    }

    .completed-courses-panel .legend-colon-separator,
    .completed-courses-panel .legend-count-val {
        display: none !important; /* Hide colon and parenthesis count values */
    }

    .completed-courses-panel .legend-grade-label::before {
        content: "Grade ";
    }

    .completed-courses-panel .legend-text-full {
        display: flex !important;
        flex: 1 !important; /* Stretch container to fill card width */
        justify-content: space-between !important;
        width: auto !important;
        font-size: 13px !important;
        font-weight: 700 !important;
    }

    .completed-courses-panel .legend-pct-val {
        font-weight: 800 !important;
    }

    /* Scrollable Container wrapper for mobile Attendance list */
    .attendance-insights-panel .table-container {
        max-height: 280px !important;
        overflow-y: auto !important;
        padding-right: 4px !important;
        box-shadow: inset 0 -12px 12px -12px rgba(0, 0, 0, 0.9) !important; /* Bottom scroll indicator shadow */
    }

    /* Hide scrollbar but keep functionality or style custom thin scrollbar for Attendance */
    .attendance-insights-panel .table-container::-webkit-scrollbar {
        width: 4px !important;
    }
    .attendance-insights-panel .table-container::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 10px !important;
    }
}

/* Global Notifications Popup Modal Styles (Active on both Mobile and Desktop) */
.notif-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    animation: fadeInModal 0.2s ease-out !important;
}

.notif-modal-content {
    background: rgba(13, 18, 30, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px !important;
    width: 100% !important;
    max-width: 360px !important;
    max-height: 75vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
    overflow: hidden !important;
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.notif-modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.notif-modal-header h3 {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: white !important;
}

.close-modal-btn {
    background: transparent !important;
    border: none !important;
    color: var(--text-dim) !important;
    font-size: 26px !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.notif-modal-body {
    padding: 15px 20px !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.notif-modal-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 12px 14px !important;
    text-align: left !important;
}

.notif-modal-item-header {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 6px !important;
    font-size: 11px !important;
}

.notif-modal-by {
    font-weight: 700 !important;
    color: #FF80AB !important;
}

.notif-modal-date {
    color: var(--text-dim) !important;
}

.notif-modal-message {
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

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

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

/* Mobile: notification modal goes full-screen for better readability */
@media (max-width: 768px) {
    .notif-modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important; /* Slide up from bottom */
    }

    .notif-modal-content {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 85vh !important;
        border-radius: 24px 24px 0 0 !important; /* Rounded only at top — bottom sheet style */
        animation: slideUpModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    /* Show a drag handle pill at top of bottom sheet */
    .notif-modal-header::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 4px;
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }

    .notif-modal-header {
        position: relative !important;
        padding-top: 24px !important; /* Room for drag handle */
    }

    /* Clickable stat cards on mobile */
    .stat-card {
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.05) !important;
        transition: transform 0.1s ease, opacity 0.1s ease !important;
    }

    .stat-card:active {
        transform: scale(0.95) !important;
        opacity: 0.85 !important;
    }
}

/* ----------------------------------------------------
   MICRO ANIMATIONS (Hover, Active, Mount States)
   ---------------------------------------------------- */

/* 1. Cards and Panels Hover & Active States */
.glass-panel, .course-card, .info-item {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (hover: hover) {
    .glass-panel:hover, .course-card:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 15px 35px -10px rgba(0,0,0,0.6);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

.glass-panel:active, .course-card:active, .info-item:active {
    transform: translateY(0px) scale(0.98);
}

/* 2. Interactive Icons */
.stat-icon, .info-item i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s ease;
}

@media (hover: hover) {
    .stat-card:hover .stat-icon, .info-item:hover i {
        transform: scale(1.2) rotate(8deg);
    }
}

/* 3. Button Micro-interactions */
button {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

@media (hover: hover) {
    button:hover:not(:disabled) {
        transform: translateY(-2px);
        filter: brightness(1.1);
    }
}

button:active:not(:disabled) {
    transform: translateY(1px) scale(0.96) !important;
    filter: brightness(0.95);
}

/* 4. Chart / Graphic Hover */
.circular-chart-container, .avatar-fallback-wrapper {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (hover: hover) {
    .circular-chart-container:hover {
        transform: scale(1.05);
    }
    
    .avatar-fallback-wrapper:hover {
        transform: translateY(-5px);
    }
    .avatar-fallback-wrapper:hover .avatar-large {
        transform: scale(1.1) rotate(5deg);
        box-shadow: 0 0 20px rgba(255,255,255,0.4);
    }
}

/* 5. Staggered List Entry Animation (for courses and info items) */
@keyframes slideFadeUp {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.course-card {
    animation: slideFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.course-card:nth-child(1) { animation-delay: 0.05s; }
.course-card:nth-child(2) { animation-delay: 0.10s; }
.course-card:nth-child(3) { animation-delay: 0.15s; }
.course-card:nth-child(4) { animation-delay: 0.20s; }
.course-card:nth-child(5) { animation-delay: 0.25s; }
.course-card:nth-child(n+6) { animation-delay: 0.30s; }

.info-item {
    animation: slideFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.info-item:nth-child(1) { animation-delay: 0.1s; }
.info-item:nth-child(2) { animation-delay: 0.15s; }
.info-item:nth-child(3) { animation-delay: 0.2s; }
.info-item:nth-child(4) { animation-delay: 0.25s; }
.info-item:nth-child(5) { animation-delay: 0.3s; }

/* 6. Top Bar Title Slide */
.welcome-text h1, .welcome-text p {
    animation: slideFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.welcome-text p { animation-delay: 0.1s; }

/* Base Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    animation: fadeInModal 0.2s ease-out;
}

.modal-overlay .modal-content {
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-overlay .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 85vh;
        border-radius: 24px 24px 0 0;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: white;
}

@media (max-width: 768px) {
    .modal-header {
        position: relative;
        padding-top: 24px;
    }
    .modal-header::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 4px;
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
}
