/* ══════════════════════════════════════════════════════════════════
   MVD Taxation Portal — Modern Design System
   ══════════════════════════════════════════════════════════════════ */

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

:root {
    /* ── Primary Palette ── */
    --primary:        #2563eb;
    --primary-dark:   #1d4ed8;
    --primary-darker: #1e3a8a;
    --primary-light:  #dbeafe;
    --primary-glow:   rgba(37,99,235,0.18);

    /* ── Accent ── */
    --accent:         #0ea5e9;
    --accent-light:   #e0f2fe;

    /* ── Semantic ── */
    --success:        #10b981;
    --success-light:  #d1fae5;
    --warning:        #f59e0b;
    --warning-light:  #fef3c7;
    --danger:         #ef4444;
    --danger-light:   #fee2e2;
    --info:           #6366f1;
    --info-light:     #e0e7ff;

    /* ── Surface ── */
    --bg:             #f1f5f9;
    --surface:        #ffffff;
    --surface-2:      #f8fafc;

    /* ── Sidebar ── */
    --sidebar-bg:           #0a0f1e;
    --sidebar-surface:      #131929;
    --sidebar-hover:        rgba(37,99,235,0.12);
    --sidebar-active-bg:    #2563eb;
    --sidebar-active-glow:  rgba(37,99,235,0.35);
    --sidebar-text:         #8b9cbf;
    --sidebar-text-hover:   #e2e8f0;
    --sidebar-border:       rgba(255,255,255,0.05);
    --sidebar-width:        256px;

    /* ── Text ── */
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;

    /* ── Border ── */
    --border:         #e2e8f0;
    --border-light:   #f1f5f9;

    /* ── Shadow ── */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow:    0 4px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.14);

    /* ── Typography ── */
    --font:      'Inter', 'Noto Sans', system-ui, sans-serif;
    --font-size: 14px;

    /* ── Radius ── */
    --r-sm: 6px;
    --r:    10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* ── Transition ── */
    --t: all 0.18s ease;
    --t-slow: all 0.3s ease;
}

/* ── Accessibility font sizes ─── */
body.font-sm  { font-size: 12px; }
body.font-lg  { font-size: 16px; }
body.high-contrast { filter: contrast(1.5) brightness(1.1); }

/* ─────────────────────────────────────────────────
   BASE
───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    font-size: var(--font-size);
    color: var(--text-primary);
    background: var(--bg);
    margin: 0; padding: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Skip Nav ── */
.skip-nav {
    position: absolute; top: -60px; left: 0; z-index: 9999;
    background: var(--primary); color: #fff;
    padding: 8px 20px; font-size: 13px; font-weight: 600;
    border-radius: 0 0 var(--r) 0;
    transition: top 0.2s;
}
.skip-nav:focus { top: 0; }

/* ─────────────────────────────────────────────────
   ACCESS BAR
───────────────────────────────────────────────── */
#gov-access-bar {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    padding: 4px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--sidebar-text);
}
#gov-access-bar .access-label { font-weight: 600; margin-right: 2px; opacity: 0.7; }
#gov-access-bar button {
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent; color: var(--sidebar-text);
    padding: 2px 9px; border-radius: var(--r-full);
    font-size: 11px; cursor: pointer; font-family: var(--font);
    transition: var(--t);
}
#gov-access-bar button:hover,
#gov-access-bar button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
#gov-access-bar .sep { color: rgba(255,255,255,0.1); }
#gov-access-bar a { color: var(--sidebar-text); font-size: 11px; }
#gov-access-bar a:hover { color: #fff; }

