/* public/css/sidebar.css */

/* --- 1. GLOBAL IMPORTS & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

* { box-sizing: border-box; } /* CRITICAL: Ensures padding doesn't break layout */

/* --- 2. GLOBAL LAYOUT --- */
body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: #f3f4f6;
    color: #333;
}

#sidebar-container {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 270px; /* FIXED WIDTH: Set explicitly here */
    height: 100%;
}

/* --- 3. SIDEBAR STYLES --- */
.sidebar {
    width: 270px; /* INCREASED to 270px to fit "Job Allocation System" */
    background: #1f2937;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

/* --- BRANDING --- */
.brand { 
    height: 60px; 
    display: flex;
    align-items: center; 
    padding: 0; 
    border-bottom: none; 
    margin-bottom: 20px; 
    flex-shrink: 0;
}

.brand h1 { 
    font-size: 19px; 
    margin: 0; 
    color: white; 
    font-weight: 700;
    white-space: nowrap; 
    overflow: hidden; /* Clean cut if screen is tiny */
    text-overflow: ellipsis;
}

.brand span { color: #3b82f6; } 

/* --- MENU LIST --- */
.menu { list-style: none; padding: 0; margin: 0; }
.menu li { margin-bottom: 2px; } /* Reduced from 8px to 2px */

/* --- MENU LINKS --- */
.menu a {
    text-decoration: none;
    color: #d1d5db; 
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px; /* Slightly smaller font for compactness */
    padding: 8px 12px; /* Reduced padding from 12px to 8px */
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent; 
}

.menu a:hover { background: #374151; color: white; }

.menu a.active {
    background: #374151;
    color: #60a5fa; 
    border-left: 3px solid #60a5fa;
}

.menu i { width: 22px; text-align: center; }

/* --- SUBMENUS --- */
.chevron { margin-left: auto; font-size: 12px; transition: transform 0.4s ease; }
.menu-open .chevron { transform: rotate(180deg); }

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #111827; 
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
}

.menu-open + .submenu { opacity: 1; }

.submenu li a {
    padding-left: 48px !important;
    font-size: 14px;
    color: #9ca3af;
    border-left: 3px solid transparent !important; 
}

.submenu li a:hover { color: white; }
.submenu li a.active-sub { color: #3b82f6; font-weight: 600; }

/* --- SCROLLBAR --- */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: #1f2937; }
.sidebar::-webkit-scrollbar-thumb {
    background-color: #374151;
    border-radius: 10px;
    border: 2px solid #1f2937;
}
.sidebar::-webkit-scrollbar-thumb:hover { background-color: #4b5563; }