/* ==========================================================================
   1. MAIN STRUCTURAL CONTAINERS & GRIDS
   ========================================================================== */

/* --- Primary Wrappers --- */
.container { 
    max-width: 1100px; 
    margin: 20px auto; 
    padding: 30px; 
    background: var(--container-bg); 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}

.login-wrapper {
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

/* --- Reusable Grid Layouts --- */
.action-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 15px; 
    margin-top: 20px; 
}

.stats-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px; 
    margin-top: 20px; 
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* --- Layout Helpers --- */
.header-actions {
    display: flex;
    gap: 10px;
}


/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */

header {
    background: var(--header-gradient);
    padding: 20px;
    border-bottom: 4px solid var(--accent-color);
}

.header-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo img { 
    max-height: 60px; 
}

/* --- Main Nav Bar --- */
nav { 
    background-color: var(--nav-bg); 
    margin-top: 15px; 
}

nav ul { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    display: flex; 
}

nav ul li a, 
.drop-label { 
    display: block; 
    padding: 15px 20px; 
    color: #ffffff !important; 
    font-weight: 500; 
    cursor: pointer;
    margin: 0;
}

nav ul li a:hover, 
.drop-label:hover { 
    background-color: var(--accent-color); 
    text-decoration: none; 
}

.nav-icon { 
    width: 20px; 
    height: 20px; 
    color: var(--accent-color); 
    transition: color 0.2s; 
}

nav ul li a:hover .nav-icon { 
    color: #ffffff; 
}

/* --- Dropdown Menus --- */
.dropdown { 
    position: relative; 
    display: inline-block; 
}

.dropdown-content { 
    display: none; 
    position: absolute; 
    left: 0; 
    min-width: 220px; 
    background-color: var(--stat-box-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 6px; 
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); 
    z-index: 100; 
    overflow: hidden; 
}

.dropdown:hover .dropdown-content { 
    display: block; 
}

.dropdown-content a { 
    display: block; 
    padding: 12px 16px; 
    color: var(--text-color) !important; 
    text-decoration: none; 
    text-align: left; 
    font-size: 0.9em; 
    border-bottom: 1px solid var(--border-color); 
}

.dropdown-content a:last-child { 
    border-bottom: none; 
}

.dropdown-content a:hover { 
    background-color: var(--accent-color); 
    color: #ffffff !important; 
}


/* ==========================================================================
   3. IN-HEADER SEARCH BAR
   ========================================================================== */

.search-form { 
    display: flex; 
    align-items: center; 
    height: 100%; 
    margin: 0; 
    padding: 0 15px; 
}

.search-input, 
.search-btn { 
    height: 36px; 
    margin: 0; 
    box-sizing: border-box; 
    -webkit-appearance: none; 
    appearance: none; 
}

.search-input { 
    width: 220px; 
    padding: 0 12px; 
    background: var(--stat-box-bg); 
    color: var(--text-color); 
    border: 1px solid var(--border-color); 
    border-right: none; 
    border-radius: 4px 0 0 4px; 
    outline: none; 
    font-family: inherit; 
    font-size: 0.9em; 
}

.search-input:focus { 
    border-color: var(--accent-color); 
}

.search-btn { 
    display: flex; 
    align-items: center; 

    justify-content: center; 
    padding: 0 15px; 
    background: var(--accent-color); 
    color: #ffffff; 
    border: 1px solid var(--accent-color); 
    border-radius: 0 4px 4px 0; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 0.9em; 
    transition: background 0.2s; 
}

.search-btn:hover { 
    background: var(--accent-hover); 
}


/* ==========================================================================
   4. DASHBOARD BLOCKS (STATS & ACTION CARDS)
   ========================================================================== */

/* --- Stat Boxes --- */
.stat-box { 
    padding: 20px;
    background: var(--stat-box-bg); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    text-align: center; 
}

.stat-box span { 
    display: block; 
    color: var(--muted-text); 
    font-size: 0.9em; 
}

.stat-box strong { 
    display: block; 
    margin-top: 8px; 
    font-size: 1.6em; 
}

/* --- Action Cards --- */
.action-card { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 120px; 
    padding: 20px; 
    color: #ffffff !important; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    font-weight: bold; 
    text-align: center; 
    transition: all 0.2s ease-in-out; 
}

.action-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
    filter: brightness(1.1); 
}

.action-card svg { 
    width: 36px; 
    height: 36px; 
    margin-bottom: 12px; 
    color: #ffffff; 
}

/* Action Card Unique Colors */
.card-add     { background-color: #2e7d32; }
.card-search  { background-color: #1565c0; }
.card-reports { background-color: #ef6c00; }
.card-users   { background-color: #6a1b9a; }


/* ==========================================================================
   5. FOOTER
   ========================================================================== */

footer { 
    display: block; 
    clear: both; 
    width: 100%; 
    margin: 0 auto; 
    padding: 40px 20px; 
    color: var(--muted-text); 
    font-size: 0.85em; 
    text-align: center; 
}