:root {
    --primary-red: #B91C1C;
    --primary-dark: #991b1b;
    --bg-color: #F3F4F6;
    --sidebar-width: 280px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: #1F2937;
}

h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; }

/* --- Header Section --- */
.brand-strip {
    background: linear-gradient(90deg, #B91C1C 0%, #DC2626 100%);
    color: white;
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 4px 10px rgba(185, 28, 28, 0.3);
    position: relative;
    z-index: 10;
}

.brand-strip h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.brand-strip p { font-size: 13px; opacity: 0.9; font-weight: 400; }

.sub-header {
    background: white;
    padding: 15px 40px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.govt-logo h2 { font-size: 18px; color: #111; font-weight: 700; }
.govt-logo p { font-size: 12px; color: #666; font-weight: 500; text-transform: uppercase; }

.user-profile { text-align: right; }
.user-profile .date { font-size: 13px; color: #4B5563; font-weight: 500; }
.user-profile .role { font-size: 12px; color: #9CA3AF; margin-top: 2px; }

/* --- Layout --- */
.container { display: flex; min-height: calc(100vh - 130px); }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    padding: 30px 20px;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
}

.nav-menu { list-style: none; flex: 1; }
.nav-menu li { margin-bottom: 10px; }

.nav-btn {
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    color: #4B5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.nav-btn i { font-size: 18px; width: 24px; text-align: center; }

.nav-btn:hover { background-color: #FEF2F2; color: var(--primary-red); transform: translateX(5px); }

.nav-btn.active {
    background: linear-gradient(90deg, #FEF2F2 0%, #FFF 100%);
    color: var(--primary-red);
    font-weight: 600;
    border-left: 4px solid var(--primary-red);
    border-radius: 4px 12px 12px 4px; /* Unique shape */
    box-shadow: 0 2px 5px rgba(185, 28, 28, 0.05);
}

.system-info {
    background: #F9FAFB;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}
.system-info h4 { font-size: 11px; color: #9CA3AF; letter-spacing: 1px; margin-bottom: 15px; }
.info-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: #374151; }
.status-dot { height: 8px; width: 8px; background-color: #10B981; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* --- Main Content --- */
.main-content { flex: 1; padding: 40px; overflow-y: auto; }

/* --- Charts Section --- */
.chart-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr; /* Doughnut smaller, Trend larger */
    gap: 25px;
    margin-bottom: 35px;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 25px;
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card:hover { box-shadow: var(--hover-shadow); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #F3F4F6;
}

.card-title { font-size: 16px; font-weight: 600; color: #111; display: flex; align-items: center; gap: 10px; }
.card-title i { color: #6B7280; font-size: 14px; }

.chart-container { position: relative; height: 300px; width: 100%; }

/* --- Stats Overview --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 4px solid transparent;
    transition: all 0.3s;
}

.stat-card:hover { transform: translateY(-5px); }

/* Color accents for stats */
.stat-card.blue { border-bottom-color: #3B82F6; }
.stat-card.green { border-bottom-color: #10B981; }
.stat-card.purple { border-bottom-color: #8B5CF6; }

.stat-info h5 { font-size: 13px; color: #6B7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.stat-value { font-size: 32px; font-weight: 700; color: #111827; }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.bg-blue { background: #EFF6FF; color: #3B82F6; }
.bg-green { background: #ECFDF5; color: #10B981; }
.bg-purple { background: #F5F3FF; color: #8B5CF6; }

/* --- Quick Actions (Modernized) --- */
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }

.action-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-card:hover {
    border-color: var(--primary-red);
    background: #FEF2F2;
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.action-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #F3F4F6;
    color: #4B5563;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
}

.action-card:hover .action-icon { background: white; color: var(--primary-red); }

.action-text h4 { font-size: 16px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.action-text p { font-size: 13px; color: #6B7280; }

/* --- Utility --- */
.hidden { display: none !important; }

/* Form Styling matches current trend */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; color: #374151; }
.form-group input, .form-group select {
    width: 100%; padding: 12px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 14px;
    transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary-red); box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1); }

.btn { padding: 12px 24px; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary { background-color: var(--primary-red); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); box-shadow: 0 4px 6px rgba(185, 28, 28, 0.2); }
.btn-secondary { background: #3B82F6; color: white; }
.btn-danger { background: #EF4444; color: white; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { background: #F9FAFB; color: #374151; font-weight: 600; padding: 15px; text-align: left; border-bottom: 1px solid #E5E7EB; }
td { padding: 15px; border-bottom: 1px solid #E5E7EB; color: #4B5563; font-size: 14px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F9FAFB; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal-content { background: white; padding: 30px; border-radius: 16px; width: 90%; max-width: 500px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
/* Login Overlay */
#login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.login-box {
    background: white; padding: 40px; border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%; max-width: 400px; text-align: center;
    border: 1px solid #E5E7EB;
}
.login-logo { font-size: 48px; color: var(--primary-red); margin-bottom: 20px; }
