/* =========================================================
   HARYANA DEVELOPMENT WORKS MANAGEMENT PORTAL
   Custom Design System & Stylesheet
========================================================= */

/* Google Fonts loaded via <link> tags in header.php for better performance */

:root {
    --primary: #003366;           /* Deep Haryana Navy */
    --primary-light: #004d99;
    --primary-dark: #002244;
    --accent: #d97706;            /* Royal Amber / Saffron */
    --accent-light: #fbbf24;
    --success: #059669;           /* Emerald Green */
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #0284c7;
    --info-bg: #f0f9ff;

    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;

    --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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* =========================================================
   DISABLE / HIDE NUMBER INPUT UP/DOWN SPINNER ARROWS GLOBALLY
   Allow only pure typing without up/down arrow buttons
========================================================= */
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   TOP GOVT HEADER & BRANDING
========================================================= */
.govt-topbar {
    background: linear-gradient(90deg, #ff9933 0%, #ffffff 50%, #138808 100%);
    height: 4px;
    width: 100%;
}

.govt-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    box-shadow: var(--shadow-sm);
}

.govt-header-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.emblem-icon {
    width: 62px;
    height: 62px;
    object-fit: contain;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
}

.brand-text h3 {
    font-size: 14px;
    color: #b45309;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-text h2 {
    font-size: 18px;
    color: var(--primary);
    font-weight: 800;
    line-height: 1.2;
}

.brand-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =========================================================
   HERO / MAIN BANNER - LEFT TO RIGHT SPLIT LAYOUT
========================================================= */
.hero-section {
    background: linear-gradient(135deg, #001f3f 0%, #003366 45%, #004d99 100%);
    color: #ffffff;
    padding: 36px 20px 50px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 90% 10%, rgba(251, 191, 36, 0.15), transparent 45%),
                radial-gradient(circle at 10% 90%, rgba(5, 150, 105, 0.15), transparent 45%);
    pointer-events: none;
}

.hero-split-container {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 36px;
    align-items: center;
    position: relative;
    z-index: 2;
}

@media (max-width: 992px) {
    .hero-split-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

.hero-left-content {
    text-align: left;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: #fef08a;
    margin-bottom: 16px;
}

.hero-title-welcome {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #93c5fd;
    font-weight: 700;
    margin-bottom: 6px;
}

.hero-title-main {
    font-size: clamp(26px, 3.4vw, 42px);
    font-weight: 900;
    line-height: 1.18;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 40%, #bae6fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}

.hero-subtitle {
    font-size: clamp(14px, 1.2vw, 16px);
    color: #cbd5e1;
    margin-bottom: 20px;
    line-height: 1.6;
}

.hero-tags {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.hero-tag-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: #f1f5f9;
    transition: var(--transition);
}

.hero-tag-item:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

/* Integrated Hero Stats (Left Side) */
.hero-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.hero-stat-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-stat-card:hover {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 12px rgba(56, 189, 248, 0.2);
}

.hero-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-stat-data h3 {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
}

.hero-stat-data p {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    font-weight: 500;
}

/* Glassmorphic Mobile App Card & Buttons */
.glass-app-panel:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.glass-btn {
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-btn:hover {
    transform: translateY(-2px);
}

.glass-btn-purple {
    background: rgba(139, 92, 246, 0.25);
    color: #ffffff;
    border: 1.5px solid rgba(167, 139, 250, 0.55);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.28);
}
.glass-btn-purple:hover {
    background: rgba(139, 92, 246, 0.45);
    border-color: #c4b5fd;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.glass-btn-green {
    background: rgba(16, 185, 129, 0.25);
    color: #ffffff;
    border: 1.5px solid rgba(52, 211, 153, 0.55);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}
.glass-btn-green:hover {
    background: rgba(16, 185, 129, 0.45);
    border-color: #6ee7b7;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.glass-btn-blue {
    background: rgba(14, 165, 233, 0.28);
    color: #ffffff;
    border: 1.5px solid rgba(56, 189, 248, 0.6);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28);
}
.glass-btn-blue:hover {
    background: rgba(14, 165, 233, 0.48);
    border-color: #7dd3fc;
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

/* =========================================================
   RIGHT SIDE DIRECT LOGIN CARD
========================================================= */
.hero-right-login {
    width: 100%;
}

.hero-login-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    color: var(--text-primary);
    text-align: left;
}

.hero-login-header {
    background: linear-gradient(135deg, #002b5c 0%, #004080 100%);
    color: #ffffff;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2px solid var(--accent);
}

.login-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.hero-login-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.hero-login-header p {
    font-size: 12px;
    color: #bae6fd;
    margin-top: 2px;
}

.hero-login-body {
    padding: 22px;
}

.role-chips-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.role-chip {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.role-chip:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.role-chip.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 51, 102, 0.25);
}

.hero-login-helper {
    margin-top: 14px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    color: var(--text-secondary);
    text-align: center;
}

.hero-login-helper code {
    background: #e2e8f0;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    color: var(--primary);
}

/* =========================================================
   ROLE SELECTION GATEWAY (7 ROLES - LEFT TO RIGHT)
========================================================= */
.roles-section {
    max-width: 1300px;
    margin: 32px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.roles-card-container {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px 24px;
    border: 1px solid var(--border-color);
}

.roles-heading-bar {
    text-align: center;
    margin-bottom: 24px;
}

.roles-heading-bar h3 {
    font-size: 20px;
    color: var(--primary);
    font-weight: 800;
}

.roles-heading-bar p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.role-btn-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 22px 18px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.role-btn-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    background: #ffffff;
}

.role-btn-card.admin-role {
    border-color: #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.role-btn-card.admin-role:hover {
    border-color: #d97706;
    box-shadow: 0 10px 20px rgba(217, 119, 6, 0.15);
}

.role-icon-box {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    transition: var(--transition);
}

.role-btn-card:hover .role-icon-box {
    transform: scale(1.1);
}

.admin-icon { background: #fef3c7; color: #b45309; }
.ddo-icon { background: #e0f2fe; color: #0369a1; }
.sdo-icon { background: #ede9fe; color: #6d28d9; }
.acc-icon { background: #dcfce7; color: #15803d; }
.op-icon { background: #ffedd5; color: #c2410c; }
.je-icon { background: #fce7f3; color: #be185d; }
.sachiv-icon { background: #ccfbf1; color: #0f766e; }

.role-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.role-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.role-login-cta {
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =========================================================
   PORTAL STATS SECTION
========================================================= */
.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.stat-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

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

.stat-info h4 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.stat-info p {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* =========================================================
   MODAL DIALOGS
========================================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-header h3,
.modal-header h4 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
}

/* Universal Top-Right Close Button */
.modal-close-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50% !important;
    border: 1.5px solid rgba(0, 0, 0, 0.15) !important;
    background: rgba(0, 0, 0, 0.05) !important;
    color: #334155 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    margin: 0 0 0 auto !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.modal-close-btn:hover {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
    transform: scale(1.08) !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3) !important;
}

/* Dark header variants: crisp white glass button */
.modal-header[style*="linear-gradient"] .modal-close-btn,
.modal-header[style*="#1e3a8a"] .modal-close-btn,
.modal-header[style*="#0f766e"] .modal-close-btn,
.modal-header[style*="#059669"] .modal-close-btn,
.modal-header[style*="#991b1b"] .modal-close-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}

.modal-header[style*="linear-gradient"] .modal-close-btn:hover,
.modal-header[style*="#1e3a8a"] .modal-close-btn:hover,
.modal-header[style*="#0f766e"] .modal-close-btn:hover,
.modal-header[style*="#059669"] .modal-close-btn:hover,
.modal-header[style*="#991b1b"] .modal-close-btn:hover {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Amber/Yellow Edit Modal Header */
.modal-header[style*="#fffbeb"] .modal-close-btn {
    background: #fef3c7 !important;
    border: 1.5px solid #fde68a !important;
    color: #92400e !important;
}
.modal-header[style*="#fffbeb"] .modal-close-btn:hover {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Light Blue History Modal Header */
.modal-header[style*="#f0f9ff"] .modal-close-btn {
    background: #e0f2fe !important;
    border: 1.5px solid #bae6fd !important;
    color: #0369a1 !important;
}
.modal-header[style*="#f0f9ff"] .modal-close-btn:hover {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

/* Light Green Completion Cert Header */
.modal-header[style*="#f0fdf4"] .modal-close-btn {
    background: #dcfce7 !important;
    border: 1.5px solid #86efac !important;
    color: #166534 !important;
}
.modal-header[style*="#f0fdf4"] .modal-close-btn:hover {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.modal-body {
    padding: 24px;
}

/* =========================================================
   FORM CONTROLS & INPUTS
========================================================= */
.form-group {
    margin-bottom: 18px;
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 42px;
}

.input-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.input-toggle-btn:hover {
    color: var(--text-primary);
}

/* =========================================================
   BUTTONS
========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.25);
}

.btn-accent {
    background: var(--accent);
    color: #ffffff;
}

.btn-accent:hover {
    background: #b45309;
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* =========================================================
   ALERTS & NOTICES
========================================================= */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid #bae6fd;
}

/* =========================================================
   ADMIN & PORTAL LAYOUT
========================================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: #002244;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
}

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

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
}

.app-main {
    flex: 1;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.content-container {
    padding: 24px;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

/* =========================================================
   TABLES & DATA DISPLAY
========================================================= */
.table-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header-bar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* =========================================================
   TABLE RESPONSIVE CONTAINER WITH STICKY SCROLLBAR
   - Smooth horizontal & vertical scrolling
   - Auto max-height fitting viewport
   - Sleek modern scrollbar
   ========================================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 225px);
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md, 8px);
    background: #ffffff;
}

/* Modern sleek scrollbars for all table containers */
.table-responsive::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================================
   CLEAN & EFFECTIVE EXCEL-GRID TABLE DESIGN WITH STICKY HEADERS
   - Crisp Excel gridlines on all cells and headers
   - Sticky frozen thead headers so columns stay visible on scroll
   - Compact row heights
   - Alternating row striping (zebra) for readability
   - Smooth subtle hover effect
   - Zero impact on data, formulas, or script settings
   ========================================================= */
.custom-table,
.table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 11.5px;
    line-height: 1.25;
    color: #1e293b;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border-top: 1px solid #cbd5e1 !important;
    border-left: 1px solid #cbd5e1 !important;
}

/* Sticky Frozen Table Headers - Header freezes at top while rows scroll smoothly underneath */
.custom-table thead,
.table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.custom-table thead th,
.table thead th,
.custom-table th,
.table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 700;
    font-size: 11.5px;
    padding: 6px 8px; /* Compact low height */
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 2px solid #94a3b8 !important; /* Prominent bottom boundary for frozen header */
    border-top: none !important;
    border-left: none !important;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle elevation over scrolled body rows */
}

.custom-table td,
.table td {
    padding: 4px 6px; /* Compact low height */
    border-right: 1px solid #cbd5e1 !important;
    border-bottom: 1px solid #cbd5e1 !important;
    border-top: none !important;
    border-left: none !important;
    color: #334155;
    font-size: 11.5px;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

/* Subtle Zebra Striping for simple and effective reading */
.custom-table tbody tr:nth-child(even),
.table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.custom-table tbody tr:hover,
.table tbody tr:hover {
    background-color: #f1f5f9 !important;
}

/* Focused table inputs / controls inside table cells */
.custom-table td input[type="text"],
.custom-table td input[type="number"],
.custom-table td select,
.table td input[type="text"],
.table td input[type="number"],
.table td select {
    font-size: 11.5px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
    font-family: inherit;
}
.custom-table td input:focus,
.table td input:focus,
.custom-table td select:focus,
.table td select:focus {
    border-color: #0284c7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

/* =========================================================
   BADGES & STATUS
========================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid #a7f3d0; }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fde68a; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid #bae6fd; }

.badge-role {
    background: #f1f5f9;
    color: var(--primary);
    font-weight: 700;
    border: 1px solid #cbd5e1;
}

/* =========================================================
   STATUS COLOR CODING: ROW TINTS & BADGES
========================================================= */
.badge-status-completed {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.badge-status-progress {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fcd34d !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.badge-status-notstarted {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.badge-status-disputed {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

/* Status Row Color Tints & Left Indicator Stripes */
tr.work-row-completed {
    background-color: #f0fdf4 !important;
    border-left: 4px solid #16a34a !important;
}
tr.work-row-completed:hover {
    background-color: #dcfce7 !important;
}

tr.work-row-progress {
    background-color: #fffbeb !important;
    border-left: 4px solid #d97706 !important;
}
tr.work-row-progress:hover {
    background-color: #fef3c7 !important;
}

tr.work-row-notstarted {
    background-color: #ffffff !important;
    border-left: 4px solid #94a3b8 !important;
}
tr.work-row-notstarted:hover {
    background-color: #f8fafc !important;
}

tr.work-row-disputed {
    background-color: #fef2f2 !important;
    border-left: 4px solid #ef4444 !important;
}
tr.work-row-disputed:hover {
    background-color: #fee2e2 !important;
}

/* =========================================================
   PROGRESS BAR
========================================================= */
.progress-container {
    width: 100%;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* =========================================================
   CREDENTIAL BACKUP CARD / VIEWER
========================================================= */
.cred-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #cbd5e1;
}

.cred-pass-hidden {
    letter-spacing: 2px;
}

/* =========================================================
   FOOTER
========================================================= */
.portal-footer {
    margin-top: auto;
    background: #002244;
    color: #94a3b8;
    padding: 20px 24px;
    text-align: center;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-footer p {
    margin: 4px 0;
}

.portal-footer strong {
    color: #ffffff;
}

/* =========================================================
   MOBILE RESPONSIVENESS & OFF-CANVAS SIDEBAR DRAWER
========================================================= */

/* Mobile Hamburger & Backdrop */
.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--primary);
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: #e2e8f0;
    color: var(--accent);
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.sidebar-close-btn:hover {
    background: #ef4444;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 99990;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Tablet & Phone Breakpoint (max-width: 992px) */
@media (max-width: 992px) {
    .sidebar-toggle-btn {
        display: flex;
    }

    .sidebar-close-btn {
        display: flex;
    }

    .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -320px !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 99999 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background: #002244 !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .app-sidebar.mobile-open {
        left: 0 !important;
    }

    .sidebar-header {
        flex-shrink: 0 !important;
        padding: 16px 14px !important;
        background: #001f3f !important;
    }

    .sidebar-nav {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 12px 10px 100px 10px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
    }

    .app-main {
        width: 100%;
        min-width: 0;
    }

    .top-navbar {
        padding: 10px 14px;
    }

    .content-container {
        padding: 14px 12px;
    }
}

/* Phone Specific Breakpoint (max-width: 768px) */
@media (max-width: 768px) {
    .govt-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hero-split-container {
        flex-direction: column;
    }

    .hero-title-main {
        font-size: 22px;
        line-height: 1.3;
    }

    .hero-stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .hero-stat-card {
        padding: 12px !important;
    }

    .hero-stat-num {
        font-size: 20px !important;
    }

    .roles-section {
        margin-top: -10px;
    }

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

    /* Form & Filter Adjustments */
    .filter-card, .filter-toolbar, .filter-row {
        padding: 12px 10px !important;
    }

    /* Modal Responsiveness */
    .modal-overlay {
        padding: 10px !important;
    }

    .modal-content {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 92vh !important;
        margin: auto !important;
        border-radius: 12px !important;
    }

    .modal-body {
        padding: 14px 10px !important;
    }

    .modal-header {
        padding: 12px 14px !important;
    }

    /* Table Horizontal Scroll */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        overflow-y: auto;
        max-height: calc(100vh - 200px);
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        margin-bottom: 14px;
    }

    .table {
        min-width: 600px;
    }

    .table th, .table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* Small Phone Screen (max-width: 480px) */
@media (max-width: 480px) {
    .hero-stats-row {
        grid-template-columns: 1fr !important;
    }

    .top-navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
