:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --error-color: #ef4444;
    --indigo-primary: #6366f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-dark);
    min-height: 100vh;
}

.dashboard-body {
    display: flex;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    height: 100vh;
    background: #111827;
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    height: 64px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--card-border);
}

.brand-logo {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.brand-name {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.75rem;
    overflow-y: auto;
}

.nav-group {
    margin-top: 1.5rem;
}

.nav-group-title {
    padding: 0 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

.material-symbols-outlined {
    font-size: 1.25rem;
}

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

.version-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-align: center;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 18px;
    right: -14px;
    width: 28px;
    height: 28px;
    background: #1e293b;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 101;
    transition: all 0.2s;
    padding: 0;
}
.sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.sidebar-toggle .material-symbols-outlined {
    font-size: 1rem;
    transition: transform 0.3s;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 64px;
}
.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .version-badge {
    display: none;
}
.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.625rem;
}
.sidebar.collapsed .nav-item .material-symbols-outlined {
    margin: 0;
}
.sidebar.collapsed .sidebar-toggle .material-symbols-outlined {
    transform: rotate(180deg);
}
.sidebar.collapsed ~ .main-wrapper {
    margin-left: 64px;
}

/* Sidebar & Main Transitions */
.sidebar {
    transition: width 0.3s ease;
}

/* Main Wrapper & Topbar */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 64px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 12px;
    transition: background 0.2s;
    position: relative;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.topbar-logout-btn {
    margin-left: 1rem;
    color: #fca5a5;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.topbar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: -1;
    filter: brightness(0.8) contrast(1.1);
    transition: filter 0.5s ease;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.error-msg {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    text-align: center;
}

.version-info {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.05em;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
}

/* Class List Table Helper Classes */
.class-id-cell {
    padding: 1.5rem !important;
    color: var(--text-secondary) !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.9rem !important;
}

.class-name-cell {
    padding: 1.5rem !important;
}

.class-name-text {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    letter-spacing: -0.01em !important;
}

.reg-dt-cell {
    padding: 1.5rem !important;
    color: var(--text-secondary) !important;
    font-size: 0.9rem !important;
    text-align: center !important;
}