/* ============================================================
   CDMS Government Theme — Design System
   United States Government Inspired Professional Theme
   ============================================================ */

/* === Design Tokens === */
:root {
    /* Primary palette */
    --navy:          #002147;
    --navy-dark:     #001529;
    --navy-light:    #003366;
    --gold:          #c5a44e;
    --gold-light:    #d4b96a;
    --gold-dark:     #a88a3a;

    /* Neutrals */
    --white:         #ffffff;
    --gray-50:       #f7f8fa;
    --gray-100:      #eef0f4;
    --gray-200:      #dde1e8;
    --gray-300:      #c4c9d4;
    --gray-400:      #9aa0ad;
    --gray-500:      #6b7280;
    --gray-600:      #4b5563;
    --gray-700:      #374151;
    --gray-800:      #1f2937;
    --gray-900:      #111827;

    /* Semantic colors */
    --danger:        #b91c1c;
    --danger-light:  #fef2f2;
    --danger-border: #fca5a5;
    --success:       #15803d;
    --success-light: #f0fdf4;
    --success-border:#86efac;
    --warning:       #a16207;
    --warning-light: #fefce8;
    --warning-border:#fde68a;
    --info:          #0369a1;
    --info-light:    #f0f9ff;
    --info-border:   #7dd3fc;

    /* Typography */
    --font-heading:  'Georgia', 'Times New Roman', serif;
    --font-body:     'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --font-mono:     'Consolas', 'Courier New', monospace;

    /* Spacing */
    --sidebar-width: 260px;

    /* Shadows */
    --shadow-sm:     0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:     0 4px 6px rgba(0,0,0,0.08);
    --shadow-lg:     0 10px 25px rgba(0,0,0,0.12);
}


/* === Dark Mode Tokens === */
[data-theme="dark"] {
    --navy:          #1a2d47;
    --navy-dark:     #0f1a2e;
    --navy-light:    #243b5c;
    --gold:          #d4b96a;
    --gold-light:    #e0ca85;
    --gold-dark:     #b89a4a;

    --white:         #1a1e2a;
    --gray-50:       #1e2235;
    --gray-100:      #232840;
    --gray-200:      #2e3450;
    --gray-300:      #3d4560;
    --gray-400:      #6b7280;
    --gray-500:      #9aa0ad;
    --gray-600:      #b0b6c3;
    --gray-700:      #d0d4dd;
    --gray-800:      #e8eaf0;
    --gray-900:      #f5f5f7;

    --danger:        #ef4444;
    --danger-light:  #2d1a1a;
    --danger-border: #7f1d1d;
    --success:       #22c55e;
    --success-light: #1a2d1a;
    --success-border:#166534;
    --warning:       #eab308;
    --warning-light: #2d2a1a;
    --warning-border:#854d0e;
    --info:          #38bdf8;
    --info-light:    #1a2535;
    --info-border:   #075985;

    --shadow-sm:     0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:     0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg:     0 10px 25px rgba(0,0,0,0.5);
}

/* --- Dark: Global resets --- */
[data-theme="dark"] body {
    color-scheme: dark;
}

