/* ==========================================================================
   CampusSync – Professional ERP Design System
   Color Palette:
     Primary   #2563EB  (Blue)
     Secondary #0F172A  (Dark Slate)
     Accent    #06B6D4  (Cyan)
     BG        #F1F5F9
     Card      #FFFFFF
     Border    #E2E8F0
     Success   #10B981
   ========================================================================== */

/* ---- Variables ---- */
:root {
    --primary:        #2563EB;
    --primary-dark:   #1D4ED8;
    --secondary:      #0F172A;
    --accent:         #06B6D4;
    --success:        #10B981;
    --warning:        #F59E0B;
    --danger:         #EF4444;
    --bg:             #F1F5F9;
    --card:           #FFFFFF;
    --border:         #E2E8F0;
    --text:           #1E293B;
    --text-muted:     #64748B;
    --sidebar-w:      260px;
    --topbar-h:       64px;
    --radius:         8px;
    --radius-lg:      12px;
    --shadow:         0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md:      0 4px 12px rgba(15,23,42,.08);
    --transition:     0.18s ease;
}

/* ---- Reset / Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.55;
    overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 {
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: -0.01em;
    margin-bottom: .5rem;
}

a { color: var(--primary); }

/* ============================================================
   HEADER / NAVBAR  (index page)
   ============================================================ */
.cs-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--secondary);
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.cs-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.cs-navbar .navbar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

.cs-navbar .brand-tag {
    font-size: 0.65rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 20px;
    background: rgba(37,99,235,.25);
    color: #93c5fd;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cs-navbar .nav-link {
    color: #cbd5e1 !important;
    font-weight: 500;
    font-size: .875rem;
    padding: .45rem .8rem !important;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
}
.cs-navbar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.08); }

.cs-navbar .btn-nav-student {
    font-size: .825rem;
    font-weight: 600;
    padding: .42rem 1rem;
    border-radius: var(--radius);
    border: 1.5px solid #3b82f6;
    color: #93c5fd;
    background: transparent;
    transition: background var(--transition), color var(--transition);
}
.cs-navbar .btn-nav-student:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

