@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

:root {
    /* Global Palette */
    --gov-green: #059669;
    --gov-green-dark: #064e3b;
    --gov-green-light: #34d399;
    --gov-green-soft: #ecfdf5;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border: #e5e7eb;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --sidebar-width: 280px;
    --header-height: 70px;
    --radius: 12px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Hind Siliguri', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Outfit', 'Hind Siliguri', sans-serif;
}

.container {
    width: min(1200px, 95%);
    margin: 0 auto;
}

/* SHARED COMPONENTS */
.alert {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.alert-success {
    background: var(--gov-green-soft);
    color: var(--gov-green-dark);
    border: 1px solid var(--gov-green-light);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: var(--gov-green);
    color: white;
}

.btn-primary:hover {
    background: var(--gov-green-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gov-green);
    color: var(--gov-green);
}

.btn-outline:hover {
    background: var(--gov-green);
    color: white;
}

/* -------------------------------------------------------------------------- */
/* DASHBOARD MODE STYLES                                                      */
/* -------------------------------------------------------------------------- */

.dashboard-mode .dashboard-container {
    display: flex;
    flex: 1;
}

.dashboard-sidebar {
    width: var(--sidebar-width);
    background: var(--gov-green-dark);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand img {
    width: 45px;
}

.brand-info h3 {
    font-size: 16px;
    color: white;
    line-height: 1.2;
}

.brand-info p {
    font-size: 11px;
    opacity: 0.6;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.menu-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.4;
    margin: 15px 0 10px 10px;
    font-weight: 800;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-menu a.active {
    background: var(--gov-green);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-breadcrumb h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tool-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.tool-btn:hover {
    background: var(--border);
}

.tool-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    transition: var(--transition);
}

.tool-btn-link:hover {
    background: var(--border);
    color: var(--text-primary);
}

.tool-btn-link.highlight {
    background: var(--gov-green);
    color: white;
    border-color: var(--gov-green);
}

.tool-btn-link.highlight:hover {
    background: var(--gov-green-dark);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
}

.user-profile-dropdown {
    position: relative;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-light);
    padding: 5px 5px 5px 16px;
    border-radius: 40px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.user-trigger:hover {
    border-color: var(--gov-green);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.user-profile-dropdown.active .user-trigger {
    border-color: var(--gov-green);
    background: #fff;
}

.user-meta {
    text-align: right;
}

.user-meta strong {
    display: block;
    font-size: 13px;
    line-height: 1;
    color: var(--text-primary);
    white-space: nowrap;
}

.user-meta small {
    font-size: 10px;
    color: var(--gov-green);
    font-weight: 700;
    text-transform: uppercase;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--gov-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}

/* Dropdown Menu */
.user-profile-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 2000;
    animation: dropdownFade 0.2s ease;
}

.user-profile-dropdown.active .dropdown-menu {
    display: flex;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.1s;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
    transition: all 0.1s;
}

.dropdown-item:hover {
    background: var(--gov-green-soft);
    color: var(--gov-green);
}

.dropdown-item:hover i {
    color: var(--gov-green);
}

.dropdown-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-item.logout:hover i {
    color: #dc2626;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.dashboard-content {
    padding: 40px;
    flex: 1;
}

.dashboard-footer {
    padding: 20px 40px;
    border-top: 1px solid var(--border);
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
}

/* -------------------------------------------------------------------------- */
/* PUBLIC FRONTEND STYLES                                                     */
/* -------------------------------------------------------------------------- */

.public-mode {
    background: #fff;
}

.public-main {
    flex: 1;
}

.public-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.public-brand img {
    width: 50px;
}

.brand-info h1 {
    font-size: 18px;
    color: var(--gov-green-dark);
    line-height: 1.1;
}

.brand-info p {
    font-size: 11px;
    color: var(--text-mute);
    margin-top: 2px;
}

.public-nav {
    display: flex;
    gap: 24px;
}

.public-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 14px;
    position: relative;
    transition: var(--transition);
}

.public-nav a:hover,
.public-nav a.active {
    color: var(--gov-green);
}

.public-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gov-green);
    transition: var(--transition);
}

.public-nav a:hover::after,
.public-nav a.active::after {
    width: 100%;
}

.public-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 13px;
}

.lang-btn:hover {
    border-color: var(--gov-green);
    color: var(--gov-green);
}

.login-btn,
.portal-btn {
    text-decoration: none;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 14px;
    transition: var(--transition);
}

.login-btn {
    color: var(--gov-green);
    border: 1.5px solid var(--gov-green);
}

.login-btn:hover {
    background: var(--gov-green);
    color: white;
}

.portal-btn {
    background: var(--gov-green-dark);
    color: white;
}

.portal-btn:hover {
    background: var(--gov-green);
}

.public-footer {
    background: var(--gov-green-dark);
    color: white;
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.footer-grid h3,
.footer-grid h4 {
    margin-bottom: 20px;
    color: var(--gov-green-light);
    font-size: 18px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
}

/* -------------------------------------------------------------------------- */
/* GLOBAL COMPONENTS & UTILITIES                                              */
/* -------------------------------------------------------------------------- */

.d-grid {
    display: grid;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gc-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.gc-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

.card>.table-wrap {
    flex: 1;
}

.grid .card {
    margin-bottom: 0;
    height: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gov-green);
    box-shadow: 0 0 0 3px var(--gov-green-soft);
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--gov-green-dark);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
}

/* KPI Grid */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-val {
    font-size: 24px;
    font-weight: 800;
    display: block;
    margin-top: 2px;
    color: var(--text-primary);
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-ico {
    width: 50px;
    height: 50px;
    background: var(--gov-green-soft);
    color: var(--gov-green);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

/* Table Premium */
.table-wrap {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap.scrollable table {
    min-width: 600px;
}

th {
    background: #f8fafc;
    padding: 14px 20px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 800;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f9fafb;
}

.status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Public Sections */
.hero-section {
    background: radial-gradient(circle at top right, var(--gov-green), var(--gov-green-dark));
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-lead {
    font-size: 18px;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto 40px;
}

/* Mobile Menu Fixes */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gov-green-dark);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .dashboard-sidebar.open {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-header {
        padding: 0 20px;
    }

    .public-nav {
        display: none;
    }

    .public-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        gap: 15px;
    }

    .menu-toggle {
        display: block;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .gc-2,
    .gc-3 {
        grid-template-columns: 1fr;
    }

    .header-tools .user-meta {
        display: none;
    }
}

@media (max-width: 640px) {
    .hero-section {
        padding: 60px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .public-tools .lang-btn {
        display: none;
    }
}