/* E-Learning Platform - Modern Design System */

/* ========================================
   GLOBAL BACK BUTTON OVERFLOW FIX
   Prevents back buttons from disappearing
   when subject names are long
   ======================================== */

/* Universal fix for headers with back buttons */
.subject-header,
.course-header,
.page-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem !important;
    min-height: 60px !important;
}

.subject-title,
.course-title,
.page-title {
    flex: 1 !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.back-button,
.back-link,
.btn-back {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    min-width: 80px !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .subject-header,
    .course-header,
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    
    .back-button,
    .back-link,
    .btn-back {
        width: 100% !important;
        text-align: center !important;
    }
}

/* CSS Custom Properties for ISU Green Design System */
:root {
    /* Primary Colors - ISU Green Palette */
    --primary-50: #f0f9f0;
    --primary-100: #dcf2dc;
    --primary-200: #b8e6b8;
    --primary-300: #8cd98c;
    --primary-400: #5cc85c;
    --primary-500: #2d7a2d;
    --primary-600: #1e5a1e;
    --primary-700: #154015;
    --primary-800: #0f2f0f;
    --primary-900: #0a1f0a;

    /* Secondary Colors - ISU Gold/Amber */
    --secondary-50: #fffbeb;
    --secondary-100: #fef3c7;
    --secondary-200: #fde68a;
    --secondary-300: #fcd34d;
    --secondary-400: #fbbf24;
    --secondary-500: #f59e0b;
    --secondary-600: #d97706;
    --secondary-700: #b45309;
    --secondary-800: #92400e;
    --secondary-900: #78350f;

    /* Neutral Colors - Professional Academic Gray Scale */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Academic Semantic Colors */
    --success-500: #059669;
    --success-600: #047857;
    --warning-500: #d97706;
    --warning-600: #b45309;
    --error-500: #dc2626;
    --error-600: #b91c1c;
    --info-500: #0ea5e9;
    --info-600: #0284c7;

    /* Typography */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Font Sizes - Modular Scale */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */

    /* Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;     /* 8px */
    --space-3: 0.75rem;    /* 12px */
    --space-4: 1rem;       /* 16px */
    --space-5: 1.25rem;    /* 20px */
    --space-6: 1.5rem;     /* 24px */
    --space-8: 2rem;        /* 32px */
    --space-10: 2.5rem;     /* 40px */
    --space-12: 3rem;      /* 48px */

    /* Border Radius */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--neutral-800);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Disable text selection on non-editable elements */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent dragging on navigation and interactive elements */
.nav-link, .btn, button, a {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection in input fields and textareas - ENHANCED FOR MOBILE */
input, textarea, select, [contenteditable="true"], 
input[type="text"], input[type="email"], input[type="password"], 
input[type="search"], input[type="url"], input[type="tel"], 
input[type="number"], input[type="date"], input[type="time"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
    pointer-events: auto !important;
}

/* Ensure input fields work on focus */
input:focus, textarea:focus, select:focus {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* Layout Components */
.container-fluid {
    width: 100%;
    min-height: auto;
    display: flex;
}

.row {
    display: flex;
    width: 100%;
    min-height: auto;
}

/* Dashboard Container with Fixed Sidebar */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.dashboard-container .main-content {
    margin-left: 300px;
    width: calc(100vw - 300px);
    max-width: calc(100% - 300px);
    flex: 1;
    background: #ffffff;
    min-height: 100vh;
    padding: 2rem;
    overflow-x: auto;
    position: relative;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Body fix for fixed sidebar */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Dark Green Sidebar Styles - Modern Teacher Design */
.sidebar {
    width: 300px;
    min-height: 100vh;
    background: #0a2f1c;
    border-right: 1px solid rgba(15, 47, 15, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: width 0.3s ease, transform 0.3s ease;
}

/* Sidebar collapsed state */
.sidebar.collapsed {
    width: 80px;
}

/* Main content adjustment when sidebar is collapsed */
.sidebar.collapsed + .main-content,
.sidebar.collapsed ~ .main-content {
    margin-left: 80px;
    width: calc(100vw - 80px);
    max-width: calc(100% - 80px);
}

/* Sidebar toggle button for desktop */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-600);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.sidebar-toggle:hover {
    background: var(--primary-700);
    transform: scale(1.05);
}

/* Show toggle button on desktop */
@media (min-width: 769px) {
    .sidebar-toggle {
        display: block;
    }
}

/* Ensure inner wrapper doesn't disable scroll (Bootstrap adds position-sticky) */
.sidebar .position-sticky {
    position: static !important;
    max-height: 100vh;
    overflow-y: auto;
}

.sidebar .text-center {
    background: #0f4d2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    margin: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


.sidebar .text-center i {
    color: #ffffff;
    font-size: 2.75rem;
    margin-bottom: 1rem;
    display: block;
    position: relative;
    z-index: 1;
}

.sidebar .text-center h5 {
    color: #ffffff;
    font-weight: 700;
    margin: 0.5rem 0;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

.sidebar .text-center p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Modern Navigation Styles */
.sidebar .nav {
    list-style: none;
    padding: 0 1.5rem;
    margin: 0;
    margin-top: 1rem;
}

.sidebar .nav-item {
    margin-bottom: 0.75rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: #0f1f05 !important;
    text-decoration: none;
    border-radius: var(--radius-lg);
    /* Removed transition that causes flickering */
    background: #ffffff !important;
    border: 1px solid rgba(229, 231, 235, 0.3) !important;
    /* Removed box-shadow that causes glitching */
    font-weight: 600;
    position: relative;
    font-size: var(--text-sm);
    letter-spacing: 0.025em;
}

.sidebar .nav-link::before {
    content: none !important;
}

.sidebar .nav-link/* Removed all hover effects */ {
    background-color: #ffffff !important;
    color: #0f1f05 !important;
    text-decoration: none;
    /* Removed all transforms */
    border-color: rgba(229, 231, 235, 0.5) !important;
    /* Removed box-shadow that causes glitching */
}

/* Removed hover effects that cause flickering */

.sidebar .nav-link.active {
    background: var(--primary-600) !important;
    color: #ffffff !important;
    text-decoration: none;
    border-color: rgba(30, 90, 30, 0.3) !important;
    /* Removed all transforms */
    outline: none !important;
    /* Removed box-shadow that causes glitching */
}

/* Pressed state: turn green while clicking */
.sidebar .nav-link:active,
.sidebar .nav-link:focus-visible {
    background: var(--primary-600) !important;
    color: #ffffff !important;
    border-color: var(--primary-600) !important;
    /* Removed box-shadow that causes glitching */
}

.sidebar .nav-link.active::before { content: none !important; }

.sidebar .nav-link.logout {
    background: #ffffff;
    color: #0f1f05;
    border-color: rgba(229, 231, 235, 0.3);
    margin-top: 1rem;
}

.sidebar .nav-link.logout/* Removed all hover effects */ {
    background: #f3f4f6 !important;
    color: #0f1f05 !important;
    border-color: rgba(229, 231, 235, 0.5) !important;
    /* Removed all transforms */
    /* Removed box-shadow that causes glitching */
}

.sidebar .nav-link i {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    /* Removed transition that causes flickering */
}

/* Removed hover effects that cause flickering */

/* All navigation items now have the same vibrant style */

/* Modern Notification Badge */
.notification-badge {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    border-radius: 50%;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-left: auto;
    min-width: 20px;
    min-height: 20px;
    text-align: center;
    /* Removed box-shadow that causes glitching */ 
        0 2px 8px rgba(30, 90, 30, 0.3),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    font-weight: 700;
    letter-spacing: 0.025em;
    /* Removed pulse animation */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    position: relative;
    z-index: 1;
}

/* Notification badge hover effect */
/* Removed hover effects that cause flickering */

/* Different notification badge colors for different types */
.notification-badge.tasks {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.notification-badge.announcements {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.notification-badge.quizzes {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.notification-badge.forum {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

/* Teacher-specific notification badge colors */
.notification-badge.exams {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.notification-badge.submissions {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Removed pulse animation that causes flickering */

/* Modern Main Content */
.main-content {
    flex: 1;
    background: #ffffff;
    min-height: 100vh;
    padding: 2rem;
    overflow-x: auto;
    position: relative;
    margin-left: 300px;
    width: calc(100vw - 300px);
    max-width: calc(100% - 300px);
    transition: margin-left 0.3s ease, width 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Content wrapper for all main content */
.main-content > * {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Main content with sidebar - ensure proper spacing */
.main-content.main-with-sidebar {
    margin-left: 300px;
    width: calc(100vw - 300px);
    max-width: calc(100% - 300px);
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Content wrapper for centering */
.main-content .content-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Student dashboard full-width overrides */
.dashboard-page .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}
.dashboard-page .main-content > * {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Fallback: apply full-width layout on all student pages that include the student top nav */
.student-top-nav ~ .dashboard-container .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}
.student-top-nav ~ .dashboard-container .main-content > * {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure content containers have proper width and centering */
.main-content .dashboard-header,
.main-content .summary-cards,
.main-content .quick-actions,
.main-content .announcement-card,
.main-content .dashboard-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Dashboard header centering */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 2rem auto;
}

/* Quick Actions Grid - ensure proper spacing and centering */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem auto;
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

/* Summary Cards Grid - ensure proper spacing and centering */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem auto;
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

/* Chip List - ensure proper spacing and centering */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem auto;
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

/* Announcement List - ensure proper spacing and centering */
.announcement-list {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.announcement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: #ffffff;
    border: 3px solid #14b8a6;
    border-radius: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.announcement-item:hover {
    border-color: #0d9488;
    border-width: 4px;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
}

.announcement-item:last-child {
    margin-bottom: 0;
}

/* Modern Dashboard Cards */
.dashboard-card {
    background: #ffffff;
    border: 1px solid rgba(15, 31, 5, 0.15);
    border-radius: 16px;
    /* Removed box-shadow that causes glitching */
        0 6px 20px rgba(15, 31, 5, 0.06),
        0 2px 6px rgba(15, 31, 5, 0.04);
    /* Removed transition that causes flickering */
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-600) 100%);
    /* Removed all transforms */
    /* Removed transition that causes flickering */
}

/* Removed hover effects that cause flickering */

/* Removed hover effects that cause flickering */

/* Modern Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--text-sm);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Removed transition that causes flickering */
    cursor: pointer;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    /* Removed box-shadow that causes glitching */
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Removed hover effects that cause flickering */

.btn-success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
    /* Removed box-shadow that causes glitching */
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Removed hover effects that cause flickering */

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-500) 0%, var(--secondary-600) 100%);
    color: white;
    /* Removed box-shadow that causes glitching */
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Removed hover effects that cause flickering */

.btn-outline {
    background: transparent;
    color: var(--primary-600);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Removed hover effects that cause flickering */

.card-header-custom {
    background: linear-gradient(135deg, #0f4d2e 0%, #0a2f1c 100%);
    color: white;
    border-bottom: none;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
}

/* Course Card: inner elements */
.dashboard-card .card-title {
    font-weight: 800;
    color: #0f1f05;
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
}

.dashboard-card .badge.code-badge {
    background: #f1f5f9;
    color: #0f1f05;
    border: 1px solid rgba(15, 31, 5, 0.1) !important;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}

.dashboard-card .copy-code.btn {
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    border-color: rgba(15, 31, 5, 0.12);
    color: #334155;
}

.dashboard-card .row.text-center .col-6 h6 {
    font-weight: 800;
    color: #0f1f05;
}

.dashboard-card .row.text-center small {
    color: #64748b;
}

.dashboard-card .d-grid.gap-2 .btn {
    border-radius: 12px;
}

.dashboard-card .btn-outline-primary.btn-sm {
    background: #ffffff;
    color: #1e5a1e;
    border-color: rgba(30, 90, 30, 0.35);
}

.dashboard-card .btn-outline-primary.btn-sm:hover {
    background: #1e5a1e;
    color: #ffffff;
}

.dashboard-card .card-footer {
    background: #f8fafc;
    color: #475569;
}

/* Download Syllabus Button - Blue Color */
.dashboard-card .btn-outline-secondary.btn-sm[href*="download_syllabus"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff !important;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.dashboard-card .btn-outline-secondary.btn-sm[href*="download_syllabus"]:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff !important;
    border: 1px solid rgba(37, 99, 235, 0.5);
}

.dashboard-card .btn-outline-secondary.btn-sm[href*="download_syllabus"] i {
    color: #ffffff !important;
}

/* Statistics Cards */
.border-left-primary {
    border-left: 4px solid #198754;
}

.border-left-success {
    border-left: 4px solid #198754;
}

/* === UI TWEAKS: more green accents, white background feel, smaller sizing === */
/* Make any primary (blue) badges use amber/yellow instead */
.badge.bg-primary,
.badge.text-bg-primary,
.badge-primary {
    background-color: #f59e0b !important; /* amber 500 */
    color: #0f1f05 !important;
    border-color: #d97706 !important; /* amber 600 */
}

/* Convert other blue-ish chips to amber as well */
.bg-info,
.badge.bg-info,
.text-bg-info {
    background-color: #fde68a !important; /* amber 200 */
    color: #7c2d12 !important;          /* amber 900 */
}

/* Emphasize green on hover outlines within dashboard cards */
.dashboard-card .btn-outline-primary.btn-sm {
    background: #ffffff;
    color: #1e5a1e;
    border-color: rgba(30, 90, 30, 0.35);
}
.dashboard-card .btn-outline-primary.btn-sm:hover {
    background: #1e5a1e;
    color: #ffffff;
}

/* Slightly smaller card typography and spacing */
.dashboard-card .card-title {
    font-size: 0.98rem;
}
.dashboard-card .row.text-center .col-6 h6 {
    font-size: 0.9rem;
}
.dashboard-card .row.text-center small {
    font-size: 0.75rem;
}
.dashboard-card .card-body {
    padding: 0.75rem 0.75rem;
}
.dashboard-card .d-grid.gap-2 .btn.btn-sm {
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

/* Make badges and copy button more compact */
.dashboard-card .badge.code-badge {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
}
.dashboard-card .copy-code.btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
}

/* Strengthen white background and green border hover for subject/course cards */
.dashboard-card {
    background: #ffffff;
    border-color: rgba(15, 31, 5, 0.15);
}
.dashboard-card:hover {
    border-color: rgba(30, 90, 30, 0.35);
}

/* Blue announcement badge → yellow */
.notification-badge.announcements {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.border-left-warning {
    border-left: 4px solid #ffc107;
}

.border-left-info {
    border-left: 4px solid #0dcaf0;
}

.border-left-secondary {
    border-left: 4px solid #6c757d;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    /* Removed transition that causes flickering */
    border: 1px solid transparent;
}

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

.btn-primary {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    border-color: #198754;
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    border-color: #198754;
}

.btn-outline-primary {
    color: #198754;
    border-color: #198754;
}

.btn-outline-primary/* Removed all hover effects */ {
    background: #198754;
    border-color: #198754;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    /* Removed transition that causes flickering */
}

.form-control:focus {
    border-color: #1e5a1e;
    /* Removed box-shadow that causes glitching */
}

.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.form-select:focus {
    border-color: #1e5a1e;
    /* Removed box-shadow that causes glitching */
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1e7dd 0%, #a3d9a4 100%);
    color: #0f5132;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
    color: #842029;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #664d03;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #b8daff 100%);
    color: #055160;
}

/* Tables */
.table {
    border-radius: 8px;
    overflow: hidden;
    /* Removed box-shadow that causes glitching */ 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.table th {
    background: #f8f9fa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr/* Removed all hover effects */ {
    background-color: rgba(25, 135, 84, 0.05);
}

/* Task Cards */
.task-card {
    border-left: 4px solid #198754;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Removed transition that causes flickering */
}

.task-card.quiz {
    border-left-color: #198754;
}

.task-card.assignment {
    border-left-color: #ffc107;
}

.task-card.activity {
    border-left-color: #dc3545;
}

/* Status Badges */
.status-pending {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #000;
}

.status-submitted {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
}

.status-graded {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    /* Removed transition that causes flickering */
    background: #f8f9fa;
}

.file-upload-area/* Removed all hover effects */ {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(25, 135, 84, 0.05);
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Removed box-shadow that causes glitching */ 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    /* Removed all animations */
}

/* Removed all animations */

/* Responsive Design */
/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .dashboard-container .main-content {
        margin-left: 280px;
        width: calc(100vw - 280px);
        max-width: calc(100% - 280px);
    }
    
    .sidebar {
        width: 280px;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        /* Sidebar always visible */
    }
    
    /* Sidebar always visible */
    
    .dashboard-container .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--primary-600);
        color: white;
        border: none;
        padding: 0.5rem;
        border-radius: 0.5rem;
        /* Removed box-shadow that causes glitching */
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 280px;
        min-height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: linear-gradient(180deg, #0a2f1c 0%, #0f4d2e 100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Sidebar overlay for mobile */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* Main content on mobile - no margin when sidebar is hidden */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.5rem;
        padding-top: 4rem;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* Mobile content wrapper */
    .main-content > * {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Ensure mobile content containers are properly sized */
    .main-content .dashboard-header,
    .main-content .summary-cards,
    .main-content .quick-actions,
    .main-content .announcement-card,
    .main-content .dashboard-section {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    /* Mobile grid adjustments */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 1.5rem 0;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .chip-list {
        gap: 0.5rem;
        margin: 1rem 0;
    }
    
    /* Mobile Toggle Button */
    .mobile-toggle-btn {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: linear-gradient(135deg, #1e5a1e 0%, #154015 100%);
        color: white;
        border: none;
        padding: 0.75rem;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-toggle-btn:hover {
        background: linear-gradient(135deg, #0f4d2e 0%, #0a2f1c 100%);
        /* Removed all transforms */
    }
    
    /* Removed mobile button animations */
    
    .dashboard-container .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        padding-top: 4rem; /* Space for mobile toggle button */
    }
    
    /* Mobile Navigation Links */
    .sidebar .nav-link {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
        margin-bottom: 0.5rem;
        border-radius: 8px;
        width: calc(100% - 2rem);
        margin-left: 1rem;
        margin-right: 1rem;
        background: rgba(255, 255, 255, 0.1);
        color: white;
        text-decoration: none;
        /* Removed transition that causes flickering */
        border: 1px solid rgba(255, 255, 255, 0.1);
        /* Removed box-shadow that causes glitching */ 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar .nav-link/* Removed all hover effects */ {
        background: rgba(255, 255, 255, 0.2);
        /* Removed all transforms */
        /* Removed box-shadow that causes glitching */ 0 4px 12px rgba(0, 0, 0, 0.2);
        color: white;
        text-decoration: none;
    }
    
    .sidebar .nav-link.active {
        background: linear-gradient(135deg, #2d7a2d 0%, #1e5a1e 100%);
        border-color: rgba(255, 255, 255, 0.3);
        /* Removed box-shadow that causes glitching */ 0 4px 16px rgba(45, 122, 45, 0.3);
        color: white;
    }
    
    .sidebar .nav-link i {
        margin-right: 1rem;
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
    }
    
    /* Mobile notification badge styling */
    .sidebar .nav-link .notification-badge {
        font-size: 0.7rem;
        min-width: 18px;
        min-height: 18px;
        padding: 0.2rem 0.4rem;
        margin-left: auto;
        margin-right: 0.5rem;
    }

    .sidebar .nav-link/* Removed all hover effects */ {
        background: rgba(255, 255, 255, 0.2);
        /* Removed all transforms */
        /* Removed box-shadow that causes glitching */ 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .sidebar .nav-link.active {
        background: linear-gradient(135deg, #2d7a2d 0%, #1e5a1e 100%);
        border-color: rgba(255, 255, 255, 0.3);
        /* Removed box-shadow that causes glitching */ 0 4px 16px rgba(45, 122, 45, 0.3);
    }

    .sidebar .nav-link i {
        margin-right: 1rem;
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
    }
    
    /* Mobile Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Mobile Tables */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Mobile Forms */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
        -webkit-touch-callout: default !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
    
    /* Mobile input field enhancements */
    input[type="text"], input[type="email"], input[type="password"], 
    input[type="search"], input[type="url"], input[type="tel"], 
    input[type="number"], input[type="date"], input[type="time"] {
        -webkit-user-select: text !important;
        -moz-user-select: text !important;
        -ms-user-select: text !important;
        user-select: text !important;
        -webkit-touch-callout: default !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1) !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Mobile Buttons */
    .btn {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 481px) {
    /* Extra small mobile adjustments */
    .dashboard-container .main-content {
        padding: 0.5rem;
        padding-top: 3rem;
    }
    
    .sidebar .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
        min-height: 38px;
    }
    
    /* Mobile Typography */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }
    h5 { font-size: 0.9rem; }
    h6 { font-size: 0.8rem; }
}
    
    .sidebar .text-center {
        padding: 1.5rem 1rem;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .sidebar .text-center h5 {
        font-size: 1.1rem;
    }
    
    .sidebar .text-center p {
        font-size: 0.85rem;
    }
    
    /* Mobile navigation sections */
    .sidebar .nav {
        padding: 0 1rem;
        margin-top: 0.5rem;
    }
    
    .sidebar .nav-item {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile-specific navigation improvements */
    .sidebar .nav-section {
        margin-bottom: 1.5rem;
    }
    
    .sidebar .nav-section-title {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--primary-200);
        margin-bottom: 0.75rem;
        padding: 0.5rem 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        border-left: 3px solid var(--primary-400);
    }
    
    /* Mobile hamburger menu button */
    .mobile-menu-btn {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--primary-600);
        color: white;
        border: none;
        padding: 0.75rem;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        transition: none;
        transform: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-menu-btn:active {
        background: var(--primary-700);
        transform: none;
        transition: none;
    }
    
    .mobile-menu-btn:focus {
        outline: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    /* Mobile header */
    .mobile-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #0a2f1c;
        color: white;
        padding: 1rem;
        z-index: 1001;
        /* Removed box-shadow that causes glitching */ 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-header .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .mobile-header h4 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        margin-left: 1rem;
    }
    
    /* Hide desktop sidebar toggle on mobile */
    .sidebar-toggle {
        display: none;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
        border: none;
        /* Removed box-shadow that causes glitching */ none;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .form-select {
        font-size: 16px;
        padding: 0.875rem;
        min-height: 44px;
    }
    
    /* Mobile-specific improvements */
    .mobile-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #0a2f1c;
        color: white;
        padding: 1rem;
        z-index: 1001;
        /* Removed box-shadow that causes glitching */
    }
    
    .mobile-header .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .mobile-header h4 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .mobile-menu-btn {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        padding: 0.5rem;
        border-radius: 8px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        transition: none;
        transform: none;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-menu-btn:active {
        background: rgba(255, 255, 255, 0.1);
        transform: none;
        transition: none;
    }
    
    .mobile-menu-btn:focus {
        outline: none;
    }
    
    /* Hide desktop sidebar toggle on mobile */
    .sidebar-toggle {
        display: none;
    }
    
    /* Mobile-specific card improvements */
    .card-header {
        padding: 1rem;
        border-bottom: 1px solid var(--neutral-200);
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 0.75rem 1rem;
        border-top: 1px solid var(--neutral-200);
    }
    
    /* Mobile table improvements */
    .table {
        font-size: 0.8rem;
        border: none;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .table th:first-child,
    .table td:first-child {
        max-width: 150px;
    }
    
    /* Mobile modal improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .dashboard-container .main-content {
        padding: 0.5rem;
        padding-top: 3.5rem;
    }
    
    .mobile-header {
        padding: 0.75rem;
    }
    
    .mobile-header h4 {
        font-size: 1rem;
    }
    
    .mobile-menu-btn {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.5rem;
        min-width: 40px;
        min-height: 40px;
    }
    
    .sidebar {
        width: 100%;
        min-height: 100vh;
    }
    
    .sidebar .text-center {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .sidebar .text-center h5 {
        font-size: 1rem;
    }
    
    .sidebar .text-center p {
        font-size: 0.8rem;
    }
    
    .sidebar .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-height: 48px;
        margin-bottom: 0.25rem;
        width: calc(100% - 1rem);
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .sidebar .nav {
        padding: 0 0.5rem;
    }
    
    .sidebar .nav-section-title {
        font-size: 0.7rem;
        padding: 0 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-height: 44px;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
        max-width: 100px;
    }
    
    .table th:first-child,
    .table td:first-child {
        max-width: 120px;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .form-control,
    .form-select {
        font-size: 16px;
        padding: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Mobile-First Improvements */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--primary-600);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    /* Removed box-shadow that causes glitching */
    /* Removed transition that causes flickering */
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
}

.sidebar-toggle/* Removed all hover effects */ {
    background: var(--primary-700);
    /* Removed all transforms */
}

.sidebar-toggle:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Mobile-specific utility classes */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-visible {
        display: block !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-mb-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .mobile-mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .mobile-p-2 {
        padding: 0.5rem !important;
    }
    
    .mobile-p-3 {
        padding: 1rem !important;
    }
    
    /* Mobile sidebar overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        /* Removed opacity that causes glitching */
        visibility: hidden;
        /* Removed transition that causes flickering */
    }
    
    .sidebar-overlay.show {
        /* Removed opacity that causes glitching */
        visibility: visible;
    }
    
    /* Mobile sidebar improvements */
    .sidebar.mobile-sidebar {
        width: 100% !important;
        height: 100vh !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1000 !important;
        /* Removed all transforms */
        transition: transform 0.3s ease !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        background: #0a2f1c !important;
        /* Removed box-shadow that causes glitching */ 2px 0 10px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Sidebar always visible */
    
    /* Mobile navigation link improvements */
    .sidebar.mobile-sidebar .nav-link {
        width: calc(100% - 2rem) !important;
        margin-left: 1rem !important;
        margin-right: 1rem !important;
        margin-bottom: 0.5rem !important;
        padding: 1rem 1.25rem !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        touch-action: manipulation !important;
        border-radius: 8px !important;
    }
    
    /* Mobile profile section */
    .sidebar.mobile-sidebar .text-center {
        padding: 1.5rem 1rem !important;
        margin: 1rem !important;
        border-radius: 12px !important;
    }
    
    /* Mobile navigation sections */
    .sidebar.mobile-sidebar .nav {
        padding: 0 1rem !important;
        margin-top: 0.5rem !important;
    }
    
    .sidebar.mobile-sidebar .nav-item {
        margin-bottom: 0.5rem !important;
    }
    
    .sidebar.mobile-sidebar .nav-section {
        margin-bottom: 1.5rem !important;
    }
    
    .sidebar.mobile-sidebar .nav-section-title {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: var(--primary-200) !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 6px !important;
        border-left: 3px solid var(--primary-400) !important;
        padding: 0.5rem 1rem !important;
        margin-bottom: 0.75rem !important;
    }
}

/* Mobile-specific grid improvements */
@media (max-width: 768px) {
    .row {
        margin: 0;
    }
    
    .col-md-6,
    .col-md-4,
    .col-md-3,
    .col-lg-6,
    .col-lg-4,
    .col-lg-3 {
        width: 100%;
        padding: 0.5rem;
    }
    
    .col-sm-6 {
        width: 50%;
        padding: 0.25rem;
    }
}

/* Mobile-specific button groups */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Mobile-specific form improvements */
@media (max-width: 768px) {
    .form-row {
        display: flex;
        flex-direction: column;
    }
    
    .form-row .col {
        width: 100%;
        padding: 0.25rem;
    }
    
    .input-group {
        display: flex;
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    .input-group .input-group-text {
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* iOS recommended touch target size */
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .sidebar-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* Mobile-specific table improvements */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
        /* Removed box-shadow that causes glitching */ none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .table th:first-child,
    .table td:first-child {
        max-width: 200px;
    }
}

/* Mobile form improvements */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile card improvements */
@media (max-width: 768px) {
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-footer {
        padding: 0.75rem 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
}

/* Card Border Styles */
.card {
    border: 2px solid #000000 !important;
}

.card-body, .card-header, .card-footer {
    border: none !important;
}

.alert {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.badge {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.navbar, .navbar-nav, .navbar-brand {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.dropdown-menu {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.list-group-item {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.pagination .page-link {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.text-primary { color: #198754; }
.text-success { color: #198754; }
.text-warning { color: #ffc107; }
.text-danger { color: #dc3545; }
.text-info { color: #0dcaf0; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* Removed flickering animations */

/* Focus States for Accessibility */
.sidebar .nav-link:focus,
.sidebar .nav-link:focus-visible,
.sidebar .nav-link:active {
    outline: none !important;
    /* Removed box-shadow that causes glitching */ 0 0 0 6px rgba(25, 135, 84, 0.35);
}

.btn:focus {
    outline: 2px solid #198754;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
.sidebar .nav-link {
        border: 2px solid #495057;
    }
    
.sidebar .nav-link.active {
        border: 2px solid #198754;
    }
}

/* Timer Styles */
.timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    /* Removed box-shadow that causes glitching */ 0 4px 12px rgba(220, 38, 38, 0.3);
    font-size: 1.25rem;
    font-weight: 700;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 120px;
    justify-content: center;
    /* Removed transition that causes flickering */
}

.timer i {
    font-size: 1.1rem;
}

.timer.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    /* Removed box-shadow that causes glitching */ 0 4px 12px rgba(245, 158, 11, 0.3);
}

.timer.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    /* Removed box-shadow that causes glitching */ 0 4px 12px rgba(239, 68, 68, 0.3);
}

.timer.critical {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    /* Removed box-shadow that causes glitching */ 0 4px 12px rgba(220, 38, 38, 0.4);
    /* Removed pulse animation */
}

/* Removed all animations */

/* Removed pulse animation that causes flickering */

/* Mobile Timer Styles */
@media (max-width: 768px) {
    .timer {
        position: fixed;
        top: 10px;
        right: 10px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-width: 100px;
        border-radius: 8px;
    }
    
    .timer i {
        font-size: 0.9rem;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .timer.critical {
        /* Removed all animations */
    }
}
/* ========================================
   RESPONSIVE LAYOUT OVERRIDES
   Preserve desktop layout ≥1440px while
   allowing flexible, non-overlapping
   layouts on tablets and mobile.
   ======================================== */

@media (max-width: 1024px) {
    html, body {
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }

    .container,
    .container-fluid,
    .content-area,
    .dashboard-container,
    .row {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column;
        gap: 1rem;
    }

    /* Sidebar stacks above content and spans full width */
    .sidebar {
        position: relative;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        height: auto;
        margin: 0;
        transform: none !important;
    }

    .sidebar .nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sidebar .nav-link {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 220px;
    }

    /* Main content fills width when sidebar stacks */
    .main-content,
    .main-content.main-with-sidebar {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 1.5rem;
    }

    .page-header,
    .dashboard-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .card,
    .content-card,
    .card-grid,
    .summary-cards,
    .quick-actions {
        width: 100%;
        max-width: 100%;
    }

    /* Tables remain scrollable without breaking layout */
    .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .sidebar .nav-link {
        flex: 1 1 100%;
        min-width: 0;
    }

    .sidebar .text-center {
        padding: 1.25rem 1rem;
        margin: 1rem;
    }

    .main-content,
    .main-content.main-with-sidebar {
        padding: 1.25rem;
    }

    .page-header,
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions,
    .header-actions-enhanced {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .btn-header,
    .btn-header-enhanced,
    .sidebar-toggle {
        width: 100%;
        justify-content: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .content-card,
    .quick-action-card,
    .summary-card-enhanced {
        padding: 1.25rem;
    }

    img,
    .card-icon {
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }
}

@media (max-width: 480px) {
    .page-header h1,
    .dashboard-title {
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .sidebar .nav-link {
        padding: 0.9rem 1rem;
    }

    .main-content,
    .main-content.main-with-sidebar {
        padding: 1rem;
    }

    .content-card {
        gap: 0.75rem;
    }
}