.cs-navbar .btn-nav-faculty {
    font-size: .825rem;
    font-weight: 600;
    padding: .42rem 1rem;
    border-radius: var(--radius);
    border: 1.5px solid #34d399;
    color: #6ee7b7;
    background: transparent;
    transition: background var(--transition), color var(--transition);
}
.cs-navbar .btn-nav-faculty:hover { background: #10b981; color: #fff; border-color: #10b981; }

.cs-navbar .btn-nav-admin {
    font-size: .825rem;
    font-weight: 700;
    padding: .42rem 1.1rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    border: none;
    transition: background var(--transition);
}
.cs-navbar .btn-nav-admin:hover { background: var(--primary-dark); color: #fff; }

.cs-navbar .btn-nav-alumni {
    font-size: .825rem;
    font-weight: 600;
    padding: .42rem 1rem;
    border-radius: var(--radius);
    border: 1.5px solid #f59e0b;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.1);
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}
.cs-navbar .btn-nav-alumni:hover { background: #d97706; color: #fff; border-color: #d97706; }

/* Main Login Button in Header */
.cs-navbar .btn-nav-login {
    font-size: .825rem;
    font-weight: 700;
    padding: .42rem 1.15rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.cs-navbar .btn-nav-login:hover,
.cs-navbar .btn-nav-login:focus,
.cs-navbar .btn-nav-login.show {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}
.cs-navbar .btn-nav-login::after {
    margin-left: 0.35rem;
    vertical-align: 0.15em;
    transition: transform 0.2s ease;
}
.cs-navbar .btn-nav-login.show::after {
    transform: rotate(180deg);
}

/* Login Dropdown Menu */
.cs-login-dropdown {
    min-width: 295px;
    padding: 0.55rem;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 12px;
    box-shadow: 0 12px 30px -5px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(0, 0, 0, 0.04);
    animation: csDropdownFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1060;
}
@keyframes csDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.cs-login-dropdown .dropdown-header {
    margin-bottom: 0.25rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f1f5f9;
}
.cs-login-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 9px;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    margin-bottom: 0.2rem;
    color: inherit;
    border: 1px solid transparent;
}
.cs-login-item:last-child {
    margin-bottom: 0;
}
.cs-login-item:hover,
.cs-login-item:focus {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    transform: translateX(3px);
}
.cs-login-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.cs-login-item:hover .cs-login-item-icon {
    transform: scale(1.06);
}
.cs-login-item-icon.student {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}
.cs-login-item-icon.faculty {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.cs-login-item-icon.admin {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}
.cs-login-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
}
.cs-login-item-desc {
    font-size: 0.71rem;
    color: #64748b;
    line-height: 1.2;
    margin-top: 2px;
}
.cs-login-item-arrow {
    font-size: 0.72rem;
    color: #94a3b8;
    transition: transform 0.15s ease, color 0.15s ease;
}
.cs-login-item:hover .cs-login-item-arrow {
    transform: translateX(2px);
    color: #2563eb;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.cs-hero {
    background: var(--secondary);
    color: #fff;
    padding: 5rem 0 4rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.cs-hero h1 {
    color: #fff;
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
}
.cs-hero p { color: #94a3b8; font-size: 1.05rem; }
.cs-hero .hero-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(37,99,235,.18);
    color: #93c5fd;
    font-size: .8rem;
    font-weight: 600;
    padding: .3rem .9rem;
    border-radius: 20px;
    border: 1px solid rgba(37,99,235,.35);
    margin-bottom: 1.25rem;
}

/* ============================================================
   BUTTONS (global)
   ============================================================ */
.btn {
    font-weight: 600;
    font-size: .875rem;
    border-radius: var(--radius);
    padding: .55rem 1.25rem;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }
.btn-dark { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.btn-dark:hover { background: #1e293b; border-color: #1e293b; color: #fff; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border); background: transparent; }
.btn-outline-secondary:hover { background: #f1f5f9; color: var(--text); }
.btn-sm { font-size: .8rem; padding: .38rem .9rem; }
.btn-lg { font-size: .975rem; padding: .7rem 1.6rem; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: .9rem 1.25rem;
    font-weight: 600;
    font-size: .9rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 1.25rem; }
.card-footer { background: var(--card); border-top: 1px solid var(--border); padding: .75rem 1.25rem; }

/* Portal info card (index page) */
.portal-card {
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
    background: var(--card);
    padding: 2rem 1.5rem;
    height: 100%;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.portal-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

/* Feature box */
.feature-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    text-align: center;
    height: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.feature-box:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.feature-box .feature-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card { display: flex; align-items: center; gap: 1rem; }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
}
.icon-bg-primary { background: #eff6ff; color: var(--primary); }
.icon-bg-success { background: #ecfdf5; color: var(--success); }
.icon-bg-warning { background: #fffbeb; color: var(--warning); }
.icon-bg-info    { background: #ecfeff; color: var(--accent); }

.stat-details h6 {
    margin: 0;
    font-size: .72rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--text-muted);
}
.stat-details h3 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--secondary);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    max-width: var(--sidebar-w);
    flex-shrink: 0;
    height: 100vh;
    background: var(--secondary);
    border-right: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Desktop Sticky & Collapsed State */
@media (min-width: 992px) {
    #sidebar {
        position: sticky;
        top: 0;
        transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #sidebar.collapsed {
        margin-left: calc(var(--sidebar-w) * -1);
    }
}

/* Mobile Off-canvas State (GPU-Accelerated 60fps Drawer) */
@media (max-width: 991.98px) {
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        margin-left: 0 !important;
        z-index: 99999 !important;
        transform: translate3d(-100%, 0, 0) !important;
        -webkit-transform: translate3d(-100%, 0, 0) !important;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease !important;
        -webkit-transition: -webkit-transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease !important;
        will-change: transform;
        box-shadow: none !important;
        pointer-events: none;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain;
    }
    #sidebar.active {
        transform: translate3d(0, 0, 0) !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        box-shadow: 12px 0 45px rgba(0, 0, 0, 0.65) !important;
        pointer-events: auto !important;
    }
}

.sidebar-header {
    height: var(--topbar-h);
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}
.sidebar-header .brand-logo { color: var(--primary); font-size: 1.35rem; }
.sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -.01em;
}

#sidebar ul.components {
    padding: 1rem .75rem;
    list-style: none;
    margin: 0;
    flex: 1;
}

#sidebar ul.components li a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .62rem .9rem;
    border-radius: var(--radius);
    color: #94a3b8;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    margin-bottom: .18rem;
}
#sidebar ul.components li a i { font-size: 1.05rem; flex-shrink: 0; }
#sidebar ul.components li a:hover { background: rgba(255,255,255,.07); color: #f1f5f9; }
#sidebar ul.components li.active > a {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* Sidebar Grouping & Collapsible Submenus */
.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.85rem 0.9rem 0.25rem;
    list-style: none;
    user-select: none;
}

#sidebar ul.components li.sidebar-parent > a {
    color: #94a3b8;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}
#sidebar ul.components li.sidebar-parent > a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #f1f5f9;
}
#sidebar ul.components li.sidebar-parent.open > a,
#sidebar ul.components li.sidebar-parent > a[aria-expanded="true"] {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-submenu-arrow {
    font-size: 0.72rem;
    transition: transform 0.25s ease;
    opacity: 0.65;
}
#sidebar ul.components li.sidebar-parent.open > a .sidebar-submenu-arrow,
#sidebar ul.components li.sidebar-parent > a[aria-expanded="true"] .sidebar-submenu-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.sidebar-submenu {
    padding: 3px 0 5px 0 !important;
    margin: 0 0 4px 0 !important;
    border-left: 2px solid rgba(59, 130, 246, 0.35);
    margin-left: 1.35rem !important;
}