[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4,
[data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: #e8eaf0;
}

[data-theme="dark"] a {
    color: #d4b96a;
}
[data-theme="dark"] a:hover {
    color: #e0ca85;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] label,
[data-theme="dark"] .text-muted {
    color: #b0b6c3;
}

/* --- Dark: Classification banners (keep readable on colored bg) --- */
[data-theme="dark"] .classification-banner {
    color: #000;
}
[data-theme="dark"] .document-card-header {
    color: #000;
}

/* --- Dark: Official bar --- */
[data-theme="dark"] .official-bar {
    background: #1a1e2a;
    border-bottom-color: #2e3450;
    color: #9aa0ad;
}

/* --- Dark: Government header --- */
[data-theme="dark"] .gov-header {
    background: #0c1220;
    border-bottom-color: #d4b96a;
}
[data-theme="dark"] .gov-header-brand .brand-text {
    color: #e8eaf0;
}
[data-theme="dark"] .gov-header-brand .brand-text span {
    color: #d4b96a;
}
[data-theme="dark"] .gov-header-user {
    color: #9aa0ad;
}
[data-theme="dark"] .gov-header-user .username {
    color: #e8eaf0;
}
[data-theme="dark"] .gov-header a.logout-btn {
    color: #d4b96a;
    border-color: #b89a4a;
}
[data-theme="dark"] .gov-header a.logout-btn:hover {
    background: #d4b96a;
    color: #0f1a2e;
}

/* --- Dark: Government footer --- */
[data-theme="dark"] .gov-footer {
    background: #0a0f1a;
    color: #6b7280;
}
[data-theme="dark"] .gov-footer a {
    color: #d4b96a;
}
[data-theme="dark"] .gov-footer .footer-monitoring {
    color: #6b7280;
}
[data-theme="dark"] .footer {
    color: #6b7280;
    border-top-color: #2e3450;
}

/* --- Dark: Page header --- */
[data-theme="dark"] .page-header {
    border-bottom-color: #2e3450;
}
[data-theme="dark"] .page-header h1 {
    color: #e8eaf0;
}

/* --- Dark: Buttons --- */
[data-theme="dark"] .btn-primary {
    background: #d4b96a;
    color: #0f1a2e;
    border-color: #d4b96a;
}
[data-theme="dark"] .btn-primary:hover {
    background: #e0ca85;
    color: #0f1a2e;
}
[data-theme="dark"] .btn-gold {
    background: #d4b96a;
    color: #0f1a2e;
    border-color: #d4b96a;
}
[data-theme="dark"] .btn-gold:hover {
    background: #e0ca85;
    color: #0f1a2e;
}
[data-theme="dark"] .btn-secondary {
    background: #1e2235;
    color: #d0d4dd;
    border-color: #3d4560;
}
[data-theme="dark"] .btn-secondary:hover {
    background: #232840;
    color: #e8eaf0;
    border-color: #6b7280;
}
[data-theme="dark"] .btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
[data-theme="dark"] .btn-danger:hover {
    background: #ef4444;
    color: #fff;
}
[data-theme="dark"] .btn-success {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
[data-theme="dark"] .btn-success:hover {
    background: #22c55e;
    color: #fff;
}

/* --- Dark: Forms --- */
[data-theme="dark"] .form-card {
    background: #1e2235;
    border-color: #2e3450;
}
[data-theme="dark"] .form-label {
    color: #d0d4dd;
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: #232840;
    border-color: #3d4560;
    color: #e8eaf0;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: #d4b96a;
    box-shadow: 0 0 0 2px rgba(212,185,106,0.2);
}
[data-theme="dark"] .form-control::placeholder {
    color: #6b7280;
}
[data-theme="dark"] .form-text {
    color: #9aa0ad;
}
[data-theme="dark"] .form-control-file {
    color: #b0b6c3;
}
[data-theme="dark"] .form-check-input {
    accent-color: #d4b96a;
}
[data-theme="dark"] .form-check-label {
    color: #d0d4dd;
}

/* --- Dark: Tables --- */
[data-theme="dark"] .data-table {
    background: #1a1e2a;
    border-color: #2e3450;
}
[data-theme="dark"] .data-table th {
    background: #0c1220;
    color: #d0d4dd;
    border-bottom-color: #d4b96a;
}
[data-theme="dark"] .data-table td {
    color: #b0b6c3;
    border-bottom-color: #2e3450;
}
[data-theme="dark"] .data-table tr:hover td {
    background: rgba(212,185,106,0.05);
}
[data-theme="dark"] .sort-link {
    color: #9aa0ad;
}
[data-theme="dark"] .sort-link:hover,
[data-theme="dark"] .sort-link.active {
    color: #d4b96a;
}
[data-theme="dark"] .details-cell summary {
    color: #d4b96a;
}
[data-theme="dark"] .details-cell pre {
    color: #9aa0ad;
}
[data-theme="dark"] .hash-display {
    color: #6b7280;
}

/* --- Dark: Badges --- */
[data-theme="dark"] .badge-role {
    background: rgba(212,185,106,0.15);
    color: #d4b96a;
}
[data-theme="dark"] .badge-action {
    background: #232840;
    color: #b0b6c3;
    border-color: #3d4560;
}
[data-theme="dark"] .badge-compartment {
    background: rgba(167,139,250,0.15);
    color: #a78bfa;
    border-color: rgba(167,139,250,0.3);
}
[data-theme="dark"] .badge-dissemination {
    background: rgba(234,179,8,0.15);
    color: #eab308;
    border-color: rgba(234,179,8,0.3);
}
[data-theme="dark"] .badge-active {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
    border-color: rgba(34,197,94,0.3);
}
[data-theme="dark"] .badge-inactive {
    background: #232840;
    color: #6b7280;
}
[data-theme="dark"] .badge-locked {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
}
[data-theme="dark"] .badge-current {
    background: rgba(212,185,106,0.15);
    color: #d4b96a;
    border-color: rgba(212,185,106,0.3);
}

/* --- Dark: Stat cards --- */
[data-theme="dark"] .stat-card {
    background: #1e2235;
    border-color: #2e3450;
    border-top-color: #d4b96a;
}
[data-theme="dark"] .stat-value {
    color: #d4b96a;
}
[data-theme="dark"] .stat-label {
    color: #9aa0ad;
}
[data-theme="dark"] .stat-detail {
    color: #b0b6c3;
}
[data-theme="dark"] .stat-count {
    color: #d4b96a;
}
[data-theme="dark"] .stat-bar {
    background: #2e3450;
}
[data-theme="dark"] .stat-bar-fill {
    background: #d4b96a;
}

/* --- Dark: Dashboard sections --- */
[data-theme="dark"] .dashboard-section,
[data-theme="dark"] .section,
[data-theme="dark"] .stats-section {
    background: #1e2235;
    border-color: #2e3450;
}
[data-theme="dark"] .dashboard-section h2,
[data-theme="dark"] .section h2,
[data-theme="dark"] .stats-section h2 {
    color: #e8eaf0;
    border-bottom-color: #d4b96a;
}

/* --- Dark: Document cards --- */
[data-theme="dark"] .document-card {
    background: #1e2235;
    border-color: #2e3450;
}
[data-theme="dark"] .document-card:hover {
    border-color: #d4b96a;
    box-shadow: 0 4px 12px rgba(212,185,106,0.1);
}
[data-theme="dark"] .document-card-body h3 {
    color: #e8eaf0;
}
[data-theme="dark"] .document-card-body h3 a {
    color: #e8eaf0;
}
[data-theme="dark"] .document-card-body h3 a:hover {
    color: #d4b96a;
}
[data-theme="dark"] .document-desc {
    color: #9aa0ad;
}
[data-theme="dark"] .document-meta {
    color: #6b7280;
}
[data-theme="dark"] .document-meta span {
    color: #6b7280;
}

/* --- Dark: Doc stats bar --- */
[data-theme="dark"] .doc-stat-chip {
    background: #1e2235;
    border-color: #2e3450;
}
[data-theme="dark"] .doc-stat-chip .chip-value {
    color: #d4b96a;
}
[data-theme="dark"] .doc-stat-chip .chip-label {
    color: #9aa0ad;
}

/* --- Dark: Filter chips --- */
[data-theme="dark"] .filter-chip {
    background: #1e2235;
    border-color: #3d4560;
    color: #9aa0ad;
}
[data-theme="dark"] .filter-chip:hover,
[data-theme="dark"] .filter-chip.active {
    background: #d4b96a;
    color: #0f1a2e;
    border-color: #d4b96a;
}

/* --- Dark: Document detail --- */
[data-theme="dark"] .document-info-grid {
    background: #1e2235;
    border-color: #2e3450;
}
[data-theme="dark"] .info-item label {
    color: #6b7280;
}
[data-theme="dark"] .info-item span {
    color: #d0d4dd;
}
[data-theme="dark"] .document-description {
    background: #1e2235;
    border-color: #2e3450;
}
[data-theme="dark"] .document-description p {
    color: #b0b6c3;
}
[data-theme="dark"] .document-access-list {
    background: #1e2235;
    border-color: #2e3450;
}
[data-theme="dark"] .document-access-list li {
    color: #b0b6c3;
    border-bottom-color: #232840;
}

/* --- Dark: Filter bar --- */
[data-theme="dark"] .filter-bar {
    background: #1e2235;
    border-color: #2e3450;
}

/* --- Dark: Search --- */
[data-theme="dark"] .results-count {
    color: #b0b6c3;
}

/* --- Dark: Info box --- */
[data-theme="dark"] .info-box {
    background: #1a2535;
    border-color: #075985;
}
[data-theme="dark"] .info-box h3 {
    color: #38bdf8;
}
[data-theme="dark"] .info-box p,
[data-theme="dark"] .info-box ol,
[data-theme="dark"] .info-box li {
    color: #b0b6c3;
}

/* --- Dark: Verification --- */
[data-theme="dark"] .verification-pass {
    background: #1a2d1a;
    border-color: #22c55e;
}
[data-theme="dark"] .verification-fail {
    background: #2d1a1a;
    border-color: #ef4444;
}
[data-theme="dark"] .verification-pass h2 { color: #22c55e; }
[data-theme="dark"] .verification-fail h2 { color: #ef4444; }
[data-theme="dark"] .verification-pass .verification-icon { color: #22c55e; }
[data-theme="dark"] .verification-fail .verification-icon { color: #ef4444; }
[data-theme="dark"] .verification-result p {
    color: #b0b6c3;
}

/* --- Dark: Alerts --- */
[data-theme="dark"] .alert-success { background: #1a2d1a; color: #22c55e; }
[data-theme="dark"] .alert-danger  { background: #2d1a1a; color: #ef4444; }
[data-theme="dark"] .alert-warning { background: #2d2a1a; color: #eab308; }
[data-theme="dark"] .alert-info    { background: #1a2535; color: #38bdf8; }

/* --- Dark: Pagination --- */
[data-theme="dark"] .page-link {
    background: #1e2235;
    border-color: #3d4560;
    color: #b0b6c3;
}
[data-theme="dark"] .page-link:hover {
    border-color: #d4b96a;
    color: #d4b96a;
    background: #232840;
}
[data-theme="dark"] .page-link.active {
    background: #d4b96a;
    color: #0f1a2e;
    border-color: #d4b96a;
}
[data-theme="dark"] .page-ellipsis {
    color: #6b7280;
}

/* --- Dark: Auth pages --- */
[data-theme="dark"] .auth-card {
    background: #1e2235;
    border-color: #2e3450;
    border-top-color: #d4b96a;
}
[data-theme="dark"] .auth-card h1 {
    color: #e8eaf0;
}
[data-theme="dark"] .auth-subtitle {
    color: #9aa0ad;
}
[data-theme="dark"] .auth-link {
    color: #b0b6c3;
}

/* --- Dark: User info section --- */
[data-theme="dark"] .user-info-section {
    border-top-color: #2e3450;
}
[data-theme="dark"] .user-info-section h3 {
    color: #e8eaf0;
}
[data-theme="dark"] .user-info-section p {
    color: #b0b6c3;
}
[data-theme="dark"] .user-info-section strong {
    color: #d0d4dd;
}

/* --- Dark: Error pages --- */
[data-theme="dark"] .error-page h1 {
    color: #e8eaf0;
}
[data-theme="dark"] .error-page p {
    color: #b0b6c3;
}

/* --- Dark: Empty state --- */
[data-theme="dark"] .empty-state {
    color: #6b7280;
}

/* --- Dark: Select option dropdown --- */
[data-theme="dark"] option {
    background: #232840;
    color: #e8eaf0;
}

/* --- Dark: Scrollbar --- */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1e2a;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3d4560;
    border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* === Theme Toggle Button === */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.15s;
    font-family: var(--font-body);
}
.theme-toggle:hover {
    background: var(--gold);
    color: var(--navy);
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--navy);
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--navy-light);
    text-decoration: none;
}
a:hover {
    color: var(--navy);
    text-decoration: underline;
}

/* === Classification Banners (inline override for gov theme) === */
.classification-banner {
    text-align: center;
    padding: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #000;
    z-index: 9999;
    position: relative;
}

/* === Official Bar (login.gov style) === */
.official-bar {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    padding: 6px 24px;
    font-size: 0.78rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 8px;
}
.official-bar .flag-icon {
    font-size: 0.9rem;
}

/* === Government Header === */
.gov-header {
    background: var(--navy);
    color: var(--white);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    border-bottom: 3px solid var(--gold);
}
.gov-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.gov-header-brand .seal-mini {
    width: 36px;
    height: 36px;
}
.gov-header-brand .brand-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white);
}
.gov-header-brand .brand-text span {
    color: var(--gold);
}
.gov-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.gov-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--gray-300);
}
.gov-header-user .username {
    color: var(--white);
    font-weight: 600;
}
.gov-header a.logout-btn {
    background: transparent;
    border: 1px solid var(--gold-dark);
    color: var(--gold);
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s;
}
.gov-header a.logout-btn:hover {
    background: var(--gold);
    color: var(--navy);
    text-decoration: none;
}

/* === App Layout (sidebar + main) === */
.app-layout {
    display: flex;
    min-height: calc(100vh - 120px);
}

/* === Main Content Area === */
.main-content {
    flex: 1;
    padding: 28px 36px;
    min-width: 0;
    background: var(--gray-50);
}

/* === Container (for non-sidebar pages) === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* === Page Header === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
}
.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === Alerts === */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid;
    font-size: 0.9rem;
}
.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success); }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger); }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning); }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: var(--info); }

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.5;
    letter-spacing: 0.3px;
    font-family: var(--font-body);
}
.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.btn-primary:hover {
    background: var(--navy-light);
    color: var(--white);
}

.btn-gold {
    background: var(--gold);
    color: var(--navy-dark);
    border-color: var(--gold);
    font-weight: 700;
}
.btn-gold:hover {
    background: var(--gold-light);
    color: var(--navy-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--navy);
    border-color: var(--gray-400);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #991b1b;
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}
.btn-success:hover { opacity: 0.9; color: var(--white); }

.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }

/* === Forms === */
.form-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 28px;
    max-width: 640px;
    box-shadow: var(--shadow-sm);
}
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.form-control, .form-select {
    width: 100%;
    padding: 9px 12px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--gray-800);
    font-size: 0.9rem;
    font-family: var(--font-body);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--navy);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,33,71,0.12);
}
.form-control-file {
    padding: 8px 0;
    color: var(--gray-600);
}
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
.form-error {
    display: block;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
}
.form-text {
    display: block;
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 4px;
}
.has-error .form-control,
.has-error .form-select {
    border-color: var(--danger);
}
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.form-check-input { accent-color: var(--navy); }
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    padding: 8px 0;
}
.form-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.inline-form { display: inline; }

/* === Tables === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.data-table th {
    background: var(--navy);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--white);
    border-bottom: 2px solid var(--gold);
}
.sort-link {
    color: var(--white);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.sort-link:hover {
    color: var(--gold);
}
.sort-link.active {
    color: var(--gold);
}
.sort-arrow {
    font-size: 0.65rem;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
    vertical-align: middle;
    color: var(--gray-700);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td {
    background: rgba(0,33,71,0.03);
}
.row-inactive { opacity: 0.5; }

.action-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}
.details-cell pre {
    font-size: 0.75rem;
    max-width: 300px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--gray-600);
}
.details-cell summary {
    cursor: pointer;
    color: var(--navy-light);
    font-size: 0.8rem;
    font-weight: 600;
}
.hash-display {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--gray-500);
    word-break: break-all;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge-role        { background: rgba(0,33,71,0.1); color: var(--navy); }
.badge-action      { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge-compartment { background: rgba(107,39,142,0.1); color: #7c3aed; border: 1px solid rgba(107,39,142,0.2); }
.badge-dissemination { background: rgba(161,98,7,0.1); color: var(--warning); border: 1px solid rgba(161,98,7,0.2); }
.badge-active      { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.badge-inactive    { background: var(--gray-100); color: var(--gray-500); }
.badge-locked      { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-current     { background: rgba(0,33,71,0.1); color: var(--navy); border: 1px solid rgba(0,33,71,0.2); }

/* === Document Cards === */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.document-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
}
.document-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--navy-light);
}
.document-card-header {
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    text-transform: uppercase;
    color: #000;
}
.document-card-body {
    padding: 16px;
}
.document-card-body h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--navy);
}
.document-card-body h3 a {
    color: inherit;
}
.document-card-body h3 a:hover {
    color: var(--navy-light);
    text-decoration: underline;
}
.document-desc {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-bottom: 10px;
    line-height: 1.5;
}
.document-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--gray-500);
    flex-wrap: wrap;
}
.document-compartments {
    margin-top: 8px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* === Document Stats Cards (documents page) === */
.doc-stats-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.doc-stat-chip {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 12px 20px;
    text-align: center;
    min-width: 110px;
    box-shadow: var(--shadow-sm);
}
.doc-stat-chip .chip-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    font-family: var(--font-heading);
}
.doc-stat-chip .chip-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 600;
}

/* === Filter Chips === */
.filter-chips {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-chip {
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.filter-chip:hover, .filter-chip.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    text-decoration: none;
}

/* === Document Detail === */
.document-detail { max-width: 960px; }
.document-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.document-detail-header h1 { font-size: 1.5rem; }
.document-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.document-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.info-item label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
}
.info-item span { font-size: 0.9rem; color: var(--gray-700); }
.document-description {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.document-description h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}
.document-access-list {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.document-access-list h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}
.document-access-list ul { list-style: none; padding: 0; }
.document-access-list li {
    padding: 6px 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
}
.document-access-list li:last-child { border-bottom: none; }

/* === Auth Pages (basic — overridden by login-page.css for split layout) === */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.auth-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--navy);
}
.auth-card h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 6px;
    color: var(--navy);
}
.auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 24px;
}
.auth-link {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 16px;
}
.auth-warning, .auth-info {
    margin-top: 20px;
    padding: 12px;
    font-size: 0.8rem;
    line-height: 1.6;
}
.auth-warning {
    background: var(--danger-light);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}
.auth-info {
    background: var(--info-light);
    border-left: 4px solid var(--info);
    color: var(--info);
}

/* === Stats === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--navy);
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    font-family: var(--font-heading);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.stat-detail {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.dashboard-section, .section, .stats-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.dashboard-section h2, .section h2, .stats-section h2 {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: var(--navy);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
}
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.classification-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.class-stat-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.stat-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    background: var(--navy);
    min-width: 2px;
}
.stat-count {
    font-weight: 700;
    min-width: 30px;
    text-align: right;
    color: var(--navy);
}
.stats-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === Search === */
.search-form-container { margin-bottom: 20px; }
.search-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-row .form-control { flex: 1; }
.search-row .form-select { width: 200px; }
.results-count {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-bottom: 12px;
    font-weight: 600;
}

/* === Filter Bar === */
.filter-bar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    padding: 14px;
    margin-bottom: 20px;
}

/* === Access Management === */
.access-management .section { margin-bottom: 20px; }
.info-box {
    background: var(--info-light);
    border: 1px solid var(--info-border);
}
.info-box h3 { color: var(--info); border-bottom: none; }
.info-box p, .info-box ol { font-size: 0.875rem; color: var(--gray-700); }
.info-box ol { padding-left: 20px; }
.info-box li { margin-bottom: 6px; }

/* === Verification === */
.verification-result {
    text-align: center;
    padding: 48px;
    margin-bottom: 24px;
}
.verification-pass {
    background: var(--success-light);
    border: 2px solid var(--success);
}
.verification-fail {
    background: var(--danger-light);
    border: 2px solid var(--danger);
}
.verification-icon {
    font-size: 4rem;
    margin-bottom: 12px;
}
.verification-pass .verification-icon { color: var(--success); }
.verification-fail .verification-icon { color: var(--danger); }
.verification-pass h2 { color: var(--success); }
.verification-fail h2 { color: var(--danger); }

/* === Error Pages === */
.error-page {
    text-align: center;
    padding: 60px 24px;
}
.error-page h1 {
    font-size: 2rem;
    margin-bottom: 12px;
    color: var(--navy);
}
.error-page p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--gray-500);
    font-style: italic;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}
