/* theme.css - Dark/Light/System theme support */

/* ===== Theme Toggle Button Styles ===== */
.theme-toggle-wrapper {
    position: relative;
    display: inline-block;
}

.theme-toggle-btn {
    position: relative;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s, color 0.3s, border-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background-color: rgba(0,0,0,0.05);
}

.theme-toggle-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0s;
    z-index: 1002;
}

.theme-toggle-btn:hover::after {
    opacity: 1;
}

.theme-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background: #fff;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 10px;
    border: 1px solid #e9ecef;
    z-index: 1001;
    animation: themeDropIn 0.15s ease-out;
    padding: 5px 0;
}

.theme-dropdown.show {
    display: block;
}

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

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.theme-option:hover {
    background: #f8f9fa;
}

.theme-option.active {
    color: #0072CE;
    font-weight: 600;
}

.theme-option svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== Dark Theme - dashboard_new.css variables ===== */
[data-theme="dark"] {
    --primary: #4a9eff;
    --primary-light: #1a2e4a;
    --primary-dark: #6bb3ff;
    --bg-body: #0f172a;
    --bg-white: #1e293b;
    --text-main: #e2e8f0;
    --text-body: #94a3b8;
    --border-color: #334155;
    --success: #34d399;
    --success-bg: #064e3b;
    --danger: #f87171;
    --danger-bg: #450a0a;
    --warning: #fbbf24;
    --warning-bg: #451a03;
}

/* ===== Dark Theme - main.css variables ===== */
[data-theme="dark"] {
    --primary-color: #4a9eff;
    --primary-hover: #6bb3ff;
    --secondary-color: #94a3b8;
    --secondary-hover: #a0aec0;
    --success-color: #34d399;
    --success-hover: #6ee7b7;
    --danger-color: #f87171;
    --danger-hover: #fca5a5;
    --warning-color: #fbbf24;
    --warning-hover: #fcd34d;
    --info-color: #38bdf8;
    --info-hover: #7dd3fc;
    --sidebar-bg: #1e293b;
    --body-bg: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --border-radius: 8px;
}