.sidebar-submenu li a {
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    padding: 0.44rem 0.8rem !important;
    border-radius: 6px !important;
    color: #94a3b8 !important;
    font-size: 0.83rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    margin-bottom: 2px !important;
}
.sidebar-submenu li a i {
    font-size: 0.92rem;
    flex-shrink: 0;
}
.sidebar-submenu li a:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #f1f5f9 !important;
    padding-left: 0.95rem !important;
}
.sidebar-submenu li.active > a {
    background: var(--primary, #2563eb) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* Mobile sidebar backdrop */
.sidebar-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.68) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 99990 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.26s ease !important;
    touch-action: manipulation;
}
.sidebar-backdrop.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Prevent body scrolling when mobile drawer is open */
body.sidebar-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Mobile sidebar header close button */
#sidebarCloseBtn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
#sidebarCloseBtn:hover,
#sidebarCloseBtn:active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: scale(0.96);
}

/* Topbar hamburger toggle button with generous touch target */
#sidebarCollapse {
    min-width: 42px;
    min-height: 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: var(--radius);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
#sidebarCollapse:active {
    transform: scale(0.93);
}

/* ============================================================
   MAIN CONTENT / TOPBAR
   ============================================================ */
.wrapper { display: flex; width: 100%; align-items: stretch; }

#content { flex: 1; min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 990;
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.topbar-brand { font-size: .8rem; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
}
.topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.content-body { padding: 1.75rem; flex: 1; }

/* Page header inside portal */
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: .15rem; }
.page-header p  { color: var(--text-muted); font-size: .875rem; margin: 0; }

/* ============================================================
   TABLES
   ============================================================ */
.table { width: 100%; margin: 0; border-collapse: collapse; }
.table thead th {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    padding: .75rem 1rem;
    border-bottom: 1.5px solid var(--border);
    background: #f8fafc;
    white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid #f1f5f9; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody td { padding: .85rem 1rem; font-size: .875rem; color: var(--text); vertical-align: middle; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-size: .72rem;
    font-weight: 600;
    padding: .3em .75em;
    border-radius: 20px;
    letter-spacing: .02em;
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .875rem;
    padding: .5rem .85rem;
    color: var(--text);
    background: var(--card);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    outline: none;
}
.form-label { font-size: .8rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }

