:root {
    --kenya-black: #000000;
    --kenya-red: #BB0000;
    --kenya-green: #006600;
    --kenya-white: #FFFFFF;
    --bg-light: #f4f6f8;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --border-color: #e9ecef;
    --header-height: 70px;
    --nav-font-size: 1.05rem;
    --primary-color: #2c3e50;
    --secondary-color: #6c757d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: var(--kenya-black);
    color: var(--kenya-white);
    height: var(--header-height);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.navbar-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--kenya-white);
    text-decoration: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.navbar-brand span {
    color: var(--kenya-red);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 100%;
}

.nav-item {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--nav-font-size);
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-item:hover, .nav-item.active {
    color: var(--kenya-red);
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--kenya-red);
    transition: width 0.3s;
}

.nav-item:hover::after {
    width: 100%;
}

/* Dropdowns */
.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropbtn {
    background-color: transparent;
    color: var(--text-light);
    border: none;
    cursor: pointer;
    font-size: var(--nav-font-size);
    font-weight: 600;
    font-family: inherit;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.3s;
}

.dropdown:hover .dropbtn {
    color: var(--kenya-red);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--kenya-white);
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1001;
    border-radius: 0 0 8px 8px;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0;
    border-top: 3px solid var(--kenya-red);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f9f9f9;
    color: var(--kenya-green);
    padding-left: 25px;
}

@media (min-width: 769px) {
    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* Right Side (User/Logout) */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2rem;
    padding-left: 2rem;
    border-left: 1px solid rgba(255,255,255,0.15);
    height: 60%;
}

.user-greeting {
    font-size: 0.9rem;
    color: #bbb;
    font-weight: 500;
}

/* Mobile Toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .navbar-container {
        padding: 0 1rem;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--kenya-black);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        height: auto;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
    }

    .navbar-menu.active {
        display: flex;
    }

    .nav-item, .dropbtn {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 1rem;
        text-align: left;
    }

    .nav-item::after {
        display: none;
    }

    .dropdown {
        display: block;
        height: auto;
        width: 100%;
    }

    .dropbtn {
        justify-content: space-between;
    }

    .dropbtn::after {
        content: '▾';
        font-size: 0.8em;
    }

    .dropdown-content {
        position: static;
        transform: none;
        width: 100%;
        background-color: rgba(255,255,255,0.05);
        border-top: none;
        border-radius: 0;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
        padding: 0;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        color: #ddd;
        padding-left: 2.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        background-color: transparent;
    }

    .dropdown-content a:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
    }

    .nav-right {
        flex-direction: column;
        align-items: flex-start;
        margin: 0;
        padding: 1rem 1.5rem;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        height: auto;
        gap: 1rem;
    }
    
    .btn-logout {
        width: 100%;
        text-align: center;
        border-radius: 4px;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

/* Footer */
footer {
    background-color: #fff;
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
    margin-top: auto;
}

/* Utility Classes */
.mt-3 { margin-top: 1rem; }
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.small { font-size: 0.875rem; }

/* Dashboard Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #eaeaea;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 6px solid var(--kenya-black);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.red { border-left-color: var(--kenya-red); }
.stat-card.green { border-left-color: var(--kenya-green); }
.stat-card.black { border-left-color: var(--kenya-black); }

/* --- NEW: Modern Compact Tables --- */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0; /* Remove default margin */
    font-size: 0.95rem;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8f9fa; /* Light hover effect */
}

.table tbody tr:last-child td {
    border-bottom: none; /* Clean bottom */
}

/* Compact Table Variation (Optional, can be added via .table-sm) */
.table-sm th, .table-sm td {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

/* --- NEW: Form & Login Styling --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1a252f;
    border-color: #1a252f;
}

.btn-secondary {
    color: #fff;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-logout {
    /* Specific override for logout in nav */
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    background-color: var(--kenya-red);
    color: white !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-logout:hover {
    background-color: #a00000;
    transform: translateY(-1px);
}

/* Alerts */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Login Specific (Centered Card) */
/* The login page uses inline styles for max-width, but let's add a helper class if we want to remove inline later */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

.login-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