.page-link {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    font-size: 0.85rem;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
}
.page-link:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.page-link.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.page-ellipsis { padding: 6px 8px; color: var(--gray-400); }

/* === Government Footer === */
.gov-footer {
    background: var(--navy-dark);
    color: var(--gray-400);
    padding: 24px 32px;
    font-size: 0.78rem;
    border-top: 3px solid var(--gold);
}
.gov-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
}
.gov-footer a {
    color: var(--gold);
    text-decoration: none;
}
.gov-footer a:hover {
    color: var(--gold-light);
    text-decoration: underline;
}
.gov-footer .footer-monitoring {
    color: var(--gray-500);
    font-style: italic;
}

/* Basic footer for error pages */
.footer {
    text-align: center;
    padding: 16px;
    font-size: 0.75rem;
    color: var(--gray-500);
    border-top: 1px solid var(--gray-200);
}

/* === User Info Section === */
.user-info-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-200);
}
.user-info-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}
.user-info-section p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 6px;
}

/* === Misc === */
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }

/* === Responsive === */
@media (max-width: 768px) {
    .gov-header { padding: 0 12px; height: auto; padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
    .main-content { padding: 16px; }
    .container { padding: 16px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .document-info-grid { grid-template-columns: 1fr; }
    .search-row { flex-direction: column; }
    .search-row .form-select { width: 100%; }
    .documents-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .doc-stats-bar { flex-direction: column; }
    .gov-footer-content { flex-direction: column; text-align: center; }
}