/* ─────────────────────────────────────────────────
   HEADER
───────────────────────────────────────────────── */
.gov-header {
    background: linear-gradient(120deg, #060d1f 0%, #0f2458 45%, #1e40af 100%);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(6,13,31,0.45);
}
.gov-header::after {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.gov-emblem img {
    height: 66px; width: auto;
    filter: drop-shadow(0 3px 10px rgba(0,0,0,0.4));
    position: relative; z-index: 1;
}
.gov-site-info { flex: 1; position: relative; z-index: 1; }
.gov-site-title {
    font-size: 21px; font-weight: 800; color: #fff;
    letter-spacing: 2px; text-transform: uppercase;
    line-height: 1.15; margin: 0;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.gov-site-subtitle {
    font-size: 12px;
    color: rgba(191,219,254,0.85);
    margin-top: 4px; letter-spacing: 0.2px;
    font-weight: 400;
}
.gov-header-right {
    display: flex; align-items: center; gap: 10px;
    position: relative; z-index: 1;
}
.gov-header-right .user-pill {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: var(--r-full);
    padding: 7px 16px;
    color: #fff; font-size: 13px; font-weight: 600;
    backdrop-filter: blur(10px);
}
.gov-header-right .btn-hdr {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.9);
    padding: 7px 16px;
    border-radius: var(--r-full);
    font-size: 12px; font-weight: 500;
    transition: var(--t); text-decoration: none;
}
.gov-header-right .btn-hdr:hover { background: rgba(255,255,255,0.2); color: #fff; }
.gov-header-right .btn-hdr.danger { background: rgba(239,68,68,0.8); border-color: rgba(239,68,68,0.6); }
.gov-header-right .btn-hdr.danger:hover { background: #ef4444; }

/* ─────────────────────────────────────────────────
   TOP NAVBAR  (Masters menu + flash messages)
───────────────────────────────────────────────── */
.gov-navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex; align-items: center; gap: 8px;
    min-height: 46px;
    box-shadow: var(--shadow-xs);
    position: sticky; top: 0; z-index: 100;
}
.gov-navbar .nav-link {
    color: var(--text-secondary) !important;
    font-size: 13px; font-weight: 500;
    padding: 12px 14px !important;
    display: flex; align-items: center; gap: 6px;
    border-radius: var(--r-sm);
    transition: var(--t);
}
.gov-navbar .nav-link:hover,
.gov-navbar .nav-link:focus {
    color: var(--primary) !important;
    background: var(--primary-light);
}
.gov-navbar .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: 8px;
    min-width: 240px;
    margin-top: 4px !important;
}
.gov-navbar .dropdown-item {
    padding: 9px 12px;
    border-radius: var(--r-sm);
    color: var(--text-primary);
    font-size: 13px;
    display: flex; align-items: center; gap: 10px;
    transition: var(--t);
}
.gov-navbar .dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.gov-navbar .dropdown-item .fa-solid { width: 16px; color: var(--text-muted); font-size: 12px; }
.gov-navbar .dropdown-item:hover .fa-solid { color: var(--primary); }
.gov-navbar .dropdown-divider { border-color: var(--border-light); margin: 4px 8px; }

/* ─────────────────────────────────────────────────
   LAYOUT WRAPPER
───────────────────────────────────────────────── */
#gov-wrapper {
    display: flex;
    min-height: calc(100vh - 180px);
}
#gov-main { display: flex; flex: 1; }

/* ─────────────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────────────── */
#gov-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    padding: 12px 10px 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Section group label */
.sidebar-group-label {
    padding: 12px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(139,156,191,0.45);
    user-select: none;
}

/* Every clickable row in sidebar */
#gov-sidebar .sb-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    font-size: 13px; font-weight: 500;
    color: var(--sidebar-text);
    text-decoration: none; cursor: pointer;
    transition: var(--t);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none; background: none; width: 100%; text-align: left;
    outline: none;
}
#gov-sidebar .sb-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}
#gov-sidebar li.active > .sb-item,
#gov-sidebar .sb-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--sidebar-active-glow);
    font-weight: 600;
}
#gov-sidebar .sb-item .sb-icon {
    font-size: 14px; width: 18px; text-align: center; flex-shrink: 0;
    opacity: 0.8;
}
#gov-sidebar li.active > .sb-item .sb-icon,
#gov-sidebar .sb-item.active .sb-icon { opacity: 1; }

/* Collapsible report groups */
.sb-group-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.8px; text-transform: uppercase;
    color: rgba(139,156,191,0.65);
    cursor: pointer; transition: var(--t);
    user-select: none;
}
.sb-group-header:hover { background: var(--sidebar-hover); color: var(--sidebar-text-hover); }
.sb-group-header .chevron { font-size: 10px; transition: transform 0.2s; }
.sb-group-header.open .chevron { transform: rotate(180deg); }
.sb-group-body { padding-left: 8px; }

#gov-sidebar ul { list-style: none; padding: 0; margin: 0; }
#gov-sidebar hr.sb-divider {
    border: none; border-top: 1px solid var(--sidebar-border);
    margin: 8px 12px;
}

/* ─────────────────────────────────────────────────
   CONTENT AREA
───────────────────────────────────────────────── */
#gov-content {
    flex: 1;
    padding: 24px;
    background: var(--bg);
    overflow-x: auto;
    min-height: 500px;
}

/* Current section breadcrumb pill */
#gov-tab-label {
    display: none;
    align-items: center; gap: 8px;
    padding: 9px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600;
    color: var(--primary);
    margin-bottom: 18px;
    box-shadow: var(--shadow-xs);
}
#gov-tab-label.active { display: flex; }

/* ─────────────────────────────────────────────────
   CARDS
───────────────────────────────────────────────── */
.gov-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.gov-card-title {
    font-size: 14px; font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 10px;
}
.gov-card-title::before {
    content: ''; display: inline-block;
    width: 3px; height: 16px;
    background: var(--primary); border-radius: 3px;
}

