:root {
    /* Color Palette - University Theme (Deep Green & Gold) */
    --primary-color: #004d25;
    /* Deep Green */
    --primary-light: #006b33;
    --primary-dark: #003318;
    --accent-color: #d4af37;
    /* Gold */
    --accent-hover: #b5952f;

    /* Neutrals */
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;

    /* Status Colors */
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --info: #3498db;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-main: 'Inter', 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-light);
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 77, 37, 0.1);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
}

/* Login Page Specifics */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(0, 77, 37, 0.9), rgba(0, 0, 0, 0.8)), url('../../images/fudma3.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.university-logo {
    width: 100px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* --- Sidebar & Layout (Modernized) --- */

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: var(--primary-dark);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
    z-index: 999;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: var(--primary-color);
    text-align: center;
}

#sidebar ul.components {
    padding: 20px 0;
    border-bottom: 1px solid #47748b;
}

#sidebar ul p {
    color: #fff;
    padding: 10px;
}

#sidebar ul li a {
    padding: 10px 20px;
    font-size: 0.95rem;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-left: 3px solid transparent;
}

#sidebar ul li a:hover {
    color: #fff;
    background: var(--primary-light);
    border-left: 3px solid var(--accent-color);
}

#sidebar ul li.active>a,
a[aria-expanded="true"] {
    color: #fff;
    background: var(--primary-color);
    border-left: 3px solid var(--accent-color);
}

a[data-bs-toggle="collapse"] {
    position: relative;
}

.dropdown-toggle::after {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

#content {
    width: 100%;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

.navbar {
    padding: 15px 10px;
    background: #fff;
    border: none;
    border-radius: 0;
    margin-bottom: 40px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Mobile Responsiveness --- */

/* Desktop Behavior: Toggled class hides sidebar */
#sidebar.active {
    margin-left: -250px;
}

/* Mobile Behavior (Max Width 768px) */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        /* Hidden by default on mobile */
        position: fixed;
        /* Overlay on mobile */
        height: 100vh;
        overflow-y: auto;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    }

    #sidebar.active {
        margin-left: 0;
        /* Shown when active on mobile */
    }

    #content {
        width: 100%;
    }

    #sidebarCollapse span {
        display: none;
    }

    /* Overlay effect when sidebar is active on mobile */
    .overlay {
        display: none;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
        opacity: 0;
        transition: all 0.5s ease-in-out;
    }

    .overlay.active {
        display: block;
        opacity: 1;
    }
}