/* Input group */
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; }

/* Radio / Checkbox */
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus   { box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* ============================================================
   FOOTER
   ============================================================ */
footer.cs-footer {
    background: radial-gradient(120% 120% at 50% -10%, #1e293b 0%, #0f172a 45%, #080d1a 100%);
    color: #94a3b8;
    position: relative;
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

footer.cs-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2563eb, #06b6d4, #8b5cf6, transparent);
    opacity: 0.85;
}

.cs-footer-ambient-orb {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 220px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(6, 182, 212, 0.03) 50%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.cs-footer-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.footer-brand-title {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    margin: 0;
}

.footer-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.35);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: #ffffff;
    padding: 2px;
    object-fit: contain;
}

footer.cs-footer .footer-desc {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.65;
}

.cs-footer-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
    color: #34d399;
    font-size: 0.775rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
}

.cs-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.footer-heading {
    color: #f8fafc;
    font-size: 0.925rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-heading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.footer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link-list li {
    margin-bottom: 0.6rem;
}

.footer-nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.footer-nav-link i {
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s ease, color 0.2s ease;
}

.footer-nav-link:hover {
    color: #ffffff;
    transform: translateX(4px);
}

.footer-nav-link:hover i {
    color: var(--accent);
    transform: translateX(2px);
}

.social-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.social-icon-btn:hover {
    transform: translateY(-3px);
    color: #ffffff;
}

.social-icon-btn.social-linkedin:hover {
    background: #0a66c2;
    border-color: #0a66c2;
    box-shadow: 0 4px 15px rgba(10, 102, 194, 0.45);
}

.social-icon-btn.social-github:hover {
    background: #24292e;
    border-color: #475569;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.social-icon-btn.social-twitter:hover {
    background: #000000;
    border-color: #38bdf8;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.social-icon-btn.social-facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.45);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.865rem;
    color: #94a3b8;
    margin-bottom: 0.85rem;
}

.footer-contact-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.footer-contact-item a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact-item a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.cs-footer-dev-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1.1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.cs-footer-dev-card:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.cs-dev-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cs-dev-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(37, 99, 235, 0.35);
}

.cs-dev-chip small {
    color: #94a3b8 !important;
}

.cs-dev-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.72rem;
    color: #ffffff;
    flex-shrink: 0;
}

.cs-dev-avatar.devid {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.cs-dev-avatar.akash {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.cs-footer-cert-badge {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: #a7f3d0;
    font-size: 0.775rem;
}

.cs-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
    font-size: 0.825rem;
    color: #94a3b8;
}

.cs-footer-bottom a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cs-footer-bottom a:hover {
    color: #ffffff;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
    z-index: 1050;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.55);
    color: #fff;
}

/* ============================================================
   STATS SECTION (index)
   ============================================================ */
.cs-stats { background: #0a1628; padding: 4rem 0; }
.cs-stats .stat-num { font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; }
.cs-stats .stat-label { color: #64748b; font-size: .875rem; margin-top: .15rem; }

/* ============================================================
   RESPONSIVE DESIGN SYSTEM (Butter-Smooth on all Phones & Tablets)
   ============================================================ */

/* Tablet & Mobile Layout Foundation */
@media (max-width: 991.98px) {
    #content {
        width: 100%;
        min-width: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .wrapper {
        width: 100%;
        min-width: 0;
    }
}

/* Medium Tablets & Large Phones */
@media (max-width: 767.98px) {
    .cs-hero h1 { font-size: 1.85rem; }
    .content-body { padding: 1rem 0.85rem; }

    /* Page Header Flex Stacking */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
        margin-bottom: 1.15rem;
    }
    .page-header h2 {
        font-size: 1.25rem;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.4rem;
    }
    .page-header p {
        font-size: 0.82rem;
    }
    .page-header > div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }

    /* iOS auto-zoom prevention: inputs must be 16px minimum on touch */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    /* Touch-friendly buttons on mobile */
    .btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    .btn-sm {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Smooth Momentum Table Scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        margin-bottom: 0.85rem;
        border-radius: var(--radius);
        border: 1px solid var(--border);
    }
    .table thead th {
        padding: 0.6rem 0.75rem;
        font-size: 0.68rem;
    }
    .table tbody td {
        padding: 0.65rem 0.75rem;
        font-size: 0.825rem;
    }
}