/* ─────────────────────────────────────────────────
   TABLES
───────────────────────────────────────────────── */
.table { font-size: 13px; margin-bottom: 0; }
.table thead th {
    background: var(--primary);
    color: #fff; border: none;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    padding: 12px 14px; white-space: nowrap;
}
.table thead th:first-child { border-radius: var(--r-sm) 0 0 0; }
.table thead th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.table tbody td {
    padding: 11px 14px;
    color: var(--text-secondary);
    border-color: var(--border-light);
    vertical-align: middle;
}
.table tbody tr { transition: var(--t); }
.table tbody tr:hover td { background: var(--primary-light) !important; color: var(--primary-darker); }
.table-bordered { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.table-bordered td, .table-bordered th { border-color: var(--border-light) !important; }

/* ─────────────────────────────────────────────────
   FORMS
───────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; }
.form-control, .form-select {
    font-size: 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    transition: var(--t);
    font-family: var(--font);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}
.form-control::placeholder { color: var(--text-muted); }

/* ─────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────── */
.btn { font-weight: 600; font-size: 13px; border-radius: var(--r-sm); transition: var(--t); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-warning { background: var(--warning); border-color: var(--warning); }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  }
.btn-gov-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none;
    box-shadow: 0 4px 14px var(--primary-glow);
    padding: 9px 22px;
}
.btn-gov-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }

/* ─────────────────────────────────────────────────
   FLASH MESSAGES / ALERTS
───────────────────────────────────────────────── */
.server_msg { flex: 1; min-width: 0; }
.server_msg .alert {
    font-size: 13px; border: none;
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    margin: 4px 0 0;
    padding: 10px 16px;
}
.alert-success { background: var(--success-light); color: #065f46; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; }
.alert-warning { background: var(--warning-light); color: #92400e; }
.alert-info    { background: var(--info-light);    color: #3730a3; }

/* ─────────────────────────────────────────────────
   MODALS
───────────────────────────────────────────────── */
.modal-content { border: none; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.modal-header {
    background: linear-gradient(135deg, var(--primary-darker), var(--primary));
    color: #fff; border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 14px 20px;
}
.modal-title { font-weight: 700; font-size: 15px; margin: 0; }
.modal-header .btn-close-white { filter: brightness(0) invert(1); }
.modal-footer { border-color: var(--border-light); }

/* ─────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────── */
#gov-footer {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 18px 24px;
    font-size: 12px;
    border-top: 1px solid var(--sidebar-border);
}
#gov-footer a { color: var(--sidebar-text); transition: var(--t); }
#gov-footer a:hover { color: #fff; }
#gov-footer .footer-top {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding-bottom: 12px; margin-bottom: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}
#gov-footer .footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
#gov-footer .footer-bottom { text-align: center; font-size: 11px; opacity: 0.5; }
#gov-footer .nic-logo { height: 20px; filter: brightness(0) invert(0.65); }

/* ─────────────────────────────────────────────────
   LOGIN PAGE  (public layout)
───────────────────────────────────────────────── */
.login-page-bg {
    min-height: calc(100vh - 200px);
    background: linear-gradient(135deg, #060d1f 0%, #0f2458 50%, #1e3a8a 100%);
    display: flex; align-items: stretch;
}
.login-brand-panel {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 48px;
    position: relative; overflow: hidden;
}
.login-brand-panel::before {
    content: '';
    position: absolute; top: -100px; left: -100px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.login-brand-panel img.brand-transport {
    max-width: 340px; width: 80%;
    opacity: 0.85;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
    margin-bottom: 32px;
    position: relative; z-index: 1;
}
.login-brand-headline {
    text-align: center; position: relative; z-index: 1;
    color: rgba(255,255,255,0.9);
}
.login-brand-headline h2 {
    font-size: 24px; font-weight: 800; letter-spacing: 1px;
    color: #fff; margin-bottom: 10px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.login-brand-headline p {
    font-size: 14px; color: rgba(191,219,254,0.75);
    max-width: 340px; line-height: 1.6;
}
.login-form-panel {
    width: 440px; min-width: 380px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(16px);
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 44px;
    box-shadow: -10px 0 60px rgba(0,0,0,0.25);
}
.login-form-panel .login-panel-title {
    font-size: 22px; font-weight: 800; color: var(--text-primary);
    margin-bottom: 6px;
}
.login-form-panel .login-panel-subtitle {
    font-size: 13px; color: var(--text-muted); margin-bottom: 32px;
}

/* Login form panel content */
#login-content .alert { font-size: 13px; margin-bottom: 16px; border-radius: var(--r-sm); }

/* ─────────────────────────────────────────────────
   PRINT
───────────────────────────────────────────────── */
@media print {
    #gov-access-bar, .gov-navbar, #gov-sidebar, #gov-footer { display: none !important; }
    #gov-content { padding: 0; background: #fff; }
    .gov-header { box-shadow: none; }
}

/* ─────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────── */
@media (max-width: 960px) {
    #gov-sidebar { display: none; }
    .gov-header-right .user-pill { display: none; }
}
@media (max-width: 768px) {
    .gov-header { padding: 10px 16px; }
    .gov-site-title { font-size: 16px; letter-spacing: 1px; }
    #gov-content { padding: 16px; }
    #gov-access-bar { display: none; }
    .login-brand-panel { display: none; }
    .login-form-panel { width: 100%; min-width: auto; padding: 32px 24px; }
}
