:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0e7a3e;
    --sidebar-hover: #0b6632;
    --primary-green: #0e7a3e;
    --text-light: #888;
    --bg-color: #f4f7f6;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex; /* CRITICAL: Keeps sidebar and content separated */
    min-height: 100vh;
}

/* --- Sidebar Navigation --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    padding: 25px 20px;
    height: 100vh;
    position: sticky; /* Sticks to the left of the flex container */
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow-y: auto;
    flex-shrink: 0; /* Prevents sidebar from shrinking */
}

.sidebar .logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo-icon { font-size: 32px; }
.sidebar .logo-text { font-size: 20px; font-weight: 700; display: block; line-height: 1.2;}
.sidebar .logo-sub { font-size: 11px; opacity: 0.8; font-weight: 400; display: block;}

.sidebar nav { display: flex; flex-direction: column; flex-grow: 1; gap: 5px; margin-bottom: 20px; }

.sidebar nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 500;
    transition: 0.3s;
    font-size: 15px;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.sidebar nav a i { width: 20px; text-align: center; }

/* Sidebar Action Buttons */
.sidebar-actions {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-actions a.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    background: rgba(255,255,255,0.1);
    transition: 0.3s;
}
.sidebar-actions a.btn-warning { background: #f5a623; }
.sidebar-actions a.btn-success { background: #27ae60; }
.sidebar-actions a.btn-primary { background: #2980b9; }

/* Logout Button */
.sidebar .logout-container { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; }
.sidebar .logout-btn {
    color: #ff6b6b !important;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    font-weight: 600;
}
.sidebar .logout-btn:hover { background: rgba(255,0,0,0.25); }

/* --- Main Content Area --- */
/* --- Main Content Area --- */
.main-content {
    flex: 1;
    padding: 30px;
    box-sizing: border-box;
    
    /* STRETCH TO FULL WIDTH OVERRIDE */
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    
    /* Optionally add a background if you want the right side to be a solid white block */
    /* background: #ffffff; */
    /* border-radius: var(--radius); */
}

/* --- Top Header Bar --- */
.topbar {
    background: #fff;
    padding: 20px 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
}
.topbar .welcome h2 { font-size: 18px; margin: 0; color: #333; }
.topbar .welcome span { color: var(--text-light); font-size: 14px; }
.topbar .date { color: var(--text-light); font-weight: 500; display: flex; align-items: center; gap: 8px; }

/* --- Dashboard Grid --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }

.stat-box {
    background: #fff; padding: 25px; border-radius: var(--radius);
    box-shadow: var(--card-shadow); position: relative;
    border-bottom: 4px solid var(--primary-green); display: flex; flex-direction: column;
}
.stat-box .stat-icon {
    width: 50px; height: 50px; background: #e8f5e9; color: var(--primary-green);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 15px;
}
.stat-box h4 { color: var(--text-light); font-size: 12px; text-transform: uppercase; margin: 0 0 5px 0; font-weight: 600; }
.stat-box .number { font-size: 28px; font-weight: 700; color: #222; margin: 0 0 10px 0; }
.stat-box small { color: var(--text-light); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.stat-box:nth-child(4) { border-bottom-color: #27ae60; }
.stat-box:nth-child(3) { border-bottom-color: #f5a623; }
.stat-box:nth-child(3) .stat-icon { background: #fff3e0; color: #f5a623; }

/* --- Two Column Grid --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }

.card {
    background: #fff; border-radius: var(--radius); padding: 25px; box-shadow: var(--card-shadow);
}
.card h3 { font-size: 16px; margin-top: 0; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; color: #222; }
.card h3 i { color: var(--primary-green); }

/* --- Tables --- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { text-align: left; color: var(--text-light); font-weight: 500; padding: 10px 0; border-bottom: 1px solid #eee; }
table td { padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
table tr:last-child td { border-bottom: none; }

.badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; display: inline-block; }
.badge-info { background: #e3f2fd; color: #1565c0; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-danger { background: #ffebee; color: #c62828; }

/* --- Red Button Styling --- */
.btn-danger {
    background-color: #dc3545 !important; /* A clean, standard alert red */
    color: #ffffff !important;
    border: none;
    transition: background-color 0.3s ease;
}

.btn-danger:hover {
    background-color: #bb2d3b !important; /* Darker red on hover */
    color: #ffffff !important;
}

.btn-danger i {
    margin-right: 6px; /* Adds a tiny gap between the icon and the text */
}

.btn-sm { padding: 8px 16px; border-radius: 6px; border: none; font-weight: 500; text-decoration: none; display: inline-block; color: #fff; background: var(--primary-green); }
.btn-sm:hover { background: #0b6632; }

/* --- Footer --- */
.footer {
    margin-top: 50px;
    text-align: center;
    padding: 20px 0;
    color: #888;
    font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
    .sidebar { width: 70px; padding: 20px 10px; }
    .sidebar .logo-text, .sidebar .logo-sub, .sidebar nav a span, .sidebar-actions a span, .sidebar .logout-btn span { display: none; }
    .sidebar nav a, .sidebar .logout-btn { justify-content: center; padding: 12px; }
    .sidebar .logo-area { justify-content: center; }
    .main-content { padding: 20px; }
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .sidebar { width: 0; padding: 0; overflow: hidden; }
    .main-content { padding: 15px; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
}
/* --- Mobile Hamburger Menu --- */

.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
    position: fixed;
    top: 15px;
    right: 15px; /* <--- CHANGED TO RIGHT SIDE */
    z-index: 9999;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    text-decoration: none;
}
@media (max-width: 600px) {
    /* Show the hamburger button on mobile */
    .mobile-menu-toggle { display: block; }

    /* Slide sidebar off-screen */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 260px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1001;
    }

    /* Slide sidebar in when targeted */
    .sidebar:target {
        transform: translateX(0);
    }

    /* Dark overlay behind the menu */
    .sidebar:target::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: -1;
    }

    /* Close button inside the sidebar */
    .sidebar .close-menu {
        display: flex !important;
        justify-content: flex-end;
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin-bottom: 20px;
    }
    .sidebar .close-menu a {
        color: #fff;
        font-size: 24px;
        text-decoration: none;
        padding: 5px 10px;
        background: rgba(255,255,255,0.15);
        border-radius: 6px;
    }
}

/* Hide close menu on larger screens */
@media (min-width: 601px) {
    .sidebar .close-menu { display: none !important; }
}