/* --- 1. THE NAGAR PANCHAYAT 60-30-10 ENGINE --- */
:root {
    /* 60% - Main Neutrals (Backgrounds & Surfaces) */
    --bg-60: #e8efee;          /* Light grey background from image */
    --white: #e3eee7;
    --border-light: #e2e8f0;   /* Clean card borders */
    
    /* 30% - Secondary/Brand (Deep Slate for Authority) */
    --brand-30: #1e293b;       /* Deep navy/slate from top banner */
    --brand-hover: #334155;
    --text-main: #1e293b;      /* Dark text for headings */
    --text-muted: #64748b;     /* Grey text for sub-labels */
    
    /* 10% - Accent (Institutional Orange-Red) */
    --accent-10: #e84c22;      /* The "Admin Login" button color */
    --accent-hover: #d13d16;
    
    /* System Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --sidebar-width: 260px;
}

/* --- 2. CORE RESET --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-60);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- 3. LAYOUT STRUCTURE --- */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- 4. SIDEBAR (Brand 30%) --- */
.sidebar-container {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--brand-30);
    color: white;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    background: #161e2b; /* Slightly darker than sidebar for contrast */
    border-bottom: 3px solid var(--accent-10); /* The orange-red stripe */
    text-align: center;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: #cbd5e1;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.95rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-link.active {
    background: var(--accent-10); /* Active state uses Accent color */
    color: white;
    font-weight: 600;
}

/* --- 5. CARDS & SECTIONS (Neutral 60%) --- */
.dashboard-wrapper {
    padding: 30px;
}

.card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin-bottom: 25px;
}

/* Section Titles with Red Vertical Bar (as seen in image) */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-left: 5px solid var(--accent-10);
    padding-left: 15px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-30);
}

/* --- 6. BUTTONS (Accent 10%) --- */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-10) !important;
    color: white !important;
}

.btn-primary:hover {
    background: var(--accent-hover) !important;
    box-shadow: 0 4px 12px rgba(232, 76, 34, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-light);
    color: var(--brand-30);
}

.btn-outline:hover {
    background: var(--brand-light);
    border-color: var(--brand-30);
}

/* --- 7. TABLES --- */
.table-responsive {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--brand-light);
    color: var(--brand-30);
    padding: 15px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    text-align: left;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
}

/* --- 8. FORMS --- */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    transition: 0.3s;
}

.form-control:focus {
    border-color: var(--accent-10);
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 76, 34, 0.1);
}

/* --- 9. MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .sidebar-container {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
    }
    .sidebar-container.active { transform: translateX(0); }
    .dashboard-wrapper { padding: 15px; }
}

/* --- 10. PRINT --- */
@media print {
    .sidebar-container, .btn-action { display: none !important; }
    .main-content { margin: 0; width: 100%; }
}