:root {
    --primary-color: #111827;
    --sidebar-gradient: linear-gradient(180deg, #0d0d0d 0%, #1a1a2e 100%);
    --secondary-color: #10b981;
    --accent-color: #3b82f6;
    --accent-vibrant: #60a5fa;
    --sidebar-bg: #111827;
    --sidebar-hover: rgba(255, 255, 255, 0.07);
    --sidebar-active-bg: rgba(96, 165, 250, 0.18);
    --light-bg: #f8fafc;
    --sidebar-width: 270px;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: #1e293b;
    font-size: 0.85rem;
    cursor: url('../img/custom_cursor.png'), auto;
}

body:active {
    cursor: url('../img/custom_cursor.png'), auto;
}

.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.login-card {
    width: 480px; /* Balanced width */
    max-width: 95vw;
    background: #ffffff;
    border: none;
    border-radius: 40px;
    padding: 3.5rem 2.8rem;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
    z-index: 10;
    margin: 20px;
}

.login-bg-accent-1 {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.login-bg-accent-2 {
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.login-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2b4c9b !important; /* Muted Navy */
    margin-bottom: 1.2rem;
    line-height: 1.2;
    padding: 0 10px;
}

/* Role Tabs - Light Clean Style */
.role-tabs {
    display: flex;
    background: #f8fafc;
    padding: 6px;
    border-radius: 18px;
    margin-bottom: 2.5rem;
    border: 1px solid #eef2f6;
}

.role-tab {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    cursor: pointer;
    border-radius: 14px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.role-tab i {
    font-size: 0.9rem;
    color: #94a3b8;
}

.role-tab:hover {
    color: #1e3a8a;
}

.role-tab.active {
    background: #ffffff !important;
    color: #1e3a8a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

.role-tab.active i {
    color: #1e3a8a;
}

.role-tab i {
    font-size: 1.1rem;
    color: #64748b;
}

.role-tab:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.role-tab.active {
    background: #4182f9; /* Match sign in button */
    color: #ffffff;
    border-color: #4182f9;
    box-shadow: 0 10px 20px -5px rgba(65, 130, 249, 0.4);
}

.role-tab.active i {
    color: #ffffff;
}

.login-body {
    text-align: left;
}

.login-body .form-label {
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.login-body .input-group {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc; /* Lighter shade */
    transition: all 0.2s;
}

.login-body .input-group:focus-within {
    border-color: #2b4c9b;
    box-shadow: 0 0 0 4px rgba(43, 76, 155, 0.1);
    background: #ffffff;
}

.login-body .input-group-text {
    background: transparent !important;
    border: none;
    padding-left: 1.25rem;
    color: #64748b;
}

.login-body .form-control {
    background: transparent !important;
    border: none;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    color: #1e293b;
}

.login-body .form-control:focus {
    box-shadow: none;
}

.btn-login {
    background: #4182f9; /* Vibrant Blue */
    border: none;
    border-radius: 12px;
    padding: 0.9rem;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 2rem;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-login:hover {
    background: #3273e8;
    box-shadow: 0 8px 20px rgba(65, 130, 249, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-footer a {
    color: #3b82f6;
    /* Blue links */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
    color: #2563eb;
}

.login-footer span {
    color: #64748b;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    background: var(--sidebar-gradient);
    color: #ffffff;
    transition: var(--transition-base);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    cursor: default;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
}

.sidebar:active {
    cursor: url('../img/custom_cursor.png'), auto;
}

/* Desktop Collapsed Sidebar State */
@media (min-width: 769px) {
    .sidebar.collapsed-desktop {
        width: 80px !important;
    }
    
    .sidebar.collapsed-desktop .system-name-badge,
    .sidebar.collapsed-desktop .school-name-display,
    .sidebar.collapsed-desktop .nav-link span,
    .sidebar.collapsed-desktop .submenu-arrow,
    .sidebar.collapsed-desktop .text-uppercase,
    .sidebar.collapsed-desktop .sidebar-search-wrapper {
        display: none !important;
    }

    .sidebar.collapsed-desktop .px-3.text-center.mt-4 h6 {
        display: none !important;
    }
    
    .sidebar.collapsed-desktop .nav-link i.me-2 {
        margin-right: 0 !important;
        font-size: 1.25rem;
        margin: 0 auto;
    }
    
    .sidebar.collapsed-desktop .nav-link {
        justify-content: center !important;
        padding: 0.75rem 0 !important;
    }
    
    .sidebar.collapsed-desktop .nav-item .collapse {
        display: none !important;
    }
    
    .sidebar.collapsed-desktop .badge {
        display: none !important;
    }
    
    .content-wrapper {
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Sidebar Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--primary-color);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-resizer {
    width: 6px;
    height: 100%;
    background: transparent;
    position: absolute;
    right: 0;
    top: 0;
    cursor: col-resize;
    z-index: 1010;
    transition: background 0.2s;
}

.sidebar-resizer:hover,
.sidebar-resizer.resizing {
    background: rgba(255, 255, 255, 0.1);
}

/* Expandable Search */
.sidebar-search-wrapper {
    margin: 0 1rem;
    padding-bottom: 1rem;
    transition: all 0.3s ease;
}

.search-box-container {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    height: 34px;
    width: 34px; /* Default collapsed */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
}

.search-box-container.expanded {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.search-box-container .search-icon {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.3s;
}

.search-box-container.expanded .search-icon {
    color: #ffffff;
}

.search-box-container input {
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 0.75rem;
    padding: 0 !important;
    margin: 0 !important;
    width: 0;
    opacity: 0;
    outline: none;
    box-shadow: none !important;
    transition: all 0.3s ease;
}

.search-box-container.expanded input {
    width: 100%;
    opacity: 1;
    padding: 0 10px 0 0 !important;
}

.sidebar .nav-link {
    color: #ffffff;
    padding: 0.7rem 1.5rem;
    font-weight: 500;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    border-left: 3px solid transparent;
    border-radius: 0 10px 10px 0;
    margin-right: 12px;
    font-size: 0.88rem;
    letter-spacing: 0.1px;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.08);
    color: #ffffff;
    padding-left: 1.65rem;
}

.sidebar .nav-link.active {
    background: rgba(147,197,253,0.18);
    color: #ffffff;
    border-left-color: var(--accent-vibrant);
    font-weight: 700;
}

/* Section labels */
.sidebar .text-muted {
    color: rgba(255,255,255,0.5) !important;
    letter-spacing: 0.12em;
    font-weight: 700 !important;
    font-size: 0.65rem !important;
    margin-top: 1.5rem !important;
    padding-left: 1.5rem !important;
    text-transform: uppercase;
}

.sidebar .nav-link i {
    width: 22px;
    min-width: 22px;
    font-size: 1rem;
    margin-right: 0.85rem;
    transition: var(--transition-base);
    color: #93c5fd;
    opacity: 0.85;
}

.sidebar .nav-link:hover i,
.sidebar .nav-link.active i {
    color: #fff;
    opacity: 1;
}

.submenu-arrow {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
    opacity: 0.5;
    color: rgba(255,255,255,0.5) !important;
}

.nav-link[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
    opacity: 0.9;
}

/* Sub-menu items */
.collapse .nav-link {
    padding-left: 3rem !important;
    font-size: 0.82rem;
    border-left: none;
    color: rgba(255,255,255,0.75) !important;
    border-radius: 0 8px 8px 0;
}

.collapse .nav-link:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
}

.collapse .nav-link.active {
    color: #ffffff !important;
    background: rgba(147,197,253,0.15) !important;
}

.content-wrapper {
    margin-left: var(--sidebar-width);
    padding: 0; /* Changed to 0 to allow full-width header */
    transition: margin-left 0.05s ease;
}

/* Premium Header Styles */
.premium-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.system-branding-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.system-name-badge {
    background: #1e293b;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.school-name-display {
    font-weight: 600;
    color: #64748b;
    font-size: 1.0rem;
}

.user-profile-premium {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 4px 14px;
    background: #f1f5f9;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    transition: var(--transition-base);
}

.user-profile-premium:hover {
    background: #e2e8f0;
}

/* Dashboard Welcome Hero */
.welcome-hero {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 16px;
    padding: 2.5rem;
    color: #ffffff;
    margin: 1.5rem 2rem 2rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.welcome-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.welcome-hero p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
    max-width: 600px;
}

.card {
    border-radius: 12px;
    border: none;
    box-shadow: var(--card-shadow);
}

.stat-card {
    padding: 1rem;
}

.stat-card h3 {
    font-weight: 700;
    margin-bottom: 0;
}

.stat-card .icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Mobile Responsive Layout Styles */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 995;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px !important; /* Fixed width on mobile */
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }

    .sidebar.toggled {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    .content-wrapper {
        margin-left: 0 !important;
    }

    .premium-header {
        padding: 0.75rem 1rem;
    }

    .welcome-hero {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 12px;
    }

    .welcome-hero h1 {
        font-size: 1.5rem;
    }

    .user-profile-premium {
        padding: 4px;
        background: transparent;
        border: none;
    }
}

/* Profile Dropdown */
.hide-arrow::after {
    display: none;
}

.dropdown-item {
    font-size: 0.85rem;
    font-weight: 500;
}

.dropdown-item:active {
    background-color: var(--accent-color);
}

.fs-xs {
    font-size: 0.75rem;
}