/* ==========================================================================
   ePalika.com - आन्तरिक नियन्त्रण प्रणाली (Internal Administration System)
   Official Government UI/UX Theme - बाणगंगा नगरपालिका, कपिलवस्तु
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@300;400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-navy: #0e2a47;
    --primary-navy-dark: #081a2e;
    --primary-teal: #0891b2;
    --primary-teal-dark: #0e7490;
    --accent-red: #dc2626;
    --accent-gold: #d97706;
    --accent-green: #16a34a;
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-sidebar: #0b1f35;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #f8fafc;
    --border-color: #e2e8f0;
    --border-focus: #0284c7;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Noto Sans Devanagari', 'Mukta', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* -------------------------------------------------------------
   Layout Structure
------------------------------------------------------------- */
#app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #061424 100%);
    color: var(--text-light);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .badge-pill,
.sidebar.collapsed .section-header {
    display: none !important;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.2);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
}

.brand-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* Sidebar Navigation */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.section-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.25rem;
    letter-spacing: 0.05em;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    color: #cbd5e1;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-link-custom:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-link-custom.active {
    color: #fff;
    background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
    font-weight: 600;
}

.nav-link-custom i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: #94a3b8;
}

.nav-link-custom.active i {
    color: #fff;
}

/* Main Content Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Navbar */
.topbar {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-sidebar-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-sidebar-toggle:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
}

.municipality-tagline {
    font-weight: 600;
    color: var(--primary-navy);
    font-size: 0.95rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.65rem;
    border-radius: 30px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Content Area */
.content-area {
    padding: 1.5rem;
    flex: 1;
}

/* Cards & Surfaces */
.card-custom {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    transition: box-shadow 0.2s ease;
}

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

.card-header-custom {
    padding: 1rem 1.25rem;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.card-title-custom {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body-custom {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.stat-card.blue::before { background-color: #0284c7; }
.stat-card.green::before { background-color: #16a34a; }
.stat-card.amber::before { background-color: #d97706; }
.stat-card.purple::before { background-color: #9333ea; }
.stat-card.teal::before { background-color: #0d9488; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-card.blue .stat-icon { background-color: #e0f2fe; color: #0369a1; }
.stat-card.green .stat-icon { background-color: #dcfce7; color: #15803d; }
.stat-card.amber .stat-icon { background-color: #fef3c7; color: #b45309; }
.stat-card.purple .stat-icon { background-color: #f3e8ff; color: #7e22ce; }
.stat-card.teal .stat-icon { background-color: #ccfbf1; color: #0f766e; }

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* -------------------------------------------------------------
   Official Reference Design Match: Data Tables & Action Bar
------------------------------------------------------------- */
.table-wrapper {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-custom {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table-custom td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Action Toolbar (Exact Reference from PDF) */
.reference-toolbar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.reference-toolbar .btn-group-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

/* Buttons */
.btn-gov {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-gov-primary {
    background-color: #0284c7;
    color: #fff;
}
.btn-gov-primary:hover {
    background-color: #0369a1;
    color: #fff;
}

.btn-gov-success {
    background-color: #16a34a;
    color: #fff;
}
.btn-gov-success:hover {
    background-color: #15803d;
    color: #fff;
}

.btn-gov-danger {
    background-color: #dc2626;
    color: #fff;
}
.btn-gov-danger:hover {
    background-color: #b91c1c;
    color: #fff;
}

.btn-gov-secondary {
    background-color: #fff;
    color: #475569;
    border-color: #cbd5e1;
}
.btn-gov-secondary:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.btn-gov-excel {
    background-color: #107c41;
    color: #fff;
}
.btn-gov-excel:hover {
    background-color: #0b5e31;
    color: #fff;
}

.btn-gov-print {
    background-color: #475569;
    color: #fff;
}
.btn-gov-print:hover {
    background-color: #334155;
    color: #fff;
}

/* Status Badges */
.badge-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-status.permanent { background-color: #e0f2fe; color: #0284c7; }
.badge-status.contract { background-color: #fef3c7; color: #b45309; }
.badge-status.wage { background-color: #fee2e2; color: #dc2626; }
.badge-status.active { background-color: #dcfce7; color: #16a34a; }
.badge-status.inactive { background-color: #f1f5f9; color: #64748b; }

/* -------------------------------------------------------------
   Employee Form (Detailed Grid matching PDF Screenshot)
------------------------------------------------------------- */
.form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-navy);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label-gov {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
    display: block;
}

.form-label-gov.required::after {
    content: " *";
    color: #dc2626;
}

.form-control-gov, .form-select-gov {
    font-size: 0.88rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    width: 100%;
    color: #1e293b;
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control-gov:focus, .form-select-gov:focus {
    border-color: var(--border-focus);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.input-group-master {
    display: flex;
    gap: 0.25rem;
}

.btn-master-add {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: var(--radius-sm);
    padding: 0 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-master-add:hover {
    background: #cbd5e1;
    color: #0f172a;
}

/* Toast Notification */
.toast-container-custom {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-custom {
    min-width: 300px;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid #0284c7;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideInRight 0.25s ease-out;
}

.toast-custom.success { border-left-color: #16a34a; }
.toast-custom.error { border-left-color: #dc2626; }
.toast-custom.warning { border-left-color: #d97706; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Print Styles */
@media print {
    .sidebar, .topbar, .btn-gov, .no-print, .reference-toolbar {
        display: none !important;
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
    body {
        background: #fff;
    }
    .table-custom th, .table-custom td {
        font-size: 10pt;
        padding: 4px 8px;
    }
    .card-custom {
        box-shadow: none;
        border: none;
    }
}

/* Responsive Mobile Rules */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
}