/* Small Phones (< 576px, e.g. iPhone SE, Galaxy A, Pixel) */
@media (max-width: 575.98px) {
    /* Topbar Mobile Optimization */
    .topbar {
        height: 56px;
        padding: 0 0.65rem;
    }
    .college-logo-wrapper {
        display: none !important;
    }
    .topbar-brand {
        max-width: 125px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar-brand .badge {
        font-size: 0.68rem;
        padding: 0.22rem 0.5rem;
    }
    .topbar-user span {
        display: none !important;
    }
    .topbar-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    .topbar-right {
        gap: 0.35rem;
    }

    /* Content Body Padding */
    .content-body {
        padding: 0.75rem 0.55rem;
    }

    /* Card Scaling */
    .card {
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }
    .card-body {
        padding: 0.85rem;
    }
    .card-header {
        padding: 0.7rem 0.85rem;
    }

    /* Stat Cards Grid on Mobile */
    .stat-card {
        padding: 0.85rem 0.75rem;
        gap: 0.75rem;
    }
    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
        border-radius: 9px;
    }
    .stat-details h3 {
        font-size: 1.35rem;
    }
    .stat-details p {
        font-size: 0.68rem;
    }

    /* Modals on Small Viewports */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    .modal-content {
        border-radius: 12px;
    }
    .modal-header {
        padding: 0.85rem 1rem;
    }
    .modal-body {
        padding: 0.9rem 1rem;
    }
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column-reverse;
        gap: 0.4rem;
    }
    .modal-footer > * {
        width: 100%;
        margin: 0 !important;
    }

    /* Flash Alerts on Small Phones */
    .flash-container {
        margin-bottom: 0.75rem;
    }
    .flash-card {
        padding: 0.75rem 0.85rem;
        border-radius: 10px;
    }
    .flash-title {
        font-size: 0.88rem;
    }
    .flash-message {
        font-size: 0.82rem;
    }
}

/* Extra Small Devices (<= 375px) */
@media (max-width: 375px) {
    .topbar {
        padding: 0 0.5rem;
    }
    #sidebarCollapse {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }
    .topbar-brand {
        display: none !important;
    }
}

/* ============================================================
   REUSABLE FLASH ALERTS SYSTEM
   ============================================================ */
.flash-container {
    position: relative;
    width: 100%;
    z-index: 1060;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flash-card {
    position: relative;
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
.flash-card.flash-enter {
    animation: flashSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.flash-card.flash-exit {
    animation: flashSlideUp 0.3s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes flashSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flashSlideUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 200px;
        margin-bottom: 0.75rem;
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }
    100% {
        opacity: 0;
        transform: translateY(-12px) scale(0.97);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* Flash Types Styling */
.flash-card.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.flash-card.alert-success .flash-icon {
    color: #16a34a;
    font-size: 1.35rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.flash-card.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.flash-card.alert-danger .flash-icon {
    color: #dc2626;
    font-size: 1.35rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.flash-card.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.flash-card.alert-warning .flash-icon {
    color: #d97706;
    font-size: 1.35rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.flash-card.alert-info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.flash-card.alert-info .flash-icon {
    color: #2563eb;
    font-size: 1.35rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.flash-content {
    flex: 1;
}

.flash-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.flash-message {
    font-size: 0.875rem;
    line-height: 1.45;
    opacity: 0.95;
}

.flash-details {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
    font-size: 0.825rem;
}

.flash-details ul {
    margin: 0.25rem 0 0 0;
    padding-left: 1.1rem;
}

.flash-close {
    background: transparent;
    border: none;
    padding: 0.2rem 0.4rem;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease, background 0.15s ease;
    color: inherit;
    border-radius: 4px;
}

.flash-close:hover {
    opacity: 0.95;
    background: rgba(0, 0, 0, 0.06);
}

