/* base.css - Variables, keyframes, global enhancements, toasts, search, tables, footer, responsive */

/* Shake animation for login errors */
@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

:root {
    --bs-font-sans-serif: 'Futura PT', 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --eff-primary: #1E6332;
    --eff-primary-dark: #214A3E;
    --eff-primary-light: #F4F0E9;
    --eff-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --eff-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --eff-transition: all 0.3s ease;
    /* Theme variables (light defaults) */
    --theme-bg: #eef0f3;
    --theme-surface: #fff;
    --theme-surface-alt: #fafaf8;
    --theme-border: #e5e1da;
    --theme-border-light: #f0ede8;
    --theme-text: #231F20;
    --theme-text-secondary: #6b7280;
    --theme-text-muted: #9ca3af;
    --theme-input-bg: #fff;
    --theme-header-bg: #fff;
    --theme-sidebar-bg: #fff;
    --theme-card-bg: #fff;
    --theme-hover: #F4F0E9;
    --theme-table-header: #fafaf8;
    /* Sidebar variables */
    --sidebar-width-expanded: 210px;
    --sidebar-width-collapsed: 72px;
    --sidebar-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 60px;
}

/* ==================== DARK THEME ====================
   Palette: navy/slate tones (NOT pure black). Green branding stays vibrant.
   Inspired by proven dark theme from SBC Project Portal. */
body.dark-theme {
    --theme-bg: #0f172a;
    --theme-surface: #1e293b;
    --theme-surface-alt: #334155;
    --theme-border: #374151;
    --theme-border-light: #2d3748;
    --theme-text: #f3f4f6;
    --theme-text-secondary: #d1d5db;
    --theme-text-muted: #94a3b8;
    --theme-input-bg: #1f2937;
    --theme-header-bg: #1e293b;
    --theme-sidebar-bg: #111827;
    --theme-card-bg: #1e293b;
    --theme-hover: #334155;
    --theme-table-header: #1f2937;
    color-scheme: dark;
}

/* ── GLOBAL OVERRIDES — navy/slate palette, no white anywhere ── */
body.dark-theme { background: var(--theme-bg) !important; color: var(--theme-text) !important; }

/* ALL white backgrounds → dark slate surface (excluding children of gradient headers) */
body.dark-theme section, body.dark-theme aside,
body.dark-theme nav, body.dark-theme footer,
body.dark-theme .card, body.dark-theme .modal-content,
body.dark-theme .dropdown-menu, body.dark-theme .popover,
body.dark-theme .list-group-item, body.dark-theme .offcanvas {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
}

/* Page-level backgrounds — deepest navy */
body.dark-theme #appContainer,
body.dark-theme .page-section,
body.dark-theme .dashboard-content { background: var(--theme-bg) !important; }

/* Explicit div containers that need dark surface */
body.dark-theme .profile-tab-content,
body.dark-theme .claims-table-container,
body.dark-theme .detail-panel,
body.dark-theme .settings-modal,
body.dark-theme .impersonate-modal { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }

/* Claims page */
body.dark-theme .claims-filter-bar,
body.dark-theme .claims-filters-row,
body.dark-theme [class*="claims-filter"],
body.dark-theme [class*="filter-bar"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .claims-data-header,
body.dark-theme [class*="data-header"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .claims-table-wrap { background: var(--theme-surface) !important; }
body.dark-theme .claims-table-container { overflow: visible !important; }
body.dark-theme .claims-sticky-scrollbar { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .claims-top-scrollbar { border-bottom-color: var(--theme-border) !important; }
body.dark-theme .claims-table-wrap th { background: var(--theme-surface-alt) !important; }
body.dark-theme .claims-pagination-bar { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }

/* Filter chips / status pills */
body.dark-theme .status-chip,
body.dark-theme [class*="status-chip"],
body.dark-theme [class*="filter-chip"],
body.dark-theme .quick-filter-btn { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .quick-filter-btn.active,
body.dark-theme [class*="filter-chip"].active { border-color: var(--eff-primary) !important; }

/* View toggle buttons */
body.dark-theme .view-toggle-btn,
body.dark-theme [class*="view-toggle"],
body.dark-theme [class*="view-btn"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .view-toggle-btn.active,
body.dark-theme [class*="view-btn"].active { background: var(--eff-primary) !important; color: #fff !important; }

/* Sort dropdown */
body.dark-theme [class*="sort-dropdown"],
body.dark-theme [class*="sort-btn"],
body.dark-theme .dropdown-toggle { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }

/* Location multi-select */
body.dark-theme [class*="location-filter"],
body.dark-theme [class*="multi-select"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }

/* "Showing X of Y" badge */
body.dark-theme [class*="showing-count"],
body.dark-theme [class*="page-count"] { background: var(--theme-surface-alt) !important; color: var(--theme-text-muted) !important; border-color: var(--theme-border) !important; }

/* Action buttons in table */
body.dark-theme [class*="action-btn"],
body.dark-theme [class*="action-icon"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme [class*="action-btn"]:hover { background: var(--theme-hover) !important; color: var(--theme-text) !important; }

/* Location filter dropdown (cloc- prefix) */
body.dark-theme .cloc-panel { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .cloc-search { background: var(--theme-input-bg) !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }
body.dark-theme .cloc-search-wrap { background: transparent !important; }
body.dark-theme .cloc-actions { background: transparent !important; border-color: var(--theme-border) !important; }
body.dark-theme .cloc-action-btn { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .cloc-action-btn:hover { background: var(--theme-hover) !important; color: #6ee7b7 !important; border-color: var(--eff-primary) !important; }
body.dark-theme .cloc-options { background: transparent !important; }
body.dark-theme .cloc-item { color: var(--theme-text-secondary) !important; border-color: var(--theme-border) !important; }
body.dark-theme .cloc-item:hover { background: var(--theme-hover) !important; }
body.dark-theme .cloc-item.checked { background: rgba(30,99,50,0.15) !important; }
body.dark-theme .cloc-item-name { color: var(--theme-text-secondary) !important; }
body.dark-theme .cloc-item-count { color: var(--theme-text-muted) !important; }
body.dark-theme .cloc-trigger { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .cloc-empty { color: var(--theme-text-muted) !important; }

/* IC badges — no added styling, let images render naturally */
body.dark-theme .ic-badge { background: none !important; }
body.dark-theme .ic-logo { background: none !important; border: none !important; border-radius: 0 !important; padding: 0 !important; box-shadow: none !important; }
body.dark-theme .ic-logo-fallback { background: none !important; color: var(--theme-text-muted) !important; }

/* Location filter dropdown + Sort panel */
body.dark-theme .loc-ms-panel,
body.dark-theme .loc-ms-search,
body.dark-theme [class*="loc-ms"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
body.dark-theme .loc-ms-option { color: var(--theme-text-secondary) !important; }
body.dark-theme .loc-ms-option:hover { background: var(--theme-hover) !important; }
body.dark-theme .loc-ms-header,
body.dark-theme .loc-ms-footer { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .sort-panel,
body.dark-theme [class*="sort-panel"],
body.dark-theme [class*="sort-options"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
body.dark-theme .sort-panel div,
body.dark-theme [class*="sort-panel"] div { background: transparent !important; }
body.dark-theme .sort-panel select,
body.dark-theme [class*="sort-panel"] select { background: var(--theme-input-bg) !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }
body.dark-theme .sort-panel button,
body.dark-theme [class*="sort-panel"] button,
body.dark-theme [class*="sort-preset"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .sort-panel button:hover,
body.dark-theme [class*="sort-preset"]:hover { background: var(--theme-hover) !important; }
body.dark-theme .sort-panel button.active,
body.dark-theme [class*="sort-preset"].active { background: var(--eff-primary) !important; color: #fff !important; border-color: var(--eff-primary) !important; }
body.dark-theme .sort-panel hr { border-color: var(--theme-border) !important; }
body.dark-theme .sort-panel label,
body.dark-theme [class*="sort-panel"] label { color: var(--theme-text-muted) !important; }

/* Save Preference button */
body.dark-theme [class*="save-pref"],
body.dark-theme [class*="save-filter"] { background: transparent !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }

/* Claim detail panel */
body.dark-theme .claim-detail-overlay,
body.dark-theme [class*="detail-overlay"] { background: var(--theme-surface) !important; }
body.dark-theme [class*="detail-header"] { background: var(--theme-surface-alt) !important; }

/* Claims action buttons + info badge — exact class overrides */
body.dark-theme .claims-action-btn { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .claims-action-btn:hover { background: var(--theme-hover) !important; color: var(--theme-text) !important; }
body.dark-theme .claims-action-btn.primary { background: var(--eff-primary) !important; border-color: var(--eff-primary) !important; color: #fff !important; }

/* Bootstrap small/outline/light buttons in tables */
body.dark-theme .btn-light { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .btn-light:hover { background: var(--theme-hover) !important; }
body.dark-theme .btn-outline-primary { color: #93c5fd !important; border-color: #374151 !important; background: transparent !important; }
body.dark-theme .btn-outline-primary:hover { background: rgba(59,130,246,0.15) !important; }
body.dark-theme .btn-outline-danger { color: #fca5a5 !important; border-color: #374151 !important; background: transparent !important; }
body.dark-theme .btn-outline-danger:hover { background: rgba(239,68,68,0.15) !important; }
body.dark-theme .btn-outline-info { color: #67e8f9 !important; border-color: #374151 !important; background: transparent !important; }
body.dark-theme .btn-outline-warning { color: #fcd34d !important; border-color: #374151 !important; background: transparent !important; }
body.dark-theme td .btn { background: transparent !important; border-color: var(--theme-border) !important; }
body.dark-theme td .btn:hover { background: var(--theme-hover) !important; }
body.dark-theme .claims-table-info { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-muted) !important; }

/* Claims card view (grid) — override all white/light backgrounds */
body.dark-theme .claim-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; box-shadow: none !important; }
body.dark-theme .claim-card::before { display: none !important; }
body.dark-theme .claims-cards-container { background: transparent !important; }
body.dark-theme .claims-cards-header { background: var(--theme-surface-alt) !important; }
body.dark-theme .claim-card div:not([class*="badge"]):not([class*="status"]):not([class*="ai-tooltip"]):not([class*="ai-alert"]) { background: transparent !important; }
body.dark-theme .claim-card span:not([class*="badge"]):not([class*="status"]):not([class*="chip"]) { color: var(--theme-text-secondary) !important; }
body.dark-theme .claim-card h6, body.dark-theme .claim-card h5, body.dark-theme .claim-card strong { color: var(--theme-text) !important; }
body.dark-theme .claim-card .fh-link { color: #6ee7b7 !important; }
body.dark-theme .claim-card hr { border-color: var(--theme-border) !important; }
body.dark-theme .claim-card-btn.message { background: #1e3a5f !important; color: #93c5fd !important; }
body.dark-theme .claim-card-btn.message:hover { background: #1e40af !important; }
body.dark-theme .claim-card-btn.docs { background: var(--theme-surface-alt) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .claim-card-btn.docs:hover { background: var(--theme-hover) !important; }
body.dark-theme .claim-card-btn.claim-card-msg-new,
body.dark-theme .claim-card-btn.claim-card-msg-active { background: var(--theme-surface-alt) !important; color: var(--theme-text-secondary) !important; }

/* Claim card status-specific backgrounds — all dark in dark mode */
body.dark-theme .claim-card.status-funded { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .claim-card.status-in-process { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .claim-card.status-closed { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .claim-card.status-withdrawn { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }


/* Financial section inside card */
body.dark-theme [class*="financial"],
body.dark-theme [class*="claim-amounts"],
body.dark-theme [class*="claim-financial"] { background: transparent !important; color: var(--theme-text-secondary) !important; }

/* ALL text inside claim cards must be visible */
body.dark-theme .claim-card,
body.dark-theme .claim-card a { color: var(--theme-text) !important; }
body.dark-theme .claim-card p,
body.dark-theme .claim-card small,
body.dark-theme .claim-card .text-muted { color: var(--theme-text-muted) !important; }

/* Claim card — deceased name + name link + all green text → visible */
body.dark-theme .claim-card-decedent { color: var(--theme-text) !important; }
body.dark-theme .claim-card-decedent a { color: #6ee7b7 !important; }
body.dark-theme .claim-card a { color: #6ee7b7 !important; }

/* AI processing alert tooltip — must have solid background */
body.dark-theme .claim-card-ai-alert,
body.dark-theme .claim-card-ai-alert div,
body.dark-theme .claim-card-ai-alert span,
body.dark-theme .claim-card-ai-alert p,
body.dark-theme .ai-tooltip,
body.dark-theme .ai-tooltip * { background: #1e293b !important; color: var(--theme-text) !important; }
body.dark-theme .ai-tooltip { border: 1px solid var(--theme-border) !important; border-radius: 12px !important; }
body.dark-theme .ai-tooltip::before { border-bottom-color: var(--theme-border) !important; }
body.dark-theme .claim-card [style*="color:#1E6332"],
body.dark-theme .claim-card [style*="color: #1E6332"] { color: #6ee7b7 !important; }
body.dark-theme .claim-ledger-row.net .claim-ledger-label,
body.dark-theme .claim-ledger-row.net .claim-ledger-value { color: #6ee7b7 !important; }

/* Claim card — IC logo chip */
body.dark-theme .claim-card-policy-chip { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }

/* Claim card — all text with dark hardcoded colors → light */
body.dark-theme .claim-card [style*="color:#1f2937"],
body.dark-theme .claim-card [style*="color: #1f2937"],
body.dark-theme .claim-card [style*="color:#374151"],
body.dark-theme .claim-card [style*="color: #374151"] { color: var(--theme-text) !important; }

/* Step tracker / pipeline — connector lines + dots */
body.dark-theme .claim-step-connector { background: #4b5563 !important; }
body.dark-theme .claim-step.completed .claim-step-connector { background: linear-gradient(90deg, #18A74B, #2F8542) !important; }
body.dark-theme .claim-step.current .claim-step-connector { background: linear-gradient(90deg, #3b82f6 50%, #4b5563 50%) !important; }
body.dark-theme .claim-step.pending .claim-step-dot { background: #374151 !important; border-color: #4b5563 !important; color: var(--theme-text-muted) !important; }
body.dark-theme .claim-step.pending .claim-step-label { color: var(--theme-text-muted) !important; }
body.dark-theme .claim-step-date { color: var(--theme-text-muted) !important; }
body.dark-theme .claim-step-label { color: var(--theme-text-secondary) !important; }
body.dark-theme .claim-step-connector::after { background: inherit !important; }
body.dark-theme .claims-data-title { color: var(--theme-text) !important; }
body.dark-theme .claims-table th:last-child,
body.dark-theme .claims-table td:last-child { background: var(--theme-surface) !important; box-shadow: -4px 0 8px rgba(0,0,0,0.3) !important; }

/* Deceased & Drafts pages — same patterns */
body.dark-theme .deceased-filter-bar,
body.dark-theme .drafts-filter-bar,
body.dark-theme [class*="deceased-"] .data-header,
body.dark-theme [class*="drafts-"] .data-header { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }

/* Elevated surfaces — slightly lighter slate */
body.dark-theme [class*="filter"],
body.dark-theme [class*="toolbar"],
body.dark-theme [class*="-header"]:not(.profile-header):not(.profile-header-info):not(.profile-header-avatar):not(.kb-cat-header):not(.kb-ic-detail-header):not(.kb-update-modal-header):not(.ann-detail-header):not([class*="ann-detail-header"]) {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
}

/* ALL borders */
body.dark-theme *, body.dark-theme *::before, body.dark-theme *::after {
    border-color: var(--theme-border);
}

/* ALL headings and strong text */
body.dark-theme h1, body.dark-theme h2, body.dark-theme h3,
body.dark-theme h4, body.dark-theme h5, body.dark-theme h6,
body.dark-theme label, body.dark-theme strong, body.dark-theme b,
body.dark-theme th { color: var(--theme-text) !important; }

/* ALL body text */
body.dark-theme p, body.dark-theme li, body.dark-theme td, body.dark-theme dd,
body.dark-theme .text-muted, body.dark-theme .text-secondary,
body.dark-theme .text-dark { color: var(--theme-text-secondary) !important; }

/* ALL muted/meta text */
body.dark-theme small, body.dark-theme .form-text { color: var(--theme-text-muted) !important; }

/* ALL inputs, selects, textareas */
body.dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
body.dark-theme select, body.dark-theme textarea,
body.dark-theme .form-control, body.dark-theme .form-select {
    background: var(--theme-input-bg) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}
body.dark-theme input::placeholder, body.dark-theme textarea::placeholder { color: var(--theme-text-muted) !important; }
body.dark-theme input:focus, body.dark-theme select:focus,
body.dark-theme textarea:focus, body.dark-theme .form-control:focus {
    border-color: var(--eff-primary) !important;
    box-shadow: 0 0 0 3px rgba(30,99,50,0.25) !important;
    background: #1f2937 !important;
}

/* ALL tables */
body.dark-theme table { color: var(--theme-text) !important; background: transparent !important; }
body.dark-theme th { background: var(--theme-table-header) !important; color: var(--theme-text-muted) !important; }
body.dark-theme td { color: var(--theme-text-secondary) !important; }
body.dark-theme tbody tr { background: var(--theme-surface) !important; }
body.dark-theme .table > :not(caption) > * > * { background: transparent !important; color: var(--theme-text-secondary) !important; border-color: var(--theme-border) !important; }
body.dark-theme .table > thead > * > * { color: var(--theme-text-muted) !important; }
body.dark-theme tbody tr:hover { background: var(--theme-hover) !important; }
body.dark-theme .table-responsive { background: transparent !important; }

/* Header & Sidebar */
body.dark-theme .main-header { background: var(--theme-header-bg) !important; box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; }
body.dark-theme #currentPageName { color: var(--theme-text) !important; }
body.dark-theme #currentPageIcon { color: #6ee7b7 !important; }

/* Sidebar */
body.dark-theme .sidebar { background: var(--theme-sidebar-bg) !important; }
body.dark-theme .sidebar-item .sidebar-link { color: var(--theme-text-muted) !important; }
body.dark-theme .sidebar-item .sidebar-link:hover { background: #1f2937 !important; color: var(--theme-text) !important; }
body.dark-theme .sidebar-item .sidebar-link.active { background: var(--eff-primary) !important; color: #fff !important; }
body.dark-theme .sidebar-separator-label { color: #64748b !important; }
body.dark-theme .sidebar-user-section { background: var(--theme-sidebar-bg) !important; }
body.dark-theme .sidebar-item-sticky-top { background: var(--theme-sidebar-bg) !important; border-bottom-color: #334155 !important; }

/* Bootstrap alerts */
body.dark-theme .alert-info { background: rgba(59,130,246,0.1) !important; border-color: rgba(59,130,246,0.2) !important; color: #93c5fd !important; }
body.dark-theme .alert-success { background: rgba(16,185,129,0.1) !important; border-color: rgba(16,185,129,0.2) !important; color: #6ee7b7 !important; }
body.dark-theme .alert-warning { background: rgba(245,158,11,0.1) !important; border-color: rgba(245,158,11,0.2) !important; color: #fcd34d !important; }
body.dark-theme .alert-danger { background: rgba(239,68,68,0.1) !important; border-color: rgba(239,68,68,0.2) !important; color: #fca5a5 !important; }

/* Buttons — green stays, outlines adapt */
body.dark-theme .btn-success, body.dark-theme .btn-primary { background: var(--eff-primary) !important; border-color: var(--eff-primary) !important; color: #fff !important; }
body.dark-theme .btn-outline-success { color: #6ee7b7 !important; border-color: var(--eff-primary) !important; background: transparent !important; }
body.dark-theme .btn-outline-secondary { color: var(--theme-text-secondary) !important; border-color: var(--theme-border) !important; background: transparent !important; }
body.dark-theme .btn-outline-secondary:hover { background: var(--theme-hover) !important; }

/* Nav tabs */
body.dark-theme .nav-link { color: var(--theme-text-muted) !important; }
body.dark-theme .nav-link.active { color: #6ee7b7 !important; }
body.dark-theme .nav-tabs { border-color: var(--theme-border) !important; }

/* Toggle switches */
body.dark-theme .toggle-slider { background: #374151 !important; }
body.dark-theme input:checked + .toggle-slider { background: var(--eff-primary) !important; }

/* Green gradient headers stay vibrant */
body.dark-theme .kb-cat-header { background: linear-gradient(135deg, #1E6332 0%, #214A3E 100%) !important; }
body.dark-theme .profile-header { background: linear-gradient(135deg, #0f2a1a 0%, #1a3a28 50%, #214A3E 100%) !important; }
body.dark-theme .kb-hero { background: linear-gradient(135deg, #0f2a1a 0%, #1a3a28 50%, #214A3E 100%) !important; }

/* Loading overlay */
body.dark-theme .loading-overlay { background: linear-gradient(135deg, #0a1a0f 0%, #0d2818 50%, #0a1a0f 100%) !important; }
body.dark-theme .loading-overlay div { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }

/* Shadows — remove on dark to avoid visible borders/glows */
body.dark-theme .card, body.dark-theme [class*="-card"],
body.dark-theme [class*="-section"],
body.dark-theme [class*="-block"] { box-shadow: none !important; }

/* Status badges — keep their colors but with dark-friendly tints */
body.dark-theme .badge.bg-secondary { background: #374151 !important; color: #d1d5db !important; }

/* Hover states — disable for announcements */
body.dark-theme .hv2-ann-section *,
body.dark-theme .hv2-ann-section *:hover { background-color: transparent !important; box-shadow: none !important; }
body.dark-theme .hv2-ann-section { background: var(--theme-surface) !important; }
body.dark-theme .hv2-ann-card,
body.dark-theme [class*="hv2-ann-card"],
body.dark-theme [class*="hv2-ann-card"]:hover { background: transparent !important; border-color: var(--theme-border) !important; box-shadow: none !important; }

body.dark-theme a:not(.btn):not(.nav-link):not(.sidebar-link) { color: #6ee7b7; }

/* Toasts */
body.dark-theme .toast-container .toast { background: var(--theme-surface) !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }

/* Document preview modal */
body.dark-theme .kb-doc-preview-modal, body.dark-theme .kb-update-modal,
body.dark-theme .kba-drill-modal, body.dark-theme .kb-ic-detail-modal { background: var(--theme-surface) !important; }

/* Impersonate modal */
body.dark-theme .impersonate-modal { background: var(--theme-surface) !important; }
body.dark-theme .imp-user-card { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .imp-user-card:hover { background: var(--theme-hover) !important; }

/* Footer */
body.dark-theme .app-footer { background: #111827 !important; }
body.dark-theme .app-footer, body.dark-theme .app-footer a { color: #64748b !important; }


/* ==================== COMPREHENSIVE DARK THEME — ALL REMAINING PAGES ==================== */

/* ── Claim Detail Panel ── */
body.dark-theme .claim-detail-panel,
body.dark-theme .detail-panel-overlay,
body.dark-theme [class*="detail-panel"] { background: var(--theme-surface) !important; color: var(--theme-text) !important; }
body.dark-theme .detail-panel-close { background: var(--theme-surface-alt) !important; color: var(--theme-text) !important; }
body.dark-theme [class*="detail-section"] { border-color: var(--theme-border) !important; }
body.dark-theme [class*="detail-label"] { color: var(--theme-text-muted) !important; }
body.dark-theme [class*="detail-value"] { color: var(--theme-text) !important; }
body.dark-theme .claim-detail-header { background: var(--theme-surface-alt) !important; }
body.dark-theme [class*="doc-tracking"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
/* Financial Breakdown ledger — dark theme (mirrors detail-card treatment) */
body.dark-theme #claimDetailPanel .fin-ledger { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme #claimDetailPanel .fin-ledger-label { color: var(--theme-text-muted) !important; }
body.dark-theme #claimDetailPanel .fin-ledger-value { color: var(--theme-text) !important; }
body.dark-theme #claimDetailPanel .fin-ledger-value.fin-neg { color: #9ca3af !important; }
body.dark-theme #claimDetailPanel .fin-ledger-row.fin-ledger-total .fin-ledger-label { color: var(--theme-text) !important; }
body.dark-theme #claimDetailPanel .fin-ledger-row.fin-ledger-total .fin-ledger-value,
body.dark-theme #claimDetailPanel .fin-ledger-value.fin-pos { color: #6ee7b7 !important; }
body.dark-theme [class*="doc-req"] { background: var(--theme-surface-alt) !important; }
body.dark-theme [class*="multipicklist-chip"] { background: var(--theme-surface-alt) !important; color: var(--theme-text-secondary) !important; border-color: var(--theme-border) !important; }

/* ── Deceased Page ── */
body.dark-theme .deceased-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .deceased-card:hover { border-color: var(--eff-primary) !important; }
body.dark-theme .deceased-card a { color: #6ee7b7 !important; }
body.dark-theme .deceased-card div { background: transparent !important; }
body.dark-theme [class*="deceased-filter"],
body.dark-theme [class*="deceased-data"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .dec-action-btn { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }
body.dark-theme .dec-action-btn:hover { background: var(--theme-hover) !important; }

/* ── Drafts Page ── */
body.dark-theme .draft-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .draft-card div { background: transparent !important; }
body.dark-theme .draft-card:hover { border-color: var(--eff-primary) !important; }
body.dark-theme [class*="draft-filter"],
body.dark-theme [class*="drafts-data"],
body.dark-theme [class*="draft-kpi"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .draft-kpi-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .draft-kpi-card div { background: transparent !important; }
body.dark-theme [class*="draft-expand"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .draft-group-sep td { background: transparent !important; }
body.dark-theme [class*="draft-policy-count"] { background: var(--theme-surface-alt) !important; }

/* ── Documents / Finder Page ── */
body.dark-theme [class*="finder-"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
body.dark-theme .finder-sidebar { background: var(--theme-sidebar-bg) !important; }
body.dark-theme .finder-item { background: transparent !important; }
body.dark-theme .finder-item:hover { background: var(--theme-hover) !important; }
body.dark-theme .finder-item.selected { background: rgba(30,99,50,0.15) !important; }
body.dark-theme [class*="finder-toolbar"] { background: var(--theme-surface-alt) !important; }
body.dark-theme [class*="finder-breadcrumb"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .doc-upload-modal { background: var(--theme-surface) !important; }
body.dark-theme .doc-upload-modal div { background: transparent !important; }
body.dark-theme [class*="dropzone"],
body.dark-theme [class*="drop-area"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .doc-preview-modal { background: var(--theme-surface) !important; }

/* ── Messaging Page ── */
body.dark-theme [class*="conversation-"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="conversation-"]:hover { background: var(--theme-hover) !important; }
body.dark-theme [class*="conversation-"].active { background: rgba(30,99,50,0.15) !important; }
body.dark-theme .chat-area { background: var(--theme-bg) !important; }
body.dark-theme .chat-message { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .chat-message.outgoing { background: rgba(30,99,50,0.15) !important; }
body.dark-theme .chat-textarea { background: var(--theme-input-bg) !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="msg-list"],
body.dark-theme [class*="message-list"] { background: var(--theme-bg) !important; }
body.dark-theme [class*="new-msg-modal"] { background: var(--theme-surface) !important; }

/* ── Analytics Page ── */
body.dark-theme [class*="analytics-"] { color: var(--theme-text) !important; }
body.dark-theme [class*="analytics-card"],
body.dark-theme [class*="analytics-kpi"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="analytics-card"] div { background: transparent !important; }
body.dark-theme [class*="analytics-filter"],
body.dark-theme [class*="analytics-toolbar"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="analytics-modal"] { background: var(--theme-surface) !important; }
body.dark-theme [class*="donut-"] { background: transparent !important; }
body.dark-theme .analytics-clear-btn { background: transparent !important; }

/* ── Reports Page ── */
body.dark-theme [class*="reports-"] { color: var(--theme-text) !important; }
body.dark-theme [class*="reports-filter"],
body.dark-theme [class*="reports-toolbar"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="reports-table"] { background: var(--theme-surface) !important; }
body.dark-theme .rms-wrapper { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .rms-panel { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .rms-option { color: var(--theme-text-secondary) !important; }
body.dark-theme .rms-option:hover { background: var(--theme-hover) !important; }
body.dark-theme .rms-search { background: var(--theme-input-bg) !important; color: var(--theme-text) !important; }

/* ── My Locations / Accounts Page ── */
body.dark-theme [class*="acct-card"],
body.dark-theme [class*="account-card"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="acct-card"]:hover { border-color: var(--eff-primary) !important; }
body.dark-theme [class*="acct-card"] div { background: transparent !important; }
body.dark-theme [class*="acct-summary"],
body.dark-theme [class*="account-summary"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="acct-detail"],
body.dark-theme [class*="account-detail"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="acct-kpi"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }

/* ── Changelog Page ── */
body.dark-theme [class*="changelog-"] { color: var(--theme-text) !important; }
body.dark-theme [class*="changelog-entry"],
body.dark-theme [class*="changelog-card"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="changelog-header"],
body.dark-theme [class*="changelog-banner"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="changelog-filter"] { background: var(--theme-surface-alt) !important; }
body.dark-theme [class*="changelog-date-group"] { border-color: var(--theme-border) !important; }

/* ── Dev Console ── */
body.dark-theme [class*="dc-"],
body.dark-theme #devConsolePanel { background: var(--theme-surface) !important; color: var(--theme-text) !important; }
body.dark-theme [class*="dc-header"] { background: var(--theme-surface-alt) !important; }
body.dark-theme [class*="dc-log-entry"] { border-color: var(--theme-border) !important; }
body.dark-theme [class*="dc-log-entry"]:hover { background: var(--theme-hover) !important; }
body.dark-theme [class*="dc-stats"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }

/* ── Create Claim Wizards (Classic, V2, V3) ── */
body.dark-theme [class*="wizard-"],
body.dark-theme [class*="v2-"],
body.dark-theme [class*="v3-"] { color: var(--theme-text) !important; }
body.dark-theme .v2-wizard-container,
body.dark-theme .v3-wizard-container { background: var(--theme-bg) !important; }
body.dark-theme .v2-step-panel,
body.dark-theme .v3-step-panel,
body.dark-theme .step-panel { background: var(--theme-surface) !important; }
body.dark-theme [class*="wizard-card"],
body.dark-theme [class*="v2-card"],
body.dark-theme [class*="v3-card"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="wizard-card"] div,
body.dark-theme [class*="v2-card"] div,
body.dark-theme [class*="v3-card"] div { background: transparent !important; }
body.dark-theme .wizard-selector-modal { background: var(--theme-surface) !important; }
body.dark-theme .wizard-option { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .wizard-option:hover { border-color: var(--eff-primary) !important; }
body.dark-theme [class*="step-nav"],
body.dark-theme [class*="wizard-nav"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="policy-card"],
body.dark-theme [class*="bene-card"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="review-card"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="financial-summary"],
body.dark-theme [class*="fin-row"] { border-color: var(--theme-border) !important; }
body.dark-theme [class*="fp-"] { color: var(--theme-text) !important; }
body.dark-theme .fp-chip { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .fp-chip.selected { border-color: var(--eff-primary) !important; }
body.dark-theme [class*="ic-info-panel"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="fh-dropdown"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="fh-dropdown"] div { background: transparent !important; }
body.dark-theme .fh-dropdown-option:hover { background: var(--theme-hover) !important; }

/* ── Notification Panel ── */
body.dark-theme .notif-panel { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .notif-panel div { border-color: var(--theme-border) !important; }
body.dark-theme [class*="notif-item"] { background: transparent !important; }
body.dark-theme [class*="notif-item"]:hover { background: var(--theme-hover) !important; }
body.dark-theme [class*="notif-header"] { background: var(--theme-surface-alt) !important; }
body.dark-theme [class*="notif-tab"] { color: var(--theme-text-secondary) !important; }
body.dark-theme [class*="notif-tab"].active { color: #6ee7b7 !important; }
body.dark-theme [class*="notif-footer"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="notif-empty"] { color: var(--theme-text-muted) !important; }

/* ── Impersonate Modal ── */
body.dark-theme .imp-modal { background: var(--theme-surface) !important; }
body.dark-theme [class*="imp-user"],
body.dark-theme [class*="imp-card"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text) !important; }
body.dark-theme [class*="imp-user"]:hover,
body.dark-theme [class*="imp-card"]:hover { background: var(--theme-hover) !important; }
body.dark-theme [class*="imp-confirm"] { background: var(--theme-surface) !important; }
body.dark-theme [class*="imp-col-header"] { color: var(--theme-text-secondary) !important; }

/* ── eSign Modal ── */
body.dark-theme [class*="esign-"] { color: var(--theme-text) !important; }
body.dark-theme [class*="esign-modal"],
body.dark-theme [class*="esign-detail"] { background: var(--theme-surface) !important; }
body.dark-theme [class*="esign-card"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }

/* ── PDF Merge / Assignment Form Picker ── */
body.dark-theme [class*="pdf-picker"],
body.dark-theme [class*="bene-picker"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="picker-policy"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }

/* ── Search Results Dropdown ── */
body.dark-theme .search-results-dropdown { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .search-result-item { color: var(--theme-text) !important; }
body.dark-theme .search-result-item:hover { background: var(--theme-hover) !important; }
body.dark-theme [class*="search-section-title"] { color: var(--theme-text-muted) !important; }

/* ── Global: any remaining white bg-* utility overrides ── */
body.dark-theme [style*="background:#fff"],
body.dark-theme [style*="background: #fff"],
body.dark-theme [style*="background-color:#fff"],
body.dark-theme [style*="background-color: #fff"],
body.dark-theme [style*="background:#ffffff"],
body.dark-theme [style*="background: #ffffff"],
body.dark-theme [style*="background-color:#ffffff"],
body.dark-theme [style*="background-color: #ffffff"] { background: var(--theme-surface) !important; }

body.dark-theme [style*="background:#F4F0E9"],
body.dark-theme [style*="background: #F4F0E9"],
body.dark-theme [style*="background:#f4f0e9"],
body.dark-theme [style*="background: #f4f0e9"],
body.dark-theme [style*="background:#fafaf8"],
body.dark-theme [style*="background: #fafaf8"],
body.dark-theme [style*="background:#f8f9fa"],
body.dark-theme [style*="background: #f8f9fa"],
body.dark-theme [style*="background:#f3f4f6"],
body.dark-theme [style*="background: #f3f4f6"] { background: var(--theme-surface-alt) !important; }

/* ── Global: any remaining hardcoded dark text → light ── */
body.dark-theme [style*="color:#231F20"],
body.dark-theme [style*="color: #231F20"],
body.dark-theme [style*="color:#1f2937"],
body.dark-theme [style*="color: #1f2937"],
body.dark-theme [style*="color:#374151"],
body.dark-theme [style*="color: #374151"],
body.dark-theme [style*="color:#111827"],
body.dark-theme [style*="color: #111827"] { color: var(--theme-text) !important; }

body.dark-theme [style*="color:#6b7280"],
body.dark-theme [style*="color: #6b7280"],
body.dark-theme [style*="color:#9ca3af"],
body.dark-theme [style*="color: #9ca3af"] { color: var(--theme-text-muted) !important; }

/* ── Global: hardcoded border colors → theme border ── */
body.dark-theme [style*="border-color:#e5e1da"],
body.dark-theme [style*="border-color: #e5e1da"],
body.dark-theme [style*="border:1px solid #e5e1da"],
body.dark-theme [style*="border: 1px solid #e5e1da"] { border-color: var(--theme-border) !important; }

/* Images on dark — no extra border */
body.dark-theme img { border-color: transparent !important; }

/* Fix background bleed — ensure page content fills viewport */
body.dark-theme .content-wrapper,
body.dark-theme .main-content,
body.dark-theme .app-content { background: var(--theme-bg) !important; min-height: 100vh; }
body.dark-theme .sidebar { min-height: 100vh; }

/* Profile page — header and tabs */
body.dark-theme .profile-header { background: linear-gradient(135deg, #111827 0%, #1e293b 100%) !important; border: 1px solid var(--theme-border) !important; }
body.dark-theme .profile-tabs { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .profile-tabs .nav-tabs { border-color: var(--theme-border) !important; background: var(--theme-surface) !important; }
body.dark-theme .profile-tabs .nav-tabs .nav-link { color: var(--theme-text-muted) !important; }
body.dark-theme .profile-tabs .nav-tabs .nav-link.active { color: #6ee7b7 !important; }
body.dark-theme .profile-tabs .nav-tabs .nav-link:hover { color: var(--theme-text) !important; }
body.dark-theme .profile-tab-content { background: var(--theme-surface) !important; }
body.dark-theme .profile-tab-content .table { background: transparent !important; }
body.dark-theme .profile-tab-content .table td,
body.dark-theme .profile-tab-content .table th { background: transparent !important; }
body.dark-theme .profile-tab-content .table-sm td { border-color: var(--theme-border) !important; }
body.dark-theme .profile-tab-content .table-responsive { background: transparent !important; }
/* Profile page specific fixes */
body.dark-theme .profile-section-title { color: #f3f4f6 !important; }
body.dark-theme .profile-section-title i { color: #6ee7b7 !important; }
body.dark-theme .security-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .security-card-info h6 { color: var(--theme-text) !important; }
body.dark-theme .security-card-info p { color: var(--theme-text-muted) !important; }
body.dark-theme .preference-item { border-color: var(--theme-border) !important; }
body.dark-theme .preference-info h6 { color: var(--theme-text) !important; }
body.dark-theme .preference-info p { color: var(--theme-text-muted) !important; }

/* Access permissions — fix white-on-dark issues */
body.dark-theme .col-md-6 > div[style*="border"] { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .col-md-6 > div[style*="border"] div { color: var(--theme-text) !important; }
body.dark-theme [style*="background:#fff"], body.dark-theme [style*="background: #fff"] { background: var(--theme-surface) !important; }
body.dark-theme [style*="background:#fafaf8"], body.dark-theme [style*="background: #fafaf8"] { background: var(--theme-surface-alt) !important; }

/* Location tags — dark chips */
body.dark-theme span[style*="background:#fff"] { background: var(--theme-surface-alt) !important; color: var(--theme-text-secondary) !important; border-color: var(--theme-border) !important; }

/* Change Password / outline buttons on dark */
body.dark-theme .btn-outline-success { background: transparent !important; color: #6ee7b7 !important; border-color: #6ee7b7 !important; }
body.dark-theme .btn-outline-success:hover { background: var(--eff-primary) !important; color: #fff !important; }

/* Profile tab underline */
body.dark-theme .nav-link.active { border-color: #6ee7b7 !important; }

/* Bootstrap text color overrides — invisible on dark backgrounds */
body.dark-theme .text-success { color: #6ee7b7 !important; }
body.dark-theme .text-primary { color: #93c5fd !important; }
body.dark-theme .text-danger { color: #fca5a5 !important; }
body.dark-theme .text-warning { color: #fcd34d !important; }
body.dark-theme .text-info { color: #67e8f9 !important; }
body.dark-theme .text-dark { color: var(--theme-text) !important; }
body.dark-theme .text-body { color: var(--theme-text) !important; }
body.dark-theme .text-black { color: var(--theme-text) !important; }
body.dark-theme .text-muted { color: var(--theme-text-muted) !important; }
body.dark-theme .text-secondary { color: var(--theme-text-muted) !important; }
body.dark-theme a:not(.btn):not(.nav-link):not(.sidebar-link) { color: #6ee7b7 !important; }
body.dark-theme .fh-link { color: #6ee7b7 !important; }

/* Bootstrap bg overrides */
body.dark-theme .bg-light { background: var(--theme-surface-alt) !important; }
body.dark-theme .bg-white { background: var(--theme-surface) !important; }

/* Announcements */
body.dark-theme .ann-card,
body.dark-theme .ann-inline-trigger,
body.dark-theme .ann-popover,
body.dark-theme .ann-popover-body { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .ann-card:hover { background: var(--theme-hover) !important; }
body.dark-theme .ann-detail-overlay { background: rgba(15,23,42,0.85) !important; }
body.dark-theme .ann-detail-modal,
body.dark-theme .ann-detail-modal div,
body.dark-theme .ann-detail-modal section,
body.dark-theme .ann-detail-modal p { background: var(--theme-surface) !important; color: var(--theme-text-secondary) !important; border-color: var(--theme-border) !important; }
body.dark-theme .ann-detail-header { background: var(--theme-surface-alt) !important; }
body.dark-theme .ann-detail-header div { background: transparent !important; }
body.dark-theme .ann-detail-att-item { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .ann-ack-overlay { background: rgba(15,23,42,0.9) !important; }
body.dark-theme .ann-ack-modal { background: var(--theme-surface) !important; }
body.dark-theme .ann-ack-modal-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .ann-ack-modal-content { background: var(--theme-surface) !important; color: var(--theme-text-secondary) !important; }

/* Home page announcement cards */
body.dark-theme .hv2-ann-section { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .hv2-ann-card,
body.dark-theme [class*="hv2-ann-card"] { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme [class*="hv2-ann-card"]:hover { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; box-shadow: none !important; }
body.dark-theme .hv2-ann-card-title { color: var(--theme-text) !important; }
body.dark-theme .hv2-ann-card-preview { color: var(--theme-text-secondary) !important; }
body.dark-theme .hv2-ann-header { background: transparent !important; }
body.dark-theme .hv2-ann-card-time { background: transparent !important; color: var(--theme-text-muted) !important; border-color: transparent !important; }

/* Home page canvas blocks — no borders/shadows in dark */
body.dark-theme .hv2-canvas-block,
body.dark-theme .hv2-section,
body.dark-theme .hv2-card { border-color: transparent !important; box-shadow: none !important; }
body.dark-theme .hv2-card { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }

/* Transition for smooth theme switching */
body { transition: background-color 0.3s ease, color 0.3s ease; }

/* ==================== GREEN SCROLLBARS — ENTIRE APP ==================== */
::-webkit-scrollbar { width: 8px; height: 10px; }
::-webkit-scrollbar-track { background: #f0ede8; border-radius: 5px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #2F8542, #1E6332); border-radius: 5px; min-height: 30px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #1E6332, #214A3E); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: #2F8542 #f0ede8; }

body.dark-theme ::-webkit-scrollbar-track { background: #1f2937; }
body.dark-theme ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #2F8542, #1E6332); }
body.dark-theme ::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #18A74B, #1E6332); }
body.dark-theme * { scrollbar-color: #2F8542 #1f2937; }

* {
    font-family: 'Futura PT', 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #eef0f3;
}

/* ==================== DATA LOADING PROGRESS BANNER ==================== */
.load-progress-banner {
    display: flex;
    align-items: center;
    color: #1E6332;
    font-size: 0.72rem;
    font-weight: 500;
    transition: opacity 0.4s ease;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}
.load-progress-banner.fade-out {
    opacity: 0;
}
.load-progress-banner.complete {
    color: #214A3E;
}
.load-progress-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(30, 99, 50,0.2);
    border-top-color: #1E6332;
    border-radius: 50%;
    animation: progressSpin 0.8s linear infinite;
    margin-right: 8px;
    flex-shrink: 0;
}
.load-progress-banner.complete .load-progress-spinner {
    display: none;
}
.load-progress-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@keyframes progressSpin {
    to { transform: rotate(360deg); }
}

/* ==================== SIDEBAR / MOBILE LOADING-DATA STATE ==================== */
.sidebar-link.loading-data {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}
.sidebar-link-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(30, 99, 50,0.2);
    border-top-color: #1E6332;
    border-radius: 50%;
    animation: progressSpin 0.8s linear infinite;
    margin-left: auto;
    flex-shrink: 0;
}
/* When spinner sits next to a badge, use gap instead of auto margin */
.sidebar-badge + .sidebar-link-spinner,
.sidebar-badge-new + .sidebar-link-spinner {
    margin-left: 6px;
}

/* ==================== FUNERAL HOME LINKS ==================== */
/* ==================== RESIZABLE COLUMN HANDLES ==================== */
.col-resize-handle {
    position: absolute;
    top: 0;
    right: -2px;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 15;
    user-select: none;
    -webkit-user-select: none;
}
.col-resize-handle::after {
    content: '';
    position: absolute;
    top: 25%;
    right: 2px;
    width: 1px;
    height: 50%;
    background: #d1d5db;
    border-radius: 1px;
    transition: background 0.15s, width 0.15s;
}
.col-resize-handle:hover::after,
.col-resize-handle.active::after {
    background: #1E6332;
    width: 2px;
    top: 10%;
    height: 80%;
}
.col-resize-handle.active {
    width: 10px;
    right: -5px;
}

.fh-link {
    color: #1E6332;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}
.fh-link:hover {
    color: #214A3E;
    text-decoration: underline;
}

/* ==================== POLICY NUMBER MASKING (v46) ==================== */
/* Renders as "••••1234 👁" when the user's Mask_PolicyNumber_in_HUB Zoho flag
   is on. Eye button toggles full reveal for that specific instance only —
   session-scoped, resets on page reload. */
.pol-mask {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}
.pol-mask-val {
    font-family: 'Futura PT', 'Jost', monospace;
    letter-spacing: 0.05em;
}
.pol-mask-eye {
    background: transparent;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    color: #9ca3af;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 120ms;
    line-height: 1;
}
.pol-mask-eye:hover { color: #1E6332; }
.pol-mask-eye i { font-size: 11px; }

/* ==================== IC BADGE (Insurance Company Logo) ==================== */
.ic-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}
.ic-logo {
    height: 32px;
    max-width: 56px;
    object-fit: contain;
    flex-shrink: 0;
}
.ic-logo-fallback {
    font-size: 18px;
    color: #6b7280;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.ic-badge-lg .ic-logo {
    height: 42px;
    max-width: 72px;
}
.ic-badge-lg .ic-logo-fallback {
    font-size: 24px;
    width: 32px;
}
.ic-select-preview {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 6px;
}
.ic-select-img {
    height: 36px;
    max-width: 64px;
    object-fit: contain;
}

/* ==================== CUSTOM IC DROPDOWN WITH LOGOS ==================== */
.ic-dropdown-wrapper {
    position: relative;
    width: 100%;
}
.ic-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-height: 38px;
    background: #fff;
    user-select: none;
}
.ic-dropdown-trigger .ic-dropdown-placeholder {
    color: #6c757d;
}
.ic-dropdown-trigger .ic-dropdown-logo {
    height: 24px;
    max-width: 48px;
    object-fit: contain;
    flex-shrink: 0;
}
.ic-dropdown-trigger .ic-dropdown-shield {
    font-size: 16px;
    color: #6b7280;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.ic-dropdown-trigger .ic-dropdown-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ic-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 520px;
    display: flex;
    flex-direction: column;
}
.ic-dropdown-wrapper.open .ic-dropdown-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}
.ic-dropdown-search-wrap {
    position: relative;
    padding: 8px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.ic-dropdown-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 13px;
}
.ic-dropdown-search {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px 6px 30px;
    font-size: 14px;
    outline: none;
}
.ic-dropdown-search:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 2px rgba(13,110,253,.15);
}
.ic-dropdown-options {
    overflow-y: auto;
    max-height: 460px;
    padding: 4px 0;
}
.ic-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 14px;
}
.ic-dropdown-item:hover {
    background: #F4F0E9;
}
.ic-dropdown-item.selected {
    background: #F4F0E9;
    font-weight: 600;
}
.ic-dropdown-item .ic-dropdown-logo {
    height: 24px;
    max-width: 48px;
    object-fit: contain;
    flex-shrink: 0;
}
.ic-dropdown-item .ic-dropdown-shield {
    font-size: 16px;
    color: #6b7280;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.ic-dropdown-item .ic-dropdown-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.ic-dropdown-empty {
    padding: 16px 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* ==================== SEARCHABLE FH DROPDOWN ==================== */
.fh-dropdown-wrapper { position: relative; width: 100%; }
.fh-dropdown-trigger {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    min-height: 38px; background: #fff; user-select: none;
    border: 1px solid #dee2e6; border-radius: 6px; padding: 6px 12px;
    font-size: 14px; color: #212529; transition: border-color 0.15s, box-shadow 0.15s;
}
.fh-dropdown-trigger:hover { border-color: #adb5bd; }
.fh-dropdown-trigger .fh-dropdown-placeholder { color: #6c757d; }
.fh-dropdown-panel {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1060;
    background: #fff; border: 1px solid #dee2e6; border-top: none;
    border-radius: 0 0 6px 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 360px; display: flex; flex-direction: column;
}
.fh-dropdown-wrapper.open .fh-dropdown-trigger {
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    border-color: #1E6332; box-shadow: 0 0 0 0.25rem rgba(30, 99, 50,.2);
}
.fh-dropdown-search-wrap {
    position: relative; padding: 8px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.fh-dropdown-search-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; font-size: 13px;
}
.fh-dropdown-search {
    width: 100%; border: 1px solid #dee2e6; border-radius: 6px;
    padding: 6px 10px 6px 30px; font-size: 14px; outline: none;
}
.fh-dropdown-search:focus {
    border-color: #1E6332; box-shadow: 0 0 0 2px rgba(30, 99, 50,.15);
}
.fh-dropdown-options { overflow-y: auto; max-height: 300px; padding: 4px 0; }
.fh-dropdown-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    cursor: pointer; transition: background 0.1s; font-size: 14px;
}
.fh-dropdown-item:hover { background: #F4F0E9; }
.fh-dropdown-item.selected { background: #F4F0E9; font-weight: 600; }
.fh-dropdown-icon { font-size: 14px; color: #1E6332; width: 20px; text-align: center; flex-shrink: 0; }
.fh-dropdown-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-dropdown-empty { padding: 16px 12px; text-align: center; color: #9ca3af; font-size: 14px; }
.fh-dropdown-primary-tag {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 10px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ==================== GLOBAL ENHANCEMENTS ==================== */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hover-lift {
    transition: var(--eff-transition);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--eff-shadow-hover);
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 10300;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.toast-notification {
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
    max-width: 380px;
    font-size: 0.8rem;
    animation: slideInRight 0.3s ease-out;
    border-left: 3px solid var(--eff-primary);
    background: #f0f9ff;
    color: #1e293b;
}

.toast-notification > span:first-of-type {
    flex: 1;
    min-width: 0;
}

.toast-notification.toast-success { border-left-color: #1E6332; background: #F4F0E9; }
.toast-notification.toast-error { border-left-color: #dc3545; background: #fef2f2; }
.toast-notification.toast-warning { border-left-color: #ffc107; background: #fffbeb; }
.toast-notification.toast-info { border-left-color: #0dcaf0; background: #f0f9ff; }

.toast-notification .toast-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.toast-notification.toast-success .toast-icon { color: #1E6332; }
.toast-notification.toast-error .toast-icon { color: #dc3545; }
.toast-notification.toast-warning .toast-icon { color: #ffc107; }
.toast-notification.toast-info .toast-icon { color: #0dcaf0; }


@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* Modal Enhancements */
.modal-confirm {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    align-items: center;
    justify-content: center;
}

.modal-confirm.show {
    display: flex;
}

.modal-confirm-content {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.modal-confirm-icon.success { background: #F4F0E9; color: #1E6332; }
.modal-confirm-icon.warning { background: #fff3cd; color: #664d03; }
.modal-confirm-icon.danger { background: #f8d7da; color: #dc3545; }

/* Notification Dropdown */
.notification-dropdown {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.notification-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.notification-menu.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Notification info tooltip */
.notif-info-icon {
    font-size: 12px;
    color: #adb5bd;
    cursor: pointer;
    margin-left: 3px;
    transition: color 0.2s;
}
.notif-info-icon:hover {
    color: #1E6332;
}
.notif-info-tooltip {
    display: none;
    position: fixed;
    width: 290px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.15);
    padding: 16px 18px;
    z-index: 10001;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.55;
    color: #495057;
}
.notif-info-tooltip .tooltip-title {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #1E6332;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.notif-info-tooltip ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.notif-info-tooltip li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: #4a5568;
}
.notif-info-tooltip li i {
    font-size: 11px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #f0fff4;
}

.notification-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-icon.success { background: #F4F0E9; color: #1E6332; }
.notification-item-icon.info { background: #cfe2ff; color: #084298; }
.notification-item-icon.warning { background: #fff3cd; color: #664d03; }

.notification-footer {
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid #dee2e6;
}

/* Search Box Enhancement */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    transition: var(--eff-transition);
}

.search-box input:focus {
    border-color: var(--eff-primary);
    box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* ==================== GLOBAL SEARCH (header) ==================== */
.global-search-container {
    width: 360px;
    max-width: 100%;
}

.global-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 38px;
    background: #F4F0E9;
    border: 1.5px solid transparent;
    border-radius: 999px;
    padding: 0 14px 0 40px;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.global-search-input-wrap:hover {
    background: #ede7d8;
}
.global-search-input-wrap:focus-within {
    background: #fff;
    border-color: #1E6332;
    box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.15);
}

.global-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 13px;
    pointer-events: none;
    transition: color 0.18s ease;
}
.global-search-input-wrap:focus-within .global-search-icon { color: #1E6332; }

.global-search-input {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    padding: 0;
}
.global-search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.global-search-clear {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 4px;
    font-size: 11px;
    transition: background-color 0.15s ease, color 0.15s ease;
    padding: 0;
}
.global-search-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1E6332;
}

/* Shrink at narrower viewport widths so it doesn't crowd the action buttons */
@media (max-width: 1280px) {
    .global-search-container { width: 300px; }
}
@media (max-width: 1100px) {
    .global-search-container { width: 240px; }
    .global-search-input { font-size: 13px; }
}

/* Dark theme */
body.dark-theme .global-search-input-wrap {
    background: #1e293b;
    border-color: transparent;
}
body.dark-theme .global-search-input-wrap:hover { background: #2a3a52; }
body.dark-theme .global-search-input-wrap:focus-within {
    background: #0f172a;
    border-color: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}
body.dark-theme .global-search-input { color: #f1f5f9; }
body.dark-theme .global-search-input::placeholder { color: #64748b; }
body.dark-theme .global-search-icon { color: #94a3b8; }
body.dark-theme .global-search-input-wrap:focus-within .global-search-icon { color: #4ade80; }
body.dark-theme .global-search-clear:hover { background: rgba(255, 255, 255, 0.08); color: #4ade80; }

/* Global Search Results */
.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    z-index: 1050;
    max-height: 500px;
    overflow-y: auto;
    margin-top: 6px;
    border: 1px solid rgba(0,0,0,0.05);
}

.search-result-section {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.search-result-section:last-child {
    border-bottom: none;
}

.search-result-section-title {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item .result-icon {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.search-result-item .result-icon.claim { background: #F4F0E9; color: #1E6332; }
.search-result-item .result-icon.draft { background: #fef3c7; color: #d97706; }
.search-result-item .result-icon.deceased { background: #cfe2ff; color: #0d6efd; }

.search-result-item .result-info {
    flex: 1;
    min-width: 0;
}

.search-result-item .result-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .result-subtitle {
    font-size: 11px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item .result-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    flex-shrink: 0;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

/* ==================== TABLE STYLES ==================== */
.table-container {
    background: #fff;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--eff-shadow);
}

.table-header {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h5 {
    margin: 0;
    font-weight: 600;
    color: #212529;
}

.table {
    margin: 0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding: 0.875rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-approved { background-color: #F4F0E9; color: #214A3E; }
.status-pending { background-color: #fff3cd; color: #664d03; }
.status-processing { background-color: #fef3c7; color: #92400e; }
.status-in-process { background-color: #f6efe4; color: #8a6536; }
.status-denied { background-color: #f8d7da; color: #842029; }
.status-funded { background-color: #e7f0ea; color: #1e6332; }
.status-closed { background-color: #eceeef; color: #475453; }
.status-withdrawn { background-color: #fbe9e9; color: #b00000; }

/* Action buttons in tables */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    transition: var(--eff-transition);
}

.table-actions .btn-icon:hover {
    border-color: var(--eff-primary);
    color: var(--eff-primary);
    background: #f0fff4;
}

.table-actions .btn-icon.danger:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

/* ==================== FOOTER STYLES ==================== */
.main-footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width-expanded);
    right: 0;
    z-index: 100;
    transition: var(--sidebar-transition);
}

.sidebar-collapsed .main-footer {
    left: var(--sidebar-width-collapsed);
}

.footer-logo {
    height: 32px;
}

.footer-brand {
    font-weight: 600;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    .quick-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 992px) {
    .page-section.flex-section.active {
        flex-direction: column;
    }
    .step-nav {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid #dee2e6;
        position: static;
        max-height: none;
        left: auto;
        top: auto;
        bottom: auto;
        border-right: none;
    }
    .step-item {
        padding-bottom: 0;
        padding-right: 2rem;
        flex-shrink: 0;
    }
    .step-item::before {
        display: none;
    }
    .form-area {
        padding: 2rem;
    }
    #page-create-claim .form-area {
        margin-left: 0;
    }
    .form-content {
        max-width: 100%;
    }
    .stats-card-content {
        flex-direction: column;
        text-align: center;
    }
    .stats-card-info {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 1rem;
    }
    .welcome-banner {
        padding: 1rem 1.25rem;
    }
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    .quick-action-btn {
        justify-content: center;
        padding: 0.65rem 0.75rem;
        font-size: 0.9rem;
    }
    .stats-card {
        padding: 1rem;
    }
    .stats-card h3 {
        font-size: 1.5rem;
    }
    .table-container {
        margin-bottom: 1rem;
    }
    .main-header {
        padding: 0.5rem;
    }
    .notification-menu {
        position: fixed;
        right: 10px;
        left: 10px;
        width: auto;
    }
    .toast-container {
        left: 10px;
        right: 10px;
    }
    .toast-notification {
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    .main-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    .main-footer > div {
        justify-content: center !important;
    }
}

.app-container {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.app-container.active {
    display: flex;
}

.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a1a0f 0%, #0d2818 50%, #0a1a0f 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Logo wrapper — positions glow, ring, and avatar */
.loading-logo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulsing glow behind the avatar */
.loading-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 133, 66, 0.35) 0%, rgba(30, 99, 50, 0.15) 50%, transparent 70%);
    animation: loadingGlow 3s ease-in-out infinite;
}

@keyframes loadingGlow {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.4); opacity: 0.8; }
}

/* Spinning ring around the avatar */
.loading-ring {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top: 2px solid #18A74B;
    border-right: 2px solid rgba(47, 133, 66, 0.3);
    animation: progressSpin 1.8s linear infinite;
}

/* Second ring — counter-rotating, slower */
.loading-ring::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(47, 133, 66, 0.2);
    border-left: 1px solid rgba(47, 133, 66, 0.1);
    animation: progressSpin 3s linear infinite reverse;
}

/* The EFF avatar circle */
.loading-avatar {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E6332 0%, #214A3E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(47, 133, 66, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.05);
    animation: loadingPulse 2.5s ease-in-out infinite;
    z-index: 1;
}

.loading-avatar span {
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(47, 133, 66, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.05); }
    50% { transform: scale(1.06); box-shadow: 0 0 50px rgba(47, 133, 66, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.08); }
}

/* Status text with animated dots */
.loading-status {
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin: 0;
    min-width: 200px;
    text-align: center;
}

.loading-status::after {
    content: '';
    animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Blur the app behind the overlay */
.app-container.loading-blur {
    /* No filter: blur() — the loading overlay is fully opaque (solid gradient,
       opacity 1) and covers the whole app, so blurring the app behind it was
       INVISIBLE yet cost paint on every load (including first load). */
    transition: filter 0.3s ease;
}

.app-container.loading-blur-clear {
    filter: none;
    transition: filter 0.6s ease;
}

/* ==================== Google Places Autocomplete + Mini Map ==================== */
.address-map-container {
    display: none;
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    transition: all 0.3s ease;
}

.address-map-container.map-visible {
    display: block;
}

.address-mini-map {
    width: 100%;
    height: 200px;
    background: #f8fafc;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    gap: 8px;
    background: #f8fafc;
}

.map-placeholder i {
    font-size: 28px;
    color: #cbd5e1;
}

.map-placeholder span {
    font-size: 13px;
    font-weight: 500;
}

/* Google Places autocomplete dropdown overrides */
.pac-container {
    z-index: 100000 !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    margin-top: 4px !important;
    font-family: inherit !important;
    overflow: hidden !important;
}

.pac-item {
    padding: 10px 16px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    border-top: 1px solid #f1f5f9 !important;
    transition: background 0.15s ease !important;
}

.pac-item:first-child {
    border-top: none !important;
}

.pac-item:hover {
    background: #F4F0E9 !important;
}

.pac-item-selected {
    background: #F4F0E9 !important;
}

.pac-icon {
    margin-right: 10px !important;
}

.pac-item-query {
    font-size: 14px !important;
    color: #1e293b !important;
    font-weight: 500 !important;
}

.pac-matched {
    font-weight: 700 !important;
    color: #1E6332 !important;
}

.pac-container::after {
    padding: 8px 16px !important;
    background: #f8fafc !important;
}

/* ── PDF Beneficiary Picker Modal ── */
.pdf-bene-picker {
    background: #fff;
    border-radius: 16px;
    width: 520px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: pdfPickerIn 0.2s ease-out;
}
@keyframes pdfPickerIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.pdf-bene-picker-header {
    background: linear-gradient(135deg, #1E6332, #214A3E);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.pdf-bene-picker-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.pdf-bene-picker-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
}
.pdf-bene-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.pdf-bene-card:hover {
    border-color: #2F8542;
    background: #F4F0E9;
}
.pdf-bene-card:has(.pdf-bene-cb:checked) {
    border-color: #1E6332;
    background: #f0faf4;
}
.pdf-bene-cb {
    margin-top: 4px;
    accent-color: #1E6332;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}
.pdf-bene-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.pdf-bene-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.pdf-bene-info {
    flex: 1;
    min-width: 0;
}
.pdf-bene-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}
.pdf-bene-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    color: #6b7280;
}
.pdf-bene-meta i {
    margin-right: 3px;
    color: #9ca3af;
    font-size: 11px;
}
.pdf-bene-select-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
}
.pdf-bene-select-btn:hover {
    background: #e5e7eb;
}
.pdf-bene-cancel-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}
.pdf-bene-cancel-btn:hover {
    background: #e5e7eb;
}
.pdf-bene-download-btn, .pdf-bene-merge-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s;
}
.pdf-bene-download-btn {
    background: linear-gradient(135deg, #1E6332, #2F8542);
}
.pdf-bene-merge-btn {
    background: linear-gradient(135deg, #214A3E, #1E6332);
}
.pdf-bene-download-btn:hover, .pdf-bene-merge-btn:hover {
    opacity: 0.9;
}
.pdf-bene-download-btn:disabled, .pdf-bene-merge-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   Draft Assignment Form Picker — Policy → Beneficiary selection
   ═══════════════════════════════════════════════════════════════ */

.draft-assign-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.draft-assign-picker {
    background: #fff;
    border-radius: 16px;
    width: 640px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Header */
.draft-assign-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1E6332 0%, #214A3E 100%);
    flex-shrink: 0;
}
.draft-assign-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.draft-assign-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}
.draft-assign-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    font-family: 'Futura PT', 'Jost', sans-serif;
}
.draft-assign-header-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}
.draft-assign-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
}
.draft-assign-close:hover {
    color: #fff;
}

/* Description */
.draft-assign-desc {
    padding: 12px 20px;
    font-size: 12.5px;
    color: #6b7280;
    background: #fafaf8;
    border-bottom: 1px solid #f0eeeb;
    flex-shrink: 0;
}
.draft-assign-desc i {
    color: #1E6332;
    margin-right: 4px;
}

/* Body (scrollable) */
.draft-assign-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

/* Policy card */
.draft-assign-policy {
    border: 1px solid #e8e4df;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.draft-assign-policy:last-child {
    margin-bottom: 0;
}
.draft-assign-policy:hover {
    border-color: #d0ccc6;
}

/* Policy header row */
.draft-assign-pol-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fafaf8;
}

/* Policy checkbox */
.draft-assign-pol-cb-wrap {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.draft-assign-pol-cb {
    width: 18px;
    height: 18px;
    accent-color: #1E6332;
    cursor: pointer;
}

/* IC badge */
.draft-assign-pol-ic {
    flex-shrink: 0;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.draft-assign-pol-ic img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: contain;
}

/* Policy info */
.draft-assign-pol-info {
    flex: 1;
    min-width: 0;
}
.draft-assign-pol-name {
    font-size: 13px;
    font-weight: 600;
    color: #231F20;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* IC name + feature icons on one line (name keeps its ellipsis, icons never shrink) */
.draft-assign-pol-nameline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.draft-assign-pol-nameline .draft-assign-pol-name { flex: 0 1 auto; }
.draft-assign-pol-nameline .v3-pol-feats { flex-shrink: 0; }
.draft-assign-pol-meta {
    display: flex;
    gap: 12px;
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 2px;
    flex-wrap: wrap;
}

/* Right side badge + chevron */
.draft-assign-pol-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.draft-assign-pol-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    background: #f0eeeb;
    color: #9ca3af;
    transition: all 0.2s;
}
.draft-assign-pol-badge.active {
    background: #F4F0E9;
    color: #1E6332;
}

/* Beneficiary list (always visible) */
.draft-assign-bene-list {
    border-top: 1px solid #f0eeeb;
}

.draft-assign-bene-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}
.draft-assign-bene-empty i {
    margin-right: 4px;
}

/* Beneficiary card */
.draft-assign-bene-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 42px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f8f7f5;
}
.draft-assign-bene-card:last-child {
    border-bottom: none;
}
.draft-assign-bene-card:hover {
    background: #f8f7f5;
}
.draft-assign-bene-card:has(.draft-assign-bene-cb:checked) {
    background: #f6f9f7;
}
.draft-assign-bene-cb {
    width: 16px;
    height: 16px;
    accent-color: #1E6332;
    cursor: pointer;
    flex-shrink: 0;
}

.draft-assign-bene-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.draft-assign-bene-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.draft-assign-bene-info {
    flex: 1;
    min-width: 0;
}
.draft-assign-bene-name {
    font-size: 13px;
    font-weight: 600;
    color: #231F20;
}
.draft-assign-bene-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 1px;
    flex-wrap: wrap;
}
.draft-assign-bene-meta i {
    font-size: 10px;
    margin-right: 2px;
}

/* Footer */
.draft-assign-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #e8e4df;
    background: #fafaf8;
    flex-shrink: 0;
    gap: 12px;
}
.draft-assign-count {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}
.draft-assign-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.draft-assign-cancel {
    padding: 8px 18px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.draft-assign-cancel:hover {
    background: #f3f4f6;
}
.draft-assign-download, .draft-assign-merge {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.draft-assign-download {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
}
.draft-assign-download:hover {
    filter: brightness(1.1);
}
.draft-assign-merge {
    background: #475453;
    color: #fff;
}
.draft-assign-merge:hover {
    background: #374140;
}
.draft-assign-download:disabled, .draft-assign-merge:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: none;
}

/* ═══════════════════════════════════════════════════════════════
   eSign Modal — Zoho Sign beneficiary picker
   ═══════════════════════════════════════════════════════════════ */

.esign-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pdfPickerIn 0.2s ease;
}
.esign-modal {
    background: #fff;
    border-radius: 16px;
    width: 520px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}
.esign-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1E6332, #214A3E);
    color: #fff;
}
.esign-modal-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.esign-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.esign-modal-close:hover { color: #fff; }

.esign-modal-subheader {
    padding: 10px 20px;
    background: #F4F0E9;
    border-bottom: 1px solid #E8DFD0;
}
.esign-claim-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.esign-claim-name {
    font-weight: 600;
    font-size: 14px;
    color: #1E6332;
}
.esign-claim-meta {
    font-size: 12px;
    color: #666;
}

.esign-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}

/* Standalone claim E-Signatures modal (opened from the claim Actions button) —
   reuses the .esign-modal shell; just a slightly wider body, a muted claim-name
   subtitle in the header, and a min-height so it doesn't collapse while loading. */
.esign-claim-modal { width: 560px; }
.esign-claim-modal-sub {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.85;
    padding-left: 8px;
    margin-left: 2px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
}
.esign-claim-modal-body { min-height: 180px; }

.esign-select-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}
.esign-select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}
.esign-selected-count {
    font-size: 12px;
    color: #888;
}

.esign-bene-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.esign-bene-card:hover {
    border-color: #2F8542;
    background: #fafff8;
}
.esign-bene-card.no-email {
    opacity: 0.55;
    border-color: #f0e0e0;
    background: #fef8f8;
}
/* Beneficiary with an active e-signature already pending — can't re-send yet. */
.esign-bene-card.already-sent {
    border-color: #cfe6d8;
    background: #f3faf5;
}
.esign-bene-card.already-sent:hover {
    border-color: #cfe6d8;
    background: #f3faf5;
}
.esign-bene-card.already-sent .esign-bene-row { cursor: not-allowed; }
.esign-bene-pending {
    color: #1E6332;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.esign-bene-pending i { color: #2F8542; }

.esign-bene-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.esign-bene-card.no-email .esign-bene-row {
    cursor: not-allowed;
}
.esign-bene-cb {
    width: 18px;
    height: 18px;
    accent-color: #1E6332;
    flex-shrink: 0;
}
.esign-bene-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.esign-bene-info {
    flex: 1;
    min-width: 0;
}
.esign-bene-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
}
.esign-bene-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}
.esign-bene-email {
    color: #1E6332;
}
.esign-no-email {
    color: #dc3545;
    font-weight: 500;
}

.esign-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 9px 18px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
/* Preview note tucked into the footer's empty left space */
.esign-footer-note {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #777;
    line-height: 1.35;
    max-width: 62%;
}
.esign-footer-note i { color: #9aa0a6; flex-shrink: 0; }
.esign-cancel-btn {
    padding: 7px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
}
.esign-cancel-btn:hover { background: #f5f5f5; }

.esign-send-btn {
    padding: 7px 22px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s;
}
.esign-send-btn:hover { opacity: 0.9; }
.esign-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── eSign Confirmation Modal ── */
/* Wide variant — Confirm & Send matches the near-full-screen claim detail
   modal (98% width / 98vh). Explicit height so the PDF preview fills. */
.esign-modal--wide {
    width: 98%;
    max-width: none;
    height: 98vh;
    max-height: 98vh;
}

/* E-signature blocked (IC does not accept e-signatures) — modal body */
.esign-blocked-body {
    text-align: center;
    padding: 30px 28px 24px;
}
.esign-blocked-icon {
    font-size: 42px;
    color: #dc2626;
    margin-bottom: 14px;
}
.esign-blocked-ic {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.esign-blocked-msg {
    font-size: 13.5px;
    color: #555;
    line-height: 1.55;
    max-width: 460px;
    margin: 0 auto;
}

/* Claim-detail e-signature section — not-accepted notice */
.esign-status-blocked {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
}
.esign-status-blocked > i {
    color: #dc2626;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}
.esign-status-blocked strong {
    display: block;
    color: #991b1b;
    font-size: 13.5px;
    margin-bottom: 3px;
}
.esign-status-blocked p {
    margin: 0;
    font-size: 12.5px;
    color: #7f1d1d;
    line-height: 1.45;
}

/* Muted quick-action buttons when blocked / unavailable (e-Signature, Funding Confirmation) */
.btn.esign-btn-blocked,
.btn.qa-btn-blocked {
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    background: #f9fafb !important;
    cursor: not-allowed;
}
.btn.esign-btn-blocked:hover,
.btn.qa-btn-blocked:hover {
    color: #6b7280 !important;
    background: #f3f4f6 !important;
}

body.dark-theme .esign-status-blocked { background: rgba(220,38,38,0.12) !important; border-color: rgba(220,38,38,0.35) !important; }
body.dark-theme .esign-status-blocked strong,
body.dark-theme .esign-status-blocked p { color: #fca5a5 !important; }
body.dark-theme .btn.esign-btn-blocked,
body.dark-theme .btn.qa-btn-blocked { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; color: var(--theme-text-secondary) !important; }

/* Claim context lives in the green header bar (no separate subheader) */
.esign-modal-header--confirm {
    gap: 16px;
}
.esign-modal-header--confirm .esign-modal-title,
.esign-modal-header--confirm .esign-modal-close {
    flex-shrink: 0;
}
.esign-header-claim {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1px;
}
.esign-header-claim-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.esign-header-claim-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Read-only "who is shown" chip in the preview header */
.esign-preview-who {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: #1E6332;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #eaf4ee;
    border: 1px solid #cfe6d8;
    padding: 4px 12px;
    border-radius: 999px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Prominent recipient switcher — top of the left review pane */
.esign-recipient-bar {
    border: 1px solid #cfe6d8;
    background: linear-gradient(180deg, #f3faf5, #eaf4ee);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.esign-recipient-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #1E6332;
    margin-bottom: 10px;
}
.esign-recipient-count {
    margin-left: auto;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    font-weight: 600;
    color: #557;
    background: #fff;
    border: 1px solid #d8e6dc;
    padding: 2px 9px;
    border-radius: 999px;
}
.esign-recipient-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.esign-recipient-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid #d3e3d8;
    background: #fff;
    color: #333;
    border-radius: 999px;
    padding: 5px 14px 5px 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
    max-width: 100%;
}
.esign-recipient-pill:hover {
    border-color: #2F8542;
    box-shadow: 0 2px 8px rgba(30,99,50,0.12);
}
.esign-recipient-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9aa0a6, #c0c5cb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.esign-recipient-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.esign-recipient-pill.active {
    border-color: #1E6332;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    box-shadow: 0 3px 10px rgba(30,99,50,0.25);
}
.esign-recipient-pill.active .esign-recipient-avatar {
    background: rgba(255,255,255,0.28);
}

/* Dark theme for the recipient picker + who chip */
body.dark-theme .esign-recipient-bar { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }
body.dark-theme .esign-recipient-pill,
body.dark-theme .esign-recipient-count,
body.dark-theme .esign-preview-who { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }

/* IC warning banner inside Confirm & Send (e.g. special non-notarized assignment) */
.esign-ic-warning {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
}
.esign-ic-warning > i {
    color: #d97706;
    font-size: 18px;
    margin-top: 1px;
    flex-shrink: 0;
}
.esign-ic-warning-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: #78350f;
    font-weight: 700;
}

/* "Sending…" modal — clear green spinner */
.esign-sending-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 46px 32px;
    text-align: center;
    min-height: 200px;
}
.esign-sending-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid #d8e6dc;
    border-top-color: #1E6332;
    border-radius: 50%;
    animation: progressSpin 0.8s linear infinite;
}
.esign-sending-text {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1E6332;
}
.esign-sending-sub {
    margin: 0;
    font-size: 12px;
    color: #888;
}
body.dark-theme .esign-ic-warning { background: rgba(245,158,11,0.12) !important; border-color: rgba(245,158,11,0.4) !important; }
body.dark-theme .esign-ic-warning-text { color: #fcd34d !important; }

/* Two-pane body: left = field review, right = live PDF preview */
.esign-confirm-body {
    display: flex;
    padding: 0;
    overflow: hidden;
}
.esign-confirm-review {
    flex: 1 1 44%;
    min-width: 0;
    overflow-y: auto;
    padding: 14px 18px;
    border-right: 1px solid #ececec;
}
.esign-confirm-preview {
    flex: 1 1 56%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f3f4f5;
}
.esign-preview-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
}
.esign-preview-title {
    font-size: 13px;
    font-weight: 600;
    color: #1E6332;
    display: flex;
    align-items: center;
    gap: 8px;
}
.esign-preview-hint {
    font-weight: 400;
    color: #999;
    font-size: 12px;
}
.esign-preview-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
}
.esign-preview-tab {
    border: 1px solid #d8d8d8;
    background: #fff;
    color: #555;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.esign-preview-tab:hover { border-color: #2F8542; color: #1E6332; }
.esign-preview-tab.active {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    border-color: #1E6332;
    color: #fff;
}
.esign-preview-stage {
    position: relative;
    flex: 1;
    min-height: 0;
}
.esign-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #525659;
}
.esign-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f3f4f5;
    color: #888;
    font-size: 13px;
    z-index: 2;
}
.esign-preview-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #d8e6dc;
    border-top-color: #1E6332;
    border-radius: 50%;
    animation: progressSpin 0.8s linear infinite;
}
.esign-preview-note {
    padding: 8px 16px;
    font-size: 11.5px;
    color: #777;
    background: #fff;
    border-top: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Dark theme — the new preview classes don't match the broad esign-modal selector */
body.dark-theme .esign-confirm-review { border-right-color: var(--theme-border) !important; }
body.dark-theme .esign-confirm-preview,
body.dark-theme .esign-preview-stage,
body.dark-theme .esign-preview-loading { background: var(--theme-surface-alt) !important; }
body.dark-theme .esign-preview-head,
body.dark-theme .esign-preview-note { background: var(--theme-surface) !important; border-color: var(--theme-border) !important; }
body.dark-theme .esign-preview-tab { background: var(--theme-surface-alt) !important; border-color: var(--theme-border) !important; }

/* Grid layout — Document Fields + Beneficiary side-by-side, Signing Order full-width below */
.esign-confirm-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}
.esign-confirm-layout .esign-confirm-section {
    margin-bottom: 0; /* grid gap handles spacing */
}
.esign-confirm-section--full {
    grid-column: 1 / -1;
}

.esign-confirm-section {
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.esign-confirm-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1E6332;
    padding: 10px 14px;
    background: #F4F0E9;
    border-bottom: 1px solid #E8DFD0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.esign-confirm-grid {
    padding: 8px 14px;
}
.esign-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f5;
}
.esign-confirm-row:last-child { border-bottom: none; }
.esign-confirm-label {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
    width: 130px;
}
.esign-confirm-val {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    text-align: right;
}
.esign-confirm-val-na {
    color: #d97706;
    font-style: italic;
}
.esign-confirm-val-email {
    color: #1E6332;
}
.esign-confirm-signers {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.esign-confirm-signer {
    display: flex;
    align-items: center;
    gap: 12px;
}
.esign-confirm-signer-order {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.esign-confirm-signer-email {
    font-size: 12px;
    color: #888;
}
.esign-confirm-warning {
    padding: 10px 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.esign-confirm-warning i { margin-top: 2px; }

/* ── eSign Status Section in Claim Detail Panel ── */
.esign-status-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #888;
    font-size: 13px;
}
.esign-status-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    color: #999;
    font-size: 13px;
}
.esign-status-empty i { font-size: 16px; }

.esign-status-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.esign-status-card:hover { border-color: #ccc; }

.esign-status-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.esign-status-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.esign-status-card-time {
    font-size: 11px;
    color: #999;
}
.esign-status-pct {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* Status badges */
.esign-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.esign-badge-sent { background: #dbeafe; color: #1d4ed8; }
.esign-badge-viewed { background: #fef3c7; color: #92400e; }
.esign-badge-signed { background: #d1fae5; color: #065f46; }
.esign-badge-completed { background: #d1fae5; color: #065f46; border: 1px solid #065f46; }
.esign-badge-declined { background: #fee2e2; color: #991b1b; }
.esign-badge-expired { background: #f3f4f6; color: #6b7280; }

.esign-status-card-body { padding: 12px 14px; }

.esign-status-recipient {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 6px;
}
.esign-status-recipient i { color: #1E6332; font-size: 12px; }
.esign-status-email {
    font-size: 12px;
    color: #888;
    margin-left: 4px;
}
.esign-status-email-row {
    font-size: 12px;
    color: #888;
    padding-left: 22px;
    margin-top: -2px;
    margin-bottom: 4px;
}
.esign-status-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}
.esign-status-meta i { margin-right: 3px; }

/* Progress tracker */
.esign-progress-track {
    display: flex;
    align-items: center;
    gap: 0;
    padding-top: 4px;
}
.esign-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.esign-progress-step span {
    font-size: 10px;
    color: #bbb;
    font-weight: 500;
}
.esign-progress-step.done span { color: #1E6332; }
.esign-progress-step.current span { color: #1E6332; font-weight: 700; }

/* Compact progress steps inside sidebar status cards */
.detail-panel-sidebar .esign-progress-step {
    flex-shrink: 1;
    min-width: 0;
}
.detail-panel-sidebar .esign-progress-dot {
    width: 22px;
    height: 22px;
    font-size: 9px;
}
.detail-panel-sidebar .esign-progress-step span {
    font-size: 9px;
}
.detail-panel-sidebar .esign-progress-ts {
    font-size: 7.5px;
}
.detail-panel-sidebar .esign-progress-line {
    min-width: 6px;
    margin-bottom: 26px;
}

.esign-progress-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
}
.esign-progress-step.done .esign-progress-dot {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
}
.esign-progress-step.current .esign-progress-dot {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.2);
    animation: esignPulse 2s ease-in-out infinite;
}
@keyframes esignPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(30, 99, 50, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(30, 99, 50, 0.15); }
}

.esign-progress-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    min-width: 12px;
    margin: 0 2px;
    margin-bottom: 30px;
}
.esign-progress-line.done { background: #1E6332; }

.esign-progress-declined {
    font-size: 12px;
    color: #dc3545;
    font-weight: 600;
    padding: 4px 0;
}
.esign-progress-declined i { margin-right: 4px; }

/* Progress step timestamps */
.esign-progress-ts {
    display: block;
    font-size: 8.5px;
    color: #999;
    font-weight: 400;
    white-space: nowrap;
    line-height: 1.1;
    margin-top: 1px;
}
.esign-progress-step.done .esign-progress-ts { color: #2F8542; }
.esign-progress-step.current .esign-progress-ts { color: #1E6332; font-weight: 600; }
.esign-progress-declined .esign-progress-ts {
    display: inline;
    font-size: 10px;
    color: #dc3545;
    margin-left: 8px;
    font-weight: 400;
}

/* Expiration badge */
.esign-expires {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #666;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 8px;
    background: #f5f5f5;
}
.esign-expires i { font-size: 9px; }
.esign-expires.urgent {
    color: #e67700;
    background: #fff8e1;
}
.esign-expires.expired {
    color: #dc3545;
    background: #fef2f2;
}

/* Sent by info */
.esign-sent-by {
    font-size: 11px;
    color: #888;
}
.esign-sent-by i { margin-right: 3px; font-size: 10px; }

/* Beneficiary eSign — compact inline rows */
/* Beneficiary eSign section — scrolls when there are many documents */
.ben-esign-section {
    margin-top: 8px;
    padding: 10px 12px 12px;
    border-top: 1px dashed #e5e7eb;
    max-height: 360px;
    overflow-y: auto;
}
.ben-esign-section::-webkit-scrollbar { width: 8px; }
.ben-esign-section::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2F8542, #1E6332);
    border-radius: 4px;
}
.ben-esign-section::-webkit-scrollbar-track { background: transparent; }
.ben-es-header {
    font-size: 12px;
    font-weight: 600;
    color: #1E6332;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ben-es-header i { font-size: 11px; }
.ben-es-loading {
    padding: 8px 0;
    text-align: center;
    color: #1E6332;
    font-size: 12px;
}

/* Beneficiary eSign mini-card */
.ben-es-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 13px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
}
.ben-es-card:last-child { margin-bottom: 2px; }
.ben-es-card:hover {
    border-color: #1E6332;
    box-shadow: 0 2px 8px rgba(30, 99, 50, 0.1);
}
.ben-es-card.ben-es-completed { border-left: 3px solid #155724; }
.ben-es-card.ben-es-sent { border-left: 3px solid #1a73e8; }
.ben-es-card.ben-es-viewed { border-left: 3px solid #e67700; }
.ben-es-card.ben-es-signed { border-left: 3px solid #1E6332; }
.ben-es-card.ben-es-declined { border-left: 3px solid #dc3545; }
.ben-es-card.ben-es-expired { border-left: 3px solid #888; }

.ben-es-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.ben-es-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    flex-shrink: 0;
}
.ben-es-badge i { font-size: 10px; }
.ben-es-sent { background: #e8f4fd; color: #1a73e8; }
.ben-es-viewed { background: #fff8e1; color: #e67700; }
.ben-es-signed { background: #F4F0E9; color: #1E6332; }
.ben-es-completed { background: #d4edda; color: #155724; }
.ben-es-declined { background: #fef2f2; color: #dc3545; }
.ben-es-expired { background: #f5f5f5; color: #888; }

.ben-es-exp {
    font-size: 11px;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.ben-es-exp i { font-size: 10px; }
.ben-es-exp.urgent { color: #e67700; }
.ben-es-exp.expired { color: #dc3545; }

.ben-es-card-time {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}
.ben-es-card-arrow {
    font-size: 10px;
    color: #ccc;
    transition: transform 0.15s;
}
.ben-es-card:hover .ben-es-card-arrow { color: #1E6332; transform: translateX(2px); }

.ben-es-card-doc {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
    line-height: 1.4;
}
.ben-es-card-doc i { color: #1E6332; font-size: 11px; margin-right: 4px; }

.ben-es-card-waiting {
    font-size: 12px;
    color: #b08600;
    font-style: italic;
    margin-bottom: 6px;
}
.ben-es-card-waiting i { font-size: 10px; margin-right: 3px; }

.ben-es-card-sent-by {
    font-size: 11.5px;
    color: #888;
    margin-top: 6px;
}
.ben-es-card-sent-by i { font-size: 10px; margin-right: 3px; }

/* Mini progress tracker inside ben card */
.ben-es-progress {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 2px 0;
}
.ben-es-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.ben-es-step span {
    font-size: 8.5px;
    color: #bbb;
    font-weight: 500;
}
.ben-es-step.done span { color: #1E6332; }
.ben-es-step.current span { color: #1E6332; font-weight: 700; }

.ben-es-step-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}
.ben-es-step.done .ben-es-step-dot {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
}
.ben-es-step.current .ben-es-step-dot {
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(30, 99, 50, 0.2);
}

.ben-es-step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    min-width: 8px;
    margin: 0 2px;
    margin-bottom: 14px;
}
.ben-es-step-line.done { background: #1E6332; }

/* Clickable status cards */
.esign-clickable { cursor: pointer; }
.esign-clickable:hover { border-color: #1E6332; box-shadow: 0 2px 8px rgba(30,99,50,0.1); }

/* Download buttons on sidebar status cards */
.esign-card-downloads {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.esign-card-dl-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid #1E6332;
    border-radius: 6px;
    background: #fff;
    color: #1E6332;
    cursor: pointer;
    transition: all 0.15s;
}
.esign-card-dl-btn:hover {
    background: #1E6332;
    color: #fff;
}
.esign-card-dl-btn.cert {
    border-color: #6B4A28;
    color: #6B4A28;
}
.esign-card-dl-btn.cert:hover {
    background: #6B4A28;
    color: #fff;
}

/* Download section in detail overlay */
.esign-header-downloads {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.esign-header-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid rgba(255,255,255,0.6);
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.esign-header-dl-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
}
.esign-header-dl-btn i { font-size: 13px; }
.esign-header-dl-btn.cert {
    border-color: rgba(255,255,255,0.4);
}
.esign-header-dl-btn.cert:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.3);
}
.esign-header-dl-btn.reminder {
    border-color: rgba(255,220,100,0.6);
    background: rgba(255,200,50,0.15);
}
.esign-header-dl-btn.reminder:hover {
    border-color: rgba(255,220,100,1);
    background: rgba(255,200,50,0.3);
}
.esign-header-dl-btn.recall {
    border-color: rgba(255,150,150,0.7);
    background: rgba(220,40,40,0.18);
}
.esign-header-dl-btn.recall:hover {
    border-color: #fff;
    background: rgba(220,40,40,0.35);
}

/* ── Recall confirmation prompt (sits above the detail overlay) ── */
.esign-recall-backdrop {
    position: fixed; inset: 0; z-index: 10250;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.esign-recall-card {
    width: min(460px, 94vw);
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,0.3);
}
.esign-recall-head {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff; font-weight: 800; font-size: 1.05rem;
    padding: 16px 20px; display: flex; align-items: center; gap: 9px;
}
.esign-recall-body { padding: 18px 20px 6px; }
.esign-recall-text { font-size: 0.88rem; color: #475569; line-height: 1.5; margin: 0 0 14px; }
.esign-recall-label { font-size: 0.78rem; font-weight: 700; color: #334155; display: block; margin-bottom: 6px; }
.esign-recall-textarea {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 9px;
    padding: 10px 12px; font-size: 0.9rem; font-family: inherit; resize: vertical;
    box-sizing: border-box;
}
.esign-recall-textarea:focus { outline: none; border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
.esign-recall-err { color: #dc2626; font-size: 0.8rem; margin-top: 8px; }
.esign-recall-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 20px 20px;
}
.esign-recall-confirm {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; border: none; border-radius: 9px;
    background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff;
    font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.esign-recall-confirm:hover { filter: brightness(1.06); }
.esign-recall-confirm:disabled { opacity: 0.7; cursor: default; }

/* ── eSign Detail Overlay ── */
/* Status context banner in detail overlay */
.esign-status-context {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border-left: 4px solid #ccc;
    background: #f8f8f8;
}
.esign-status-context-now {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.45;
}
.esign-status-context-now i { margin-right: 6px; }
.esign-status-context-next {
    font-size: 12px;
    color: #555;
    margin-top: 6px;
    line-height: 1.4;
}
.esign-status-context-next i { font-size: 10px; margin-right: 4px; color: #888; }
.esign-ctx-waiting { background: #fffbeb; border-left-color: #f59e0b; }
.esign-ctx-waiting .esign-status-context-now { color: #92400e; }
.esign-ctx-waiting .esign-status-context-now i { color: #f59e0b; }
.esign-ctx-action { background: #eff6ff; border-left-color: #3b82f6; }
.esign-ctx-action .esign-status-context-now { color: #1e3a5f; }
.esign-ctx-action .esign-status-context-now i { color: #3b82f6; }
.esign-ctx-completed { background: #f0fdf4; border-left-color: #18A74B; }
.esign-ctx-completed .esign-status-context-now { color: #14532d; }
.esign-ctx-completed .esign-status-context-now i { color: #18A74B; }
.esign-ctx-declined { background: #fef2f2; border-left-color: #dc2626; }
.esign-ctx-declined .esign-status-context-now { color: #7f1d1d; }
.esign-ctx-declined .esign-status-context-now i { color: #dc2626; }

.esign-detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pdfPickerIn 0.2s ease;
}
.esign-detail-panel {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 98%;
    max-width: none;
    max-height: 98vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
}

/* Loading overlay — keeps the spinner up while live Zoho data loads, so the
   modal reveals fully-rendered (mirrors the claim detail .cd-loading). */
.esign-detail-loading {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: inherit;
    transition: opacity 0.2s ease;
}
.esign-detail-loading.is-hidden { opacity: 0; pointer-events: none; }
.esign-detail-loading-inner { text-align: center; padding: 24px; }
.esign-detail-loading-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border: 4px solid #e5e7eb;
    border-top-color: #1E6332;
    border-radius: 50%;
    animation: progressSpin 0.85s linear infinite;
}
.esign-detail-loading-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1E6332;
    letter-spacing: 0.2px;
}
.esign-detail-loading-sub {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 5px;
}
body.dark-theme .esign-detail-loading { background: var(--theme-surface) !important; }
body.dark-theme .esign-detail-loading-spinner { border-color: var(--theme-border); border-top-color: #6ee7b7; }
body.dark-theme .esign-detail-loading-title { color: #6ee7b7 !important; }
body.dark-theme .esign-detail-loading-sub { color: var(--theme-text-muted) !important; }
.esign-detail-header {
    background: linear-gradient(135deg, #1E6332, #214A3E);
    color: #fff;
    padding: 16px 20px 14px;
}
.esign-detail-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s;
    margin-left: auto;
}
.esign-detail-close:hover { background: rgba(255,255,255,0.3); }
.esign-detail-header-info {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.esign-detail-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}
.esign-detail-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.esign-detail-body {
    flex: 1;
    min-height: 0; /* lets the body scroll instead of overflowing the panel */
    overflow-y: auto;
    padding: 16px 20px;
}

.esign-detail-section {
    margin-bottom: 18px;
}
.esign-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1E6332;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Two-column layout */
.esign-detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 0;
}
.esign-detail-col-left {
    padding-right: 18px;
    border-right: 1px solid #eee;
}
.esign-detail-col-right {
    padding-left: 18px;
}

/* Expiration badge in header */
.esign-detail-exp {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.12);
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 500;
}
.esign-detail-exp i { font-size: 10px; }
.esign-detail-exp.urgent { color: #ffd700; background: rgba(255,215,0,0.15); }
.esign-detail-exp.expired { color: #ff6b6b; background: rgba(255,107,107,0.15); }

/* Header top with expiration and close */
.esign-detail-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Signers */
.esign-detail-signer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
}
.esign-detail-signer-order {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E6332, #2F8542);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.esign-detail-signer-info { flex: 1; min-width: 0; }
.esign-detail-signer-name {
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.esign-detail-signer-role {
    font-weight: 400;
    font-size: 11px;
    color: #888;
    background: #f3f4f6;
    padding: 1px 8px;
    border-radius: 10px;
}
.esign-detail-signer-email {
    font-size: 12px;
    color: #888;
}
.esign-detail-signer-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.esign-act-pending  { background: #f3f4f6; color: #6b7280; }
.esign-act-viewed   { background: #fef3c7; color: #92400e; }
.esign-act-signed   { background: #d1fae5; color: #065f46; }
.esign-act-declined { background: #fee2e2; color: #991b1b; }
.esign-act-expired  { background: #f3f4f6; color: #6b7280; }
.esign-act-sent     { background: #dbeafe; color: #1d4ed8; }

/* Timeline */
.esign-detail-timeline {
    position: relative;
    padding-left: 20px;
}
.esign-detail-timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e5e7eb;
}
.esign-tl-event {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}
.esign-tl-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
    z-index: 1;
    margin-left: -20px;
}
.esign-tl-sent .esign-tl-dot      { background: #dbeafe; color: #1d4ed8; }
.esign-tl-viewed .esign-tl-dot    { background: #fef3c7; color: #92400e; }
.esign-tl-signed .esign-tl-dot    { background: #d1fae5; color: #065f46; }
.esign-tl-completed .esign-tl-dot { background: #1E6332; color: #fff; }
.esign-tl-declined .esign-tl-dot  { background: #fee2e2; color: #991b1b; }
.esign-tl-expired .esign-tl-dot   { background: #f3f4f6; color: #6b7280; }

.esign-tl-content { flex: 1; min-width: 0; }
.esign-tl-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}
.esign-tl-subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}
.esign-tl-time {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Field values in detail */
.esign-detail-fields {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.esign-detail-field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 7px 14px;
    border-bottom: 1px solid #f5f5f5;
}
.esign-detail-field-row:last-child { border-bottom: none; }
.esign-detail-field-label {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
    width: 140px;
}
.esign-detail-field-val {
    font-size: 13px;
    color: #1a1a1a;
    text-align: right;
    word-break: break-all;
}
.esign-detail-field-val.na {
    color: #d97706;
    font-style: italic;
}

.esign-detail-footer {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
    display: flex;
    justify-content: flex-end;
}

/* ── eSign Activity History Table ── */
.esign-activity-loading {
    text-align: center;
    padding: 24px 16px;
    color: #1E6332;
    font-size: 13px;
}
.esign-activity-loading i { margin-right: 6px; }
.esign-activity-empty {
    text-align: center;
    padding: 20px 16px;
    color: #888;
    font-size: 13px;
}
.esign-activity-empty i { margin-right: 5px; }

.esign-activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.esign-activity-table thead th {
    background: #f8f7f5;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #666;
    padding: 8px 12px;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}
.esign-activity-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s;
}
.esign-activity-table tbody tr:last-child { border-bottom: none; }
.esign-activity-table tbody tr:hover { background: #fafaf8; }
.esign-activity-table td {
    padding: 9px 12px;
    vertical-align: middle;
}
.esign-act-time {
    font-size: 11.5px;
    color: #888;
    min-width: 100px;
    max-width: 150px;
    line-height: 1.35;
}
.esign-act-actor {
    font-weight: 500;
    color: #333;
}
.esign-act-desc {
    color: #555;
    line-height: 1.4;
}
.esign-act-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.esign-act-badge i { font-size: 9px; }
.esign-act-drafted   { background: #f3f4f6; color: #475453; }
.esign-act-emailed   { background: #dbeafe; color: #1d4ed8; }
.esign-act-viewed    { background: #fef3c7; color: #92400e; }
.esign-act-signed    { background: #d1fae5; color: #065f46; }
.esign-act-completed { background: #1E6332; color: #fff; }
.esign-act-declined  { background: #fee2e2; color: #991b1b; }

/* ==================== COMPACT VIEW MODE ==================== */
/* Sidebar */
body.compact-view .sidebar-item .sidebar-link { padding: 6px 16px !important; font-size: 13px; }
body.compact-view .sidebar-separator { margin: 6px 0 !important; }

/* Tables — tighter rows across the entire app */
body.compact-view table td { padding-top: 6px !important; padding-bottom: 6px !important; }
body.compact-view table th { padding-top: 6px !important; padding-bottom: 6px !important; }

/* Claims cards */
body.compact-view .claims-card { padding: 10px 12px !important; }
body.compact-view .claims-card .card-title { font-size: 14px !important; }

/* Deceased cards */
body.compact-view .deceased-card { padding: 10px 12px !important; }

/* Admin panel rows */
body.compact-view .admin-fh-header { padding: 0.35rem 1rem !important; }
body.compact-view .admin-contact-row { padding: 0.35rem 1rem !important; }
body.compact-view .admin-fh-card { margin-bottom: 2px !important; }

/* List view rows (claims, deceased, drafts) */
body.compact-view .draft-main-row td { padding: 6px 10px !important; }

/* Resource Center */
body.compact-view .kb-article-card { padding: 12px 16px !important; }
body.compact-view .kb-doc-card .kb-doc-card-body { padding: 10px 12px !important; }
body.compact-view .kb-ic-table td { padding: 6px 10px !important; }
body.compact-view .kb-list-item { padding: 6px 10px !important; }

/* Modals and sections */
body.compact-view .profile-section { margin-bottom: 12px !important; }
body.compact-view .preference-item { padding: 8px 0 !important; }

/* General spacing */
body.compact-view .page-section { font-size: 13px; }
body.compact-view .dashboard-content { padding: 12px 16px !important; }

/* ==================== flatpickr — EFF-branded date picker ==================== */
/* The visible alt input keeps the original field's classes (.v2-input,
   .form-control, .sort-select, …) so it looks identical to before; these
   rules only theme the calendar popup to the EFF brand. */
.flatpickr-calendar {
    font-family: 'Futura PT', 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    border-radius: 14px;
    border: 1px solid #e5e1da;
    box-shadow: 0 12px 34px rgba(33, 74, 62, 0.18);
    overflow: hidden;
}
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after { border-bottom-color: #1E6332; }
.flatpickr-calendar.arrowBottom:before, .flatpickr-calendar.arrowBottom:after { border-top-color: #1E6332; }
.flatpickr-months {
    background: linear-gradient(135deg, #1E6332 0%, #2F8542 100%);
    padding: 6px 0 8px;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month,
.flatpickr-current-month input.cur-year,
.flatpickr-monthDropdown-months { color: #fff !important; fill: #fff !important; }
.flatpickr-monthDropdown-months { background: #1E6332; font-weight: 600; }
.flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { background: #fff; color: #214A3E; }
/* Injected year <select> — matches the month dropdown in the green header */
select.eff-fp-year {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 2px 4px;
    margin-left: 2px;
    cursor: pointer;
    outline: none;
}
select.eff-fp-year:hover { text-decoration: underline; }
select.eff-fp-year option { color: #214A3E; background: #fff; font-weight: 500; }
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: #fff; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: #F4F0E9; }
.flatpickr-weekdays { background: #1E6332; }
span.flatpickr-weekday { color: rgba(255,255,255,0.85); font-weight: 600; }
.flatpickr-day {
    border-radius: 8px;
    color: #214A3E;
    font-weight: 500;
}
.flatpickr-day:hover,
.flatpickr-day:focus { background: #F4F0E9; border-color: #F4F0E9; }
.flatpickr-day.today { border-color: #1E6332; }
.flatpickr-day.today:hover { background: #1E6332; color: #fff; }
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.startRange,
.flatpickr-day.selected.endRange {
    background: #1E6332;
    border-color: #1E6332;
    color: #fff;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay { color: #c4ccc8; }
.flatpickr-day.flatpickr-disabled { text-decoration: line-through; opacity: 0.55; }
.numInputWrapper span.arrowUp:after { border-bottom-color: #1E6332; }
.numInputWrapper span.arrowDown:after { border-top-color: #1E6332; }
/* Footer "Today"/"Clear"-style links (if shown) */
.flatpickr-calendar .flatpickr-confirm { color: #1E6332; font-weight: 600; }
/* Dark theme — keep the calendar legible */
body.dark-theme .flatpickr-calendar {
    background: var(--theme-surface);
    border-color: var(--theme-border);
}
body.dark-theme .flatpickr-day { color: var(--theme-text); }
body.dark-theme .flatpickr-day:hover,
body.dark-theme .flatpickr-day:focus { background: var(--theme-surface-alt); border-color: var(--theme-surface-alt); }
body.dark-theme .flatpickr-day.prevMonthDay,
body.dark-theme .flatpickr-day.nextMonthDay,
body.dark-theme .flatpickr-day.flatpickr-disabled { color: var(--theme-text-muted); }
body.dark-theme .flatpickr-day.selected,
body.dark-theme .flatpickr-day.selected:hover { background: #2F8542; border-color: #2F8542; color: #fff; }
body.dark-theme .flatpickr-weekdays,
body.dark-theme .flatpickr-months { background: linear-gradient(135deg, #173f22 0%, #1E6332 100%); }