/* ===== Dark Theme - Dashboard Shell ===== */
[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

[data-theme="dark"] .sidebar {
    background: rgba(30, 41, 59, 0.95);
    border-right-color: #334155;
}

[data-theme="dark"] .sidebar-logo {
    background: linear-gradient(180deg, #1a2744 0%, rgba(30, 41, 59, 0) 100%);
    border-bottom-color: #334155;
}

[data-theme="dark"] .top-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-bottom-color: #334155;
}

[data-theme="dark"] .nav-item {
    color: #94a3b8;
}

[data-theme="dark"] .nav-item:hover {
    background: #1e293b;
    color: #4a9eff;
}

[data-theme="dark"] .nav-item.active {
    background: linear-gradient(90deg, rgba(74, 158, 255, 0.12) 0%, rgba(74, 158, 255, 0.03) 100%);
    color: #4a9eff;
    border-color: rgba(74, 158, 255, 0.15);
}

[data-theme="dark"] .menu-group-label {
    color: #64748b;
}

[data-theme="dark"] .menu-group-header {
    color: #94a3b8;
}

[data-theme="dark"] .menu-group-header:hover {
    background: #1e293b;
    color: #4a9eff;
}

[data-theme="dark"] .menu-group.expanded .menu-group-header {
    color: #94a3b8;
    background: transparent;
}

[data-theme="dark"] .menu-chevron {
    color: #64748b;
}

[data-theme="dark"] .content-body {
    background: #0f172a;
}

/* ===== Dark Theme - Header Controls ===== */
[data-theme="dark"] .notification-bell,
[data-theme="dark"] .theme-toggle-btn {
    border-color: #334155;
    color: #94a3b8;
}

[data-theme="dark"] .notification-bell:hover,
[data-theme="dark"] .theme-toggle-btn:hover {
    background-color: rgba(255,255,255,0.05);
}

[data-theme="dark"] .notification-dropdown,
[data-theme="dark"] .theme-dropdown {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

[data-theme="dark"] .notification-dropdown-header {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .notification-item {
    border-bottom-color: #293548;
}

[data-theme="dark"] .notification-item:hover {
    background: #293548;
}

[data-theme="dark"] .notification-item.unread {
    background: #1a2744;
}

[data-theme="dark"] .notification-item.unread:hover {
    background: #1e3050;
}

[data-theme="dark"] .notification-item-title {
    color: #e2e8f0;
}

[data-theme="dark"] .notification-empty {
    color: #64748b;
}

[data-theme="dark"] .notification-badge {
    border-color: #1e293b;
}

/* ===== Dark Theme - User Dropdown ===== */
[data-theme="dark"] .user-profile-trigger:hover {
    background-color: rgba(255,255,255,0.05);
    border-color: #334155;
}

[data-theme="dark"] .user-avatar-img {
    border-color: #475569;
}

[data-theme="dark"] .user-dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

[data-theme="dark"] .user-dropdown-menu a {
    color: #cbd5e1;
}

[data-theme="dark"] .user-dropdown-menu a:hover {
    background-color: #293548;
}

[data-theme="dark"] .user-dropdown-menu .dropdown-divider {
    background-color: #334155;
}

[data-theme="dark"] .user-dropdown-menu a.text-danger:hover {
    background-color: #450a0a;
}

[data-theme="dark"] .theme-option {
    color: #cbd5e1;
}

[data-theme="dark"] .theme-option:hover {
    background: #293548;
}

[data-theme="dark"] .theme-option.active {
    color: #4a9eff;
}

/* ===== Dark Theme - Cards ===== */
[data-theme="dark"] .card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ===== Dark Theme - Tables ===== */
[data-theme="dark"] th {
    background-color: #1a2744;
}

[data-theme="dark"] tr:nth-child(even) td {
    background-color: #162032;
}

[data-theme="dark"] tr:hover td {
    background-color: #293548;
}

/* ===== Dark Theme - Forms ===== */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.2);
}

[data-theme="dark"] .form-group label {
    color: #cbd5e1;
}

/* ===== Dark Theme - Containers (iframe pages) ===== */
[data-theme="dark"] .container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

[data-theme="dark"] .page-header {
    border-bottom-color: #334155;
}

/* ===== Dark Theme - Modals ===== */
[data-theme="dark"] .global-modal-content {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .global-modal-content.glass-modal {
    background: rgba(30, 41, 59, 0.95);
    border-color: #475569;
}

[data-theme="dark"] .global-modal-content h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .global-modal-content p {
    color: #94a3b8;
}

[data-theme="dark"] .global-modal-btn.secondary {
    background-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .global-modal-btn.secondary:hover {
    background-color: #475569;
}

[data-theme="dark"] .terms-scroll-area {
    background: rgba(15, 23, 42, 0.6);
    border-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .terms-scroll-area h4 {
    color: #e2e8f0;
}

[data-theme="dark"] .terms-scroll-area p {
    color: #94a3b8;
}

/* ===== Dark Theme - Toast ===== */
[data-theme="dark"] .toast {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="dark"] .toast-content {
    color: #e2e8f0;
}

/* ===== Dark Theme - Setup Wizard ===== */
[data-theme="dark"] .setup-modal {
    background: rgba(30, 41, 59, 0.97);
    border-color: #334155;
}

[data-theme="dark"] .setup-header h2 {
    color: #4a9eff;
}

[data-theme="dark"] .setup-header p {
    color: #94a3b8;
}

[data-theme="dark"] .step-title {
    color: #e2e8f0;
}

[data-theme="dark"] .step-desc {
    color: #94a3b8;
}

[data-theme="dark"] .step-icon {
    background: #1a2e4a;
    color: #4a9eff;
}

[data-theme="dark"] .dot {
    background: #475569;
}

/* ===== Dark Theme - Guide Widget ===== */
[data-theme="dark"] .guide-chat-widget {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .guide-messages {
    background: #0f172a;
}

[data-theme="dark"] .guide-msg.bot {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .guide-input-area {
    border-top-color: #334155;
    background: #1e293b;
}

[data-theme="dark"] .guide-input {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

/* ===== Dark Theme - Layouts.css overrides (iframe pages) ===== */
[data-theme="dark"] .dashboard-body {
    background: #0f172a;
}

[data-theme="dark"] .header {
    background-color: rgba(30, 41, 59, 0.85);
    border-bottom-color: #334155;
}

[data-theme="dark"] .no-data {
    background-color: #293548;
    color: #94a3b8;
}

[data-theme="dark"] .error-message {
    background-color: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

/* ===== Dark Theme - Scrollbar ===== */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f172a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ===== Dark Theme - Misc ===== */
[data-theme="dark"] .badge {
    opacity: 0.9;
}

[data-theme="dark"] .progress-track {
    background: #293548;
}

[data-theme="dark"] .time-select {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .styled-table th {
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] .styled-table td {
    border-bottom-color: #1a2744;
    color: #e2e8f0;
}

/* ===== Dark Theme - Searchable Dropdown ===== */
[data-theme="dark"] .searchable-dropdown-container input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .searchable-dropdown-list {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .searchable-dropdown-item:hover {
    background: #293548;
}

/* ===== Dark Theme - Global Body & Text ===== */
[data-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}

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

[data-theme="dark"] p {
    color: #cbd5e1;
}

[data-theme="dark"] label {
    color: #cbd5e1;
}

[data-theme="dark"] td {
    color: #e2e8f0;
}

/* ===== Dark Theme - Dashboard Stat Cards (dashboard_new.css) ===== */
[data-theme="dark"] .card-stat {
    background: #1e293b;
}

[data-theme="dark"] .stat-value {
    color: #e2e8f0;
}

[data-theme="dark"] .stat-label {
    color: #94a3b8;
}

[data-theme="dark"] .card-title {
    color: #e2e8f0;
}

/* ===== Dark Theme - Layouts.css (Dashboard pages, metric cards) ===== */
[data-theme="dark"] .dashboard-body {
    background: linear-gradient(120deg, #0f172a 0%, #1e293b 100%);
}

[data-theme="dark"] .metric-card {
    background-color: #1e293b;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

[data-theme="dark"] .metric-card h4 {
    color: #94a3b8;
}

[data-theme="dark"] .metric-card p {
    color: #e2e8f0;
}

[data-theme="dark"] .financial-chart-container {
    background-color: #1e293b;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

[data-theme="dark"] .financial-chart-container h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .recent-transactions {
    background-color: #1e293b;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

[data-theme="dark"] .recent-transactions h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .card p.description {
    color: #94a3b8;
}

[data-theme="dark"] .card h3 {
    color: #4a9eff;
}

[data-theme="dark"] .welcome-section #welcomeUser,
[data-theme="dark"] .welcome-section .main-heading {
    color: #e2e8f0;
}

[data-theme="dark"] .welcome-section .sub-heading,
[data-theme="dark"] .welcome-section .tagline {
    color: #94a3b8;
}

[data-theme="dark"] .welcome-user-text {
    color: #cbd5e1;
}

[data-theme="dark"] .dashboard-group {
    background-color: rgba(30, 41, 59, 0.6);
    border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .dashboard-group:hover {
    background-color: rgba(30, 41, 59, 0.8);
    border-color: rgba(71, 85, 105, 0.7);
}

[data-theme="dark"] .dashboard-group-title {
    color: #cbd5e1;
}

[data-theme="dark"] .group-item {
    color: #e2e8f0;
}

[data-theme="dark"] .group-item span {
    color: #cbd5e1;
}

[data-theme="dark"] .group-modal-content {
    background-color: rgba(30, 41, 59, 0.95);
    border-color: #334155;
}

[data-theme="dark"] .group-modal-close {
    color: #94a3b8;
}

[data-theme="dark"] .group-modal-close:hover {
    color: #e2e8f0;
}

[data-theme="dark"] #group-modal-body .group-item span {
    color: #cbd5e1;
}

[data-theme="dark"] .page-title-main {
    color: #e2e8f0;
}

[data-theme="dark"] .sidebar-nav {
    background-color: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.6);
}

[data-theme="dark"] .sidebar-nav .nav-link {
    color: #94a3b8;
}

[data-theme="dark"] .sidebar-nav .nav-link:hover {
    background-color: rgba(51, 65, 85, 0.5);
    color: #4a9eff;
}

[data-theme="dark"] .nav-link .icon {
    color: #94a3b8;
}

/* ===== Dark Theme - AI CFO Chatbot ===== */
[data-theme="dark"] #chatbot-container {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] #chatbot-messages {
    background-color: #0f172a;
}

[data-theme="dark"] .bot-message {
    background-color: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

[data-theme="dark"] #chatbot-input-container {
    background-color: #1e293b;
    border-top-color: #334155;
}

[data-theme="dark"] #chatbot-input {
    background-color: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] #chatbot-input:disabled {
    background-color: #293548;
    color: #64748b;
}

[data-theme="dark"] .typing-indicator {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .clarification-button {
    background-color: #293548;
    color: #cbd5e1;
    border-color: #475569;
}

[data-theme="dark"] .clarification-button:hover {
    background-color: #334155;
    border-color: #64748b;
}

/* ===== Dark Theme - Upload / Process Statement ===== */
[data-theme="dark"] .upload-container {
    background: #1e293b;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .drop-zone {
    border-color: #475569;
    background-color: #162032;
}

[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .drop-zone.drag-over {
    border-color: #4a9eff;
    background-color: #1a2e4a;
}

[data-theme="dark"] .drop-zone h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .drop-zone p {
    color: #94a3b8;
}

[data-theme="dark"] .drop-zone .icon-container {
    background-color: #1a2e4a;
    color: #4a9eff;
}

[data-theme="dark"] .drop-zone .drop-icon {
    color: #64748b;
}

[data-theme="dark"] .file-display {
    background: #162032;
    border-color: #334155;
}

[data-theme="dark"] .file-info-text {
    color: #e2e8f0;
}

[data-theme="dark"] .statement-info-box {
    background-color: #1a2e4a;
    border-color: #2d4a7a;
}

[data-theme="dark"] .info-item {
    color: #cbd5e1;
}

[data-theme="dark"] .info-item strong {
    color: #4a9eff;
}

[data-theme="dark"] .info-message {
    background-color: #0c4a6e;
    border-left-color: #4a9eff;
    color: #7dd3fc;
}

[data-theme="dark"] .transactions-header {
    color: #e2e8f0;
}

[data-theme="dark"] .table-selection-container {
    background: #162032;
    border-color: #334155;
}

[data-theme="dark"] .detected-table-block {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .detected-table-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .table-title {
    color: #e2e8f0;
}

[data-theme="dark"] .table-meta {
    color: #94a3b8;
    background: #293548;
}

[data-theme="dark"] .preview-table th {
    background-color: #1a2744;
    color: #94a3b8;
}

[data-theme="dark"] .preview-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] .preview-table th,
[data-theme="dark"] .preview-table td {
    border-color: #334155;
}

[data-theme="dark"] .expand-row-trigger {
    background-color: #162032;
    color: #4a9eff;
    border-color: #334155;
}

[data-theme="dark"] .expand-row-trigger:hover {
    background-color: #1a2744;
}

[data-theme="dark"] .table-ignore-overlay {
    background: rgba(15, 23, 42, 0.7);
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .global-modal-content {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .global-modal-actions,
[data-theme="dark"] .button-group {
    border-top-color: #334155;
    background: #1e293b;
}

[data-theme="dark"] .global-modal-btn.secondary {
    background-color: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .global-modal-btn.secondary:hover {
    background-color: #475569;
}

[data-theme="dark"] .button-secondary,
[data-theme="dark"] button.secondary {
    background-color: #293548;
    color: #cbd5e1;
}

[data-theme="dark"] .button-secondary:hover,
[data-theme="dark"] button.secondary:hover {
    background-color: #334155;
}

/* ===== Dark Theme - View Statements ===== */
[data-theme="dark"] #statement-info {
    background-color: #1a2e4a;
    border-left-color: #4a9eff;
}

[data-theme="dark"] #statement-info .info-item {
    color: #cbd5e1;
}

[data-theme="dark"] #statement-info .info-item strong {
    color: #4a9eff;
}

[data-theme="dark"] .controls-header {
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .stat-card {
    background: #293548;
    border-color: #334155;
}

[data-theme="dark"] .stat-card .stat-label {
    color: #94a3b8;
}

[data-theme="dark"] .stat-card .stat-value {
    color: #e2e8f0;
}

[data-theme="dark"] .account-filter-group select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .page-header {
    background-color: transparent;
    border-bottom-color: #334155;
}

[data-theme="dark"] .page-header h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .table-wrapper {
    border-color: #334155;
}

[data-theme="dark"] #statementsTable thead th {
    background-color: #1a2744;
}

[data-theme="dark"] .filter-row th {
    background-color: #162032 !important;
}

[data-theme="dark"] .filter-row input,
[data-theme="dark"] .filter-row select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .page-btn {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .page-btn:hover {
    background-color: #293548;
}

[data-theme="dark"] .page-btn.active {
    background-color: #4a9eff;
    border-color: #4a9eff;
    color: white;
}

[data-theme="dark"] .page-btn:disabled {
    background-color: #162032;
    color: #475569;
}

[data-theme="dark"] .workflow-dropdown {
    background-color: #1e293b;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

[data-theme="dark"] .workflow-dropdown a {
    color: #e2e8f0;
}

[data-theme="dark"] .workflow-dropdown a:hover {
    background-color: #293548;
}

/* View statements COA dropdown */
[data-theme="dark"] .vs-coa-input {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .vs-coa-input:disabled {
    background: #162032;
    color: #64748b;
}

[data-theme="dark"] .vs-coa-dropdown-panel {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

[data-theme="dark"] .vs-dd-item:hover,
[data-theme="dark"] .vs-dd-item.highlighted {
    background: #293548;
}

[data-theme="dark"] .vs-dd-item .dd-code {
    color: #4a9eff;
}

[data-theme="dark"] .vs-dd-item .dd-path {
    color: #94a3b8;
}

/* ===== Dark Theme - Analyse Statement ===== */
[data-theme="dark"] .controls-wrapper {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .filters-section label,
[data-theme="dark"] .chart-type-section label,
[data-theme="dark"] .scale-section label {
    color: #cbd5e1;
}

[data-theme="dark"] .filters-section input[type="date"],
[data-theme="dark"] .filters-section select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
    color-scheme: dark;
}

[data-theme="dark"] input[type="date"] {
    color-scheme: dark;
}

[data-theme="dark"] #clickedInfo {
    background-color: #1a2e4a;
    border-color: #2d4a7a;
    color: #7dd3fc;
}

/* ===== Dark Theme - Data History ===== */
[data-theme="dark"] .history-button {
    background-color: #1e293b;
    color: #cbd5e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

[data-theme="dark"] .history-cluster-container {
    background: #1e293b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .history-table th,
[data-theme="dark"] .history-table td {
    border-bottom-color: #334155;
}

[data-theme="dark"] .history-table thead th {
    background-color: #1a2744;
    color: #94a3b8;
}

[data-theme="dark"] .history-table td {
    color: #e2e8f0;
}

/* ===== Dark Theme - Manage Accruals / Reporting Stats ===== */
[data-theme="dark"] .alert-warning,
[data-theme="dark"] .unposted-banner {
    background-color: #451a03;
    color: #fcd34d;
    border-color: #78350f;
}

/* ===== Dark Theme - Financial Reports ===== */
[data-theme="dark"] .report-tabs {
    border-bottom-color: #334155;
}

[data-theme="dark"] .report-tab {
    color: #94a3b8;
}

[data-theme="dark"] .report-tab:hover {
    color: #e2e8f0;
    background-color: #293548;
}

[data-theme="dark"] .report-tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
}

[data-theme="dark"] .controls-panel {
    background-color: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .control-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .control-group select,
[data-theme="dark"] .control-group input {
    background-color: #162032;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .report-output {
    border-color: #334155;
}

[data-theme="dark"] .report-output thead th {
    background-color: #1a2744;
    color: #94a3b8;
    border-bottom-color: #475569;
}

[data-theme="dark"] .report-output th,
[data-theme="dark"] .report-output td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .row-section-header td,
[data-theme="dark"] .cf-section-header {
    background-color: #1a2744;
    color: #e2e8f0;
}

[data-theme="dark"] .row-category-header td {
    background-color: #162032;
    color: #cbd5e1;
}

[data-theme="dark"] .row-grand-total td,
[data-theme="dark"] .cf-grand-total td {
    background-color: #1a2744;
    color: #e2e8f0;
    border-top-color: #475569;
}

[data-theme="dark"] .row-subtotal td,
[data-theme="dark"] .cf-section-total td {
    border-top-color: #475569;
}

[data-theme="dark"] .drilldown-modal-content {
    background-color: #1e293b;
}

[data-theme="dark"] .drilldown-header {
    background-color: #1e293b;
    border-bottom-color: #334155;
}

[data-theme="dark"] .drilldown-header h2 {
    color: #4a9eff;
}

[data-theme="dark"] .drilldown-header .close-btn {
    color: #94a3b8;
}

[data-theme="dark"] .drilldown-header .close-btn:hover {
    color: #e2e8f0;
}

[data-theme="dark"] .drilldown-body {
    background-color: #0f172a;
}

[data-theme="dark"] .drilldown-table th {
    background-color: #1a2744;
    color: #94a3b8;
    border-bottom-color: #475569;
}

[data-theme="dark"] .drilldown-table td {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] .drilldown-table tr:hover {
    background-color: #293548;
}

[data-theme="dark"] .drilldown-footer {
    background-color: #1a2744;
    border-top-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .wizard-step {
    background-color: #293548;
    color: #94a3b8;
    border-right-color: #334155;
}

[data-theme="dark"] .mapping-table th {
    background-color: #1a2744;
    color: #94a3b8;
    border-bottom-color: #475569;
}

[data-theme="dark"] .mapping-table td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .mapping-table tr:hover {
    background-color: #293548;
}

[data-theme="dark"] .mapping-table select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .fy-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .fy-card h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .fy-card .fy-detail {
    color: #cbd5e1;
}

[data-theme="dark"] .config-table td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .config-table tbody tr:hover {
    background-color: #293548;
}

[data-theme="dark"] .searchable-dropdown input {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .searchable-dropdown .dropdown-list {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="dark"] .searchable-dropdown .dropdown-item {
    border-bottom-color: #293548;
    color: #e2e8f0;
}

[data-theme="dark"] .searchable-dropdown .dropdown-item:hover,
[data-theme="dark"] .searchable-dropdown .dropdown-item.highlighted {
    background-color: #293548;
}

[data-theme="dark"] .searchable-dropdown .dropdown-item .item-code {
    color: #4a9eff;
}

[data-theme="dark"] .searchable-dropdown .dropdown-item .item-name {
    color: #cbd5e1;
}

[data-theme="dark"] .searchable-dropdown .dropdown-arrow {
    color: #94a3b8;
}

[data-theme="dark"] .editable-cell:hover {
    background-color: #293548;
}

/* ===== Dark Theme - Chart of Accounts ===== */
[data-theme="dark"] .coa-button {
    background-color: #1e293b;
    color: #cbd5e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

[data-theme="dark"] .main-category-cluster {
    background: #1e293b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .main-category-cluster:not(.open):hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .main-category-cluster h3 {
    color: #e2e8f0;
}

[data-theme="dark"] .category-content {
    color: #cbd5e1;
}

[data-theme="dark"] .sub-category-header {
    background-color: #162032;
    color: #94a3b8;
    border-bottom-color: #334155;
}

[data-theme="dark"] .sub-category-row {
    border-bottom-color: #293548;
    color: #e2e8f0;
}

[data-theme="dark"] .sub-category-row:hover {
    background-color: #293548;
}

[data-theme="dark"] .sub-category-row div:nth-child(2) {
    color: #94a3b8;
}

/* ===== Dark Theme - Profile ===== */
[data-theme="dark"] .usage-section {
    background: #162032;
    border-color: #334155;
}

[data-theme="dark"] .plan-info {
    border-bottom-color: #334155;
}

[data-theme="dark"] .plan-status {
    color: #34d399;
}

[data-theme="dark"] .usage-label {
    color: #cbd5e1;
}

[data-theme="dark"] .progress-bg {
    background: #293548;
}

[data-theme="dark"] .usage-subtext {
    color: #64748b;
}

[data-theme="dark"] .image-upload-wrapper {
    background: #162032;
    border-color: #334155;
}

[data-theme="dark"] .danger-zone-container {
    background-color: #1e293b;
    border-color: #7f1d1d;
}

[data-theme="dark"] .danger-header {
    background-color: #450a0a;
    border-bottom-color: #7f1d1d;
}

[data-theme="dark"] .danger-header h3 {
    color: #fca5a5;
}

[data-theme="dark"] .danger-content {
    background-color: #1e293b;
}

[data-theme="dark"] .danger-content p {
    color: #cbd5e1;
}

[data-theme="dark"] .btn-delete-account {
    background-color: #1e293b;
    color: #f87171;
    border-color: #f87171;
}

[data-theme="dark"] .btn-delete-account:hover {
    background-color: #f87171;
    color: white;
}

[data-theme="dark"] .form-group small {
    color: #64748b;
}

[data-theme="dark"] .form-group input[disabled] {
    background-color: #162032;
    color: #64748b;
    border-color: #334155;
}

[data-theme="dark"] .loading-message {
    color: #94a3b8;
}

[data-theme="dark"] .form-actions {
    border-top-color: #334155;
}

/* ===== Dark Theme - Subscriptions ===== */
[data-theme="dark"] .pricing-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .pricing-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

[data-theme="dark"] .pricing-card.popular {
    border-color: #4a9eff;
}

[data-theme="dark"] .plan-name {
    color: #e2e8f0;
}

[data-theme="dark"] .price {
    color: #e2e8f0;
}

[data-theme="dark"] .price span {
    color: #94a3b8;
}

[data-theme="dark"] .plan-desc {
    color: #94a3b8;
}

[data-theme="dark"] .card-header {
    border-bottom-color: #334155;
}

[data-theme="dark"] .card-features li {
    color: #cbd5e1;
}

[data-theme="dark"] .plan-btn {
    background: #1e293b;
    border-color: #4a9eff;
    color: #4a9eff;
}

[data-theme="dark"] .plan-btn:hover:not(:disabled) {
    background: #1a2e4a;
}

[data-theme="dark"] .plan-btn.primary {
    background: #4a9eff;
    color: white;
}

[data-theme="dark"] .plan-btn.primary:hover:not(:disabled) {
    background: #6bb3ff;
}

[data-theme="dark"] .center-header h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .center-header .subtext {
    color: #94a3b8;
}

[data-theme="dark"] .faq-link {
    color: #94a3b8;
}

[data-theme="dark"] .back-link {
    color: #94a3b8;
}

[data-theme="dark"] .back-link:hover {
    color: #4a9eff;
}

/* ===== Dark Theme - Client Intake Forms / View Form ===== */
[data-theme="dark"] .form-display-section {
    background-color: #162032;
    border-color: #334155;
}

[data-theme="dark"] .form-display-section h4 {
    color: #4a9eff;
    border-bottom-color: #334155;
}

[data-theme="dark"] .field-label {
    color: #94a3b8;
}

[data-theme="dark"] .field-value {
    color: #e2e8f0;
}

[data-theme="dark"] .logo-title h2 {
    color: #e2e8f0;
}

[data-theme="dark"] #formTitle {
    color: #e2e8f0;
}

/* ===== Dark Theme - Configuration ===== */
[data-theme="dark"] .config-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .config-card h3 {
    color: #e2e8f0;
}

/* ===== Dark Theme - Tables (global) ===== */
[data-theme="dark"] table {
    color: #e2e8f0;
}

[data-theme="dark"] th {
    background-color: #1a2744;
    color: #cbd5e1;
}

[data-theme="dark"] td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] tr:nth-child(even) td {
    background-color: #162032;
}

[data-theme="dark"] tr:hover td {
    background-color: #293548;
}

/* ===== Dark Theme - Main.css containers ===== */
[data-theme="dark"] .container {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

[data-theme="dark"] .no-data {
    background-color: #293548;
    color: #94a3b8;
}

/* ===== Dark Theme - Form inputs (global) ===== */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="file"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.2);
}

[data-theme="dark"] .form-group label {
    color: #cbd5e1;
}

[data-theme="dark"] input[type="file"]::file-selector-button {
    background-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] input[type="file"]::file-selector-button:hover {
    background-color: #475569;
}

/* ===== Dark Theme - Year End Close boxes ===== */
[data-theme="dark"] .fy-card {
    background: #1e293b;
    border-color: #334155;
}

/* ===== Dark Theme - Reporting Config ===== */
[data-theme="dark"] .connection-item {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* ===== Dark Theme - Various text visibility fixes ===== */
[data-theme="dark"] .modal-content h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .modal-content p {
    color: #94a3b8;
}

[data-theme="dark"] .profile-section h3 {
    color: #e2e8f0;
    border-bottom-color: #334155;
}

[data-theme="dark"] .header-content h2,
[data-theme="dark"] .page-header .subtext {
    color: #94a3b8;
}

[data-theme="dark"] .progress-track {
    background: #293548;
}

/* ===== Dark Theme - Upload page specific ===== */
[data-theme="dark"] .upload-container h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .upload-container .form-group label {
    color: #cbd5e1;
}

/* ===== Dark Theme - Client Intake Form (new.css) ===== */
[data-theme="dark"] .form-step {
    background-color: #162032;
    border-color: #334155;
}

[data-theme="dark"] h5#welcomeMessage {
    color: #94a3b8;
}

[data-theme="dark"] .checkbox-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .navigation-buttons,
[data-theme="dark"] .action-buttons {
    border-top-color: #334155;
}

[data-theme="dark"] hr {
    background-color: #334155;
}

[data-theme="dark"] .progress-bar-container {
    background-color: #293548;
}

/* ===== Dark Theme - Embedded pages background fix ===== */
[data-theme="dark"] html.embedded,
[data-theme="dark"] html.embedded body {
    background: transparent !important;
}

/* ===== Dark Theme - General anchor link colors ===== */
[data-theme="dark"] a {
    color: inherit;
}

/* ===== Dark Theme - Clickable cells in reports ===== */
[data-theme="dark"] .clickable-cell {
    color: #4a9eff;
}

[data-theme="dark"] .clickable-cell:hover {
    color: #6bb3ff;
}

/* ===== Dark Theme - Validation colors ===== */
[data-theme="dark"] .validation-ok {
    color: #34d399;
}

[data-theme="dark"] .validation-warn {
    color: #fbbf24;
}

[data-theme="dark"] .validation-error {
    color: #f87171;
}

/* ===== Dark Theme - General strong/bold text ===== */
[data-theme="dark"] strong {
    color: #e2e8f0;
}

/* ===== Dark Theme - Loader ===== */
[data-theme="dark"] .loader {
    border-color: #334155;
    border-top-color: #4a9eff;
}

/* ===== Dark Theme - Progress bar background ===== */
[data-theme="dark"] .progress-container {
    background-color: #293548;
}

/* ===== Dark Theme - Status steps ===== */
[data-theme="dark"] .status-step {
    color: #64748b;
}

[data-theme="dark"] .status-step.active {
    color: #4a9eff;
}

[data-theme="dark"] .status-step.completed {
    color: #34d399;
}

[data-theme="dark"] .progress-title {
    color: #e2e8f0;
}

/* ===== Dark Theme - Searchable Dropdown (shared component) ===== */
[data-theme="dark"] .sd-input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .sd-list {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

[data-theme="dark"] .sd-item {
    border-bottom-color: #293548;
    color: #e2e8f0;
}

[data-theme="dark"] .sd-item:hover,
[data-theme="dark"] .sd-item.sd-highlighted {
    background-color: #293548;
}

[data-theme="dark"] .sd-code {
    color: #4a9eff;
}

[data-theme="dark"] .sd-label {
    color: #cbd5e1;
}

[data-theme="dark"] .sd-arrow {
    color: #94a3b8;
}

/* ===== Dark Theme - Reconciliation ===== */
[data-theme="dark"] .rec-description {
    color: #94a3b8;
}

[data-theme="dark"] .balance-box {
    background: #162032;
    border-color: #334155;
}

[data-theme="dark"] .balance-box label {
    color: #94a3b8;
}

[data-theme="dark"] .balance-value {
    color: #e2e8f0;
}

[data-theme="dark"] .fix-option-container {
    background-color: #451a03;
    border-color: #78350f;
}

[data-theme="dark"] .warning-text {
    color: #fcd34d;
}

[data-theme="dark"] .checkbox-label {
    color: #cbd5e1;
}

/* ===== Dark Theme - Subscriptions body bg ===== */
[data-theme="dark"] .subscription-container {
    color: #e2e8f0;
}

/* ===== Dark Theme - Misc text visibility catch-all ===== */
[data-theme="dark"] .form-group input[type="text"],
[data-theme="dark"] .form-group input[type="email"],
[data-theme="dark"] .form-group select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .snapshotBar,
[data-theme="dark"] #snapshotBar {
    background: #162032;
    border-color: #2d4a7a;
    color: #7dd3fc;
}
