/* =========================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   HEADER & NAVIGATION
   ========================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #004080; /* Primary Brand Blue */
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header-title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
}

.welcome-text {
    font-size: 1rem;
    margin-top: 4px;
    opacity: 0.9;
}

.header-right {
    text-align: right;
    font-weight: 500;
    font-size: 1rem;
    color: white;
    min-width: 170px;
}

.current-session {
    font-weight: 600;
    margin-bottom: 4px;
}

.session-switcher {
    font-weight: normal;
    font-size: 0.9rem;
}

.session-switcher label {
    margin-right: 5px;
    cursor: pointer;
}

.session-switcher select {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    cursor: pointer;
    background-color: #003366;
    color: white;
    appearance: none;
}

.session-switcher select:hover,
.session-switcher select:focus {
    background-color: #00509e;
    outline: none;
}

nav.main-navigation {
    background-color: #003366;
    padding: 12px 30px;
    text-align: left;
}

nav.main-navigation a {
    color: #c1d1ff;
    margin-right: 25px;
    font-weight: 600;
    text-decoration: none;
    padding: 5px 0;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

nav.main-navigation a:hover {
    color: #ffffff;
    border-bottom: 2px solid #ffffff;
    background-color: transparent;
}

/* =========================================
   PAGE LAYOUT & SIDEBAR
   ========================================= */
.page-wrapper {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar Container */
aside {
    width: 260px;
    background-color: #34495e;
    color: #ecf0f1;
    padding: 20px 0;
    flex-shrink: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #ecf0f1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    padding: 12px 25px;
    white-space: normal;
    border-left: 4px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    color: #ffffff;
    font-weight: 600;
    background-color: #4a69bd;
    border-left: 4px solid #3498db;
}

/* Sidebar Icons */
.sidebar-menu li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Submenu Logic */
.sidebar-menu .has-submenu > a {
    cursor: pointer;
    user-select: none;
    justify-content: space-between;
}

.sidebar-menu .toggle-icon {
    font-weight: bold;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.sidebar-menu .submenu {
    display: none;
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    background-color: #2c3e50;
}

.sidebar-menu .submenu li a {
    font-size: 0.9rem;
    font-weight: 400;
    color: #bdc3c7;
    padding-left: 55px;
    border-left: 0;
}

.sidebar-menu .submenu li a:hover {
    background-color: #3e58a3;
    color: #fff;
    border-left: 0;
}

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
main,
.main-content,
.main-center,
.main-content-contact {
    flex-grow: 1;
    padding: 30px 40px;
    min-width: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Footer */
footer {
    flex-shrink: 0;
    background-color: #004080;
    color: white;
    padding: 15px 0;
    text-align: center;
    font-size: 0.95rem;
    box-sizing: border-box;
    width: 100%;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
/* Alerts (Global) */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login Form (Global) */
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.login-form input[type="text"],
.login-form input[type="password"] {
    max-width: 280px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    margin-bottom: 15px;
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px 10px;
    }
    .header-left,
    .header-right {
        margin-bottom: 10px;
    }
    .header-right {
        min-width: auto;
    }
    .page-wrapper {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    aside {
        width: 100%;
        height: auto;
        margin-bottom: 0;
        padding: 10px 0;
        border-right: none;
        border-bottom: 1px solid #34495e;
    }
    main, .main-content, .main-center, .main-content-contact {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }
    nav.main-navigation {
        text-align: center;
    }
    nav.main-navigation a {
        display: inline-block;
        margin: 0 10px;
    }
}