/**
 * Dark Theme Override - Karobar.html Consistency Update
 * Makes karobar.html match c-list-info.html appearance in dark mode
 */

/* ========== CORE DARK THEME VARIABLES ========== */
[data-theme="dark"] {
    /* Backgrounds */
    --bg: #0b1118 !important;
    --surface: #0f1621 !important;

    /* Text colors */
    --t900: #e5e7eb !important;
    --t700: #d0d5dd !important;
    --t600: #98a2b3 !important;
    --t500: #6b7280 !important;
    --text-900: #e5e7eb !important;
    --text-700: #d0d5dd !important;
    --text-600: #98a2b3 !important;
    --ink-900: #e5e7eb !important;
    --ink-700: #d0d5dd !important;
    --ink-500: #6b7280 !important;

    /* Borders */
    --border: #233044 !important;
    --cardBorder: #1e2838 !important;
    --card-border: #1e2838 !important;

    /* Shadows - softer for dark mode */
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35) !important;

    /* Navigation */
    --nav-inactive: #6b7280 !important;

    /* Danger color - slightly brighter for dark mode */
    --danger: #f87171 !important;

    /* Success color */
    --ok: #34d399 !important;

    /* Brand color override */
    --brand-green: #0c6047 !important;
    --brand: #0c6047 !important;

    --menu-color: #1ab189 !important;
}

/* ========== BASE ELEMENTS ========== */
[data-theme="dark"] html,
[data-theme="dark"] body {
    background: #0b1118 !important;
    color: #e5e7eb !important;
}

/* ========== CONTAINERS ========== */
[data-theme="dark"] .phone,
[data-theme="dark"] .mobile,
[data-theme="dark"] .mobile-container,
[data-theme="dark"] #party-page.mobile-container,
[data-theme="dark"] .page-content,
[data-theme="dark"] .content-area,
[data-theme="dark"] .content {
    background: #0b1118 !important;
}

/* ========== KAROBAR.HTML SPECIFIC - SUMMARY CARDS ========== */
/* Income card - green tint */
[data-theme="dark"] .summary .card.card-income,
[data-theme="dark"] .card-income {
    background: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

[data-theme="dark"] .card-income .badge {
    color: #34d399 !important;
}

[data-theme="dark"] .card-income .amount {
    color: #e5e7eb !important;
}

[data-theme="dark"] .card-income .label {
    color: #98a2b3 !important;
}

/* Expense card - red tint */
[data-theme="dark"] .summary .card.card-expense,
[data-theme="dark"] .card-expense {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

[data-theme="dark"] .card-expense .badge {
    color: #f87171 !important;
}

[data-theme="dark"] .card-expense .amount {
    color: #e5e7eb !important;
}

[data-theme="dark"] .card-expense .label {
    color: #98a2b3 !important;
}

/* Total card - blue tint to match c-list-info */
[data-theme="dark"] .total-card {
    background: rgba(11, 93, 184, 0.12) !important;
    border-color: rgba(11, 93, 184, 0.3) !important;
}

[data-theme="dark"] .total-card .t-label {
    color: #d0d5dd !important;
}

[data-theme="dark"] .total-card .t-amt {
    color: #60a5fa !important;
}

/* ========== C-LIST-INFO.HTML SPECIFIC - SUMMARY CARDS ========== */
/* Income summary card */
[data-theme="dark"] .summary-card.income {
    background: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

[data-theme="dark"] .summary-card.income .amount {
    color: #e5e7eb !important;
}

/* Force consistent red color for both resource and expense buttons in dark mode */
[data-theme="dark"] .btn-resource,
[data-theme="dark"] .header-btn.btn-resource {
    background: #e24a3a !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-expense,
[data-theme="dark"] .header-btn[style*="background: var(--red)"] {
    background: #e24a3a !important;
    color: #fff !important;
}

[data-theme="dark"] .summary-card.income .label {
    color: #98a2b3 !important;
}

/* Expense summary card */
[data-theme="dark"] .summary-card.expense {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

[data-theme="dark"] .summary-card.expense .amount {
    color: #e5e7eb !important;
}

[data-theme="dark"] .summary-card.expense .label {
    color: #98a2b3 !important;
}

/* ========== RECORDS/ACTIVITY BLOCKS ========== */
[data-theme="dark"] .block,
[data-theme="dark"] .activity-list {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .block .head {
    border-bottom-color: #1e2838 !important;
}

[data-theme="dark"] .block .title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .block .pill {
    background: #1a2332 !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .block .label {
    color: #98a2b3 !important;
}

[data-theme="dark"] .block .amt-in {
    color: #34d399 !important;
}

[data-theme="dark"] .block .amt-out {
    color: #f87171 !important;
}

/* ========== TABLE STYLING (C-LIST-INFO) ========== */
[data-theme="dark"] .table-modern {
    background: transparent !important;
}

[data-theme="dark"] .table-modern thead th {
    background: #0f1621 !important;
    color: #e5e7eb !important;
    border-bottom-color: #1e2838 !important;
}

[data-theme="dark"] .table-modern tbody td {
    border-bottom-color: #1e2838 !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .table-modern tbody tr:hover {
    background: rgba(148, 163, 184, 0.05) !important;
}

/* Pills in table */
[data-theme="dark"] .pill-income {
    background: rgba(52, 211, 153, 0.15) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .pill-expense {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
}

/* ========== CARDS & SURFACES ========== */
[data-theme="dark"] .card,
[data-theme="dark"] .panel,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .inset-panel,
[data-theme="dark"] .party-card,
[data-theme="dark"] .activity-item,
[data-theme="dark"] .delete-card,
[data-theme="dark"] .sheet,
[data-theme="dark"] .site-item,
[data-theme="dark"] .list-card {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

/* ========== MODALS ========== */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal .card {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .ov,
[data-theme="dark"] .sheet-overlay,
[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.65) !important;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #1e2838 !important;
}

[data-theme="dark"] .modal-title,
[data-theme="dark"] .modal .card h3,
[data-theme="dark"] .card h3 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal .card p,
[data-theme="dark"] .card p {
    color: #d0d5dd !important;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #1e2838 !important;
}

/* Close button (X) */
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.8 !important;
}

[data-theme="dark"] .btn-close:hover {
    opacity: 1 !important;
}

/* ========== INPUTS & FORMS ========== */
[data-theme="dark"] .modal-input,
[data-theme="dark"] .modal-textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .search input,
[data-theme="dark"] .modal input,
[data-theme="dark"] .modal select,
[data-theme="dark"] .modal textarea,
[data-theme="dark"] .card input,
[data-theme="dark"] .card select,
[data-theme="dark"] .card textarea {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #6b7280 !important;
}

[data-theme="dark"] .modal-input[readonly],
[data-theme="dark"] input[readonly],
[data-theme="dark"] input[disabled] {
    background: #0f1621 !important;
    color: #98a2b3 !important;
    opacity: 0.7 !important;
}

[data-theme="dark"] .form-label,
[data-theme="dark"] label.label,
[data-theme="dark"] .modal label,
[data-theme="dark"] .card label {
    color: #d0d5dd !important;
}

/* Invalid feedback */
[data-theme="dark"] .invalid-feedback,
[data-theme="dark"] .field-error,
[data-theme="dark"] .err {
    color: #f87171 !important;
}

[data-theme="dark"] .form-control.is-invalid,
[data-theme="dark"] .form-select.is-invalid {
    border-color: #f87171 !important;
}

/* ========== SECTION HEADERS ========== */
[data-theme="dark"] .section-head h3,
[data-theme="dark"] .section-title {
    color: #e5e7eb !important;
}

/* ========== NAVIGATION ========== */
[data-theme="dark"] .header,
[data-theme="dark"] .app-header,
[data-theme="dark"] .page-header {
    background: #0c6047 !important;
}

[data-theme="dark"] .bottom-nav {
    background: #0f1621 !important;
    border-top-color: #233044 !important;
}

[data-theme="dark"] .bottom-nav .nav-item {
    color: #6b7280 !important;
}

[data-theme="dark"] .bottom-nav .nav-item.active {
    color: #1ab189 !important;
}

[data-theme="dark"] .nav-icon {
    background-color: #6b7280 !important;
}

[data-theme="dark"] .bottom-nav .nav-item.active .nav-icon {
    background-color: #1ab189 !important;
}

/* ========== BUTTONS ========== */
/* Filter button */
[data-theme="dark"] .filter-btn,
[data-theme="dark"] .btn-filter {
    background: #0c6047 !important;
    color: #fff !important;
    border-color: #0c6047 !important;
}

/* Cancel/Light Buttons */
[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-cancel {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

/* Mini buttons */
[data-theme="dark"] .btn-mini {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"]
    .btn:not(.filter):not(.brand):not(.danger):not(.btn-filter):not(
        .btn-income
    ):not(.btn-expense):not(.btn-update):not(.btn-success):not(.btn-danger):not(
        .btn-primary
    ):not(.btn-save):not(.btn-cancel):not(.btn-light),
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .action-btn:not(.primary):not(.btn-brand) {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .btn.cancel {
    background: #1a2332 !important;
    color: #d0d5dd !important;
}

/* Icon Buttons */
[data-theme="dark"] .iconbtn,
[data-theme="dark"] .btn-icon,
[data-theme="dark"] .act-btn {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .btn-icon:hover,
[data-theme="dark"] .act-btn:hover {
    background: rgba(148, 163, 184, 0.15) !important;
}

[data-theme="dark"] .iconbtn.restore {
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .iconbtn.delete,
[data-theme="dark"] .btn-icon.delete,
[data-theme="dark"] .act-btn.del {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .act-btn.edit {
    background: rgba(96, 165, 250, 0.1) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    color: #60a5fa !important;
}

/* ========== FILTER MODAL (RANGE BUTTONS) ========== */
[data-theme="dark"] .range-btn {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .range-btn.active,
[data-theme="dark"] .preset-btn[style*="border-color: rgb(26, 177, 137)"],
[data-theme="dark"] .preset-btn[style*="border-color:#1ab189"] {
    background: rgba(15, 23, 42, 0.15) !important;
    border-color: rgba(15, 23, 42, 0.4) !important;
    color: #0c6047 !important;
}

[data-theme="dark"] .range-btn.active::after {
    background: #0c6047 !important;
}

[data-theme="dark"] .hint {
    color: #6b7280 !important;
}

/* ========== EMPTY STATES ========== */
[data-theme="dark"] .empty-wrap,
[data-theme="dark"] .empty-full {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-title,
[data-theme="dark"] .empty-full h3 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .empty-sub,
[data-theme="dark"] .empty-full p {
    color: #98a2b3 !important;
}

/* ========== TOASTS ========== */
[data-theme="dark"] #toast,
[data-theme="dark"] .flash-toast {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .toast-msg,
[data-theme="dark"] .flash-text {
    color: #e5e7eb !important;
}

[data-theme="dark"] .toast-x {
    color: #98a2b3 !important;
}

[data-theme="dark"] .toast-badge.success {
    background: #34d399 !important;
}

[data-theme="dark"] .toast-badge.error {
    background: #f87171 !important;
}

/* ========== HEADER BUTTONS (C-LIST-INFO) ========== */
[data-theme="dark"] .header-btn {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .btn-rate {
    background: var(--blue, #0b5db8) !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-resource {
    background: var(--red, #dc3545) !important;
    color: #fff !important;
}

/* ========== DROPDOWN & SHEET ROWS ========== */
[data-theme="dark"] .sheet-row {
    color: #e5e7eb !important;
    border-top-color: #1e2838 !important;
}

[data-theme="dark"] .sheet-row:hover {
    background: rgba(148, 163, 184, 0.08) !important;
}

/* ========== PARTY PAGE SPECIFIC ========== */
[data-theme="dark"] .total-amount-card {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.2) !important;
}

[data-theme="dark"] .total-amount-card .label {
    color: #d0d5dd !important;
}

[data-theme="dark"] .total-amount-card .amount {
    color: #f87171 !important;
}

[data-theme="dark"] .total-amount-card .inner {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.2) !important;
}

/* ========== BULK BAR ========== */
[data-theme="dark"] .bulkbar {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .bulk-count {
    color: #e5e7eb !important;
}

[data-theme="dark"] .btn-restore {
    background: rgba(52, 211, 153, 0.12) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .btn-delete {
    background: rgba(248, 113, 113, 0.12) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    color: #f87171 !important;
}

/* ========== DROPDOWNS & MENUS ========== */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .chart-select-menu,
[data-theme="dark"] .filter-menu {
    background: #0f1621 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .dropdown-item,
[data-theme="dark"] .mi {
    color: #d0d5dd !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item.active,
[data-theme="dark"] .mi:hover {
    background: rgba(15, 23, 42, 0.12) !important;
}

[data-theme="dark"] .mi + .mi {
    border-top-color: #233044 !important;
}

/* ========== STATUS BADGES ========== */
[data-theme="dark"] .status-tag {
    opacity: 0.9;
}

[data-theme="dark"] .status-ongoing,
[data-theme="dark"] .status-completed {
    background: rgba(52, 211, 153, 0.15) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .status-paused {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
    color: #fbbf24 !important;
}

/* ========== SEARCH INPUT ========== */
[data-theme="dark"] .search-input {
    background: #1a2332 !important;
    border-color: rgba(15, 23, 42, 0.4) !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .search-input::placeholder {
    color: #6b7280 !important;
}

/* ========== TEXT ELEMENTS ========== */
[data-theme="dark"] .transaction-title,
[data-theme="dark"] .section-header,
[data-theme="dark"] .sc-name,
[data-theme="dark"] .party-name,
[data-theme="dark"] .activity-title,
[data-theme="dark"] .hdr,
[data-theme="dark"] .site-name,
[data-theme="dark"] .item-text,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] .text-strong {
    color: #e5e7eb !important;
}

[data-theme="dark"] .label-text,
[data-theme="dark"] .chart-caption,
[data-theme="dark"] .party-phone,
[data-theme="dark"] .activity-description,
[data-theme="dark"] .form-group label,
[data-theme="dark"] .txt,
[data-theme="dark"] p.title,
[data-theme="dark"] .site-location {
    color: #d0d5dd !important;
}

[data-theme="dark"] .meta,
[data-theme="dark"] .date,
[data-theme="dark"] p.meta,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .muted {
    color: #98a2b3 !important;
}

[data-theme="dark"] .value {
    color: #98a2b3 !important;
}

/* ========== SHORTCUTS ========== */
[data-theme="dark"] .shortcut-icon-wrapper,
[data-theme="dark"] .sc-circle {
    background: rgba(15, 23, 42, 0.15) !important;
}

/* ========== HOVER & ACTIVE STATES ========== */
[data-theme="dark"] .clickable:hover,
[data-theme="dark"] .row.clickable:hover,
[data-theme="dark"] .block:hover {
    background: rgba(148, 163, 184, 0.05) !important;
}

[data-theme="dark"] .clickable:active,
[data-theme="dark"] .row.clickable:active,
[data-theme="dark"] .block:active {
    background: rgba(15, 23, 42, 0.08) !important;
}

/* ========== CHECKBOX & SELECTION ========== */
[data-theme="dark"] .check-row,
[data-theme="dark"] .check-row span,
[data-theme="dark"] label:not(.label):not(.form-label) {
    color: #e5e7eb !important;
}

[data-theme="dark"] .select-all {
    color: #d0d5dd !important;
}

[data-theme="dark"] input[type="checkbox"]:not(:checked) {
    filter: brightness(0.8) contrast(1.2);
}

/* ========== DIVIDERS ========== */
[data-theme="dark"] .item + .item,
[data-theme="dark"] .row + .row {
    border-top-color: #233044 !important;
}

/* ========== DATE ELEMENTS ========== */
[data-theme="dark"] .activity-date-bubble,
[data-theme="dark"] .transaction-date,
[data-theme="dark"] .date-badge {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #d0d5dd !important;
}

/* ========== ICONS ========== */
[data-theme="dark"] .arrow-icon,
[data-theme="dark"] .chev,
[data-theme="dark"] .search i {
    color: #6b7280 !important;
}

[data-theme="dark"] .icon:not(.fa) {
    color: #98a2b3 !important;
}

/* ========== SEGMENTED CONTROLS ========== */
[data-theme="dark"] .seg {
    background: rgba(148, 163, 184, 0.12) !important;
}

[data-theme="dark"] .seg button:not(.active) {
    color: #d0d5dd !important;
}

/* ========== SCROLLBARS ========== */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0b1118 !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #233044 !important;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #2d4161 !important;
}

/* ========== SMOOTH TRANSITIONS ========== */
html,
body,
.phone,
.mobile,
.mobile-container,
.page-content,
.content-area,
.content,
.card,
.panel,
.modal-content,
.sheet,
input,
textarea,
select,
.btn {
    transition: background-color 0.2s ease, color 0.2s ease,
        border-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* ========== ACCESSIBILITY ========== */
[data-theme="dark"] :focus-visible {
    outline: 2px solid rgba(15, 23, 42, 0.5) !important;
    outline-offset: 2px;
}

/* ========== CATCH-ALL TEXT COVERAGE ========== */
[data-theme="dark"] body,
[data-theme="dark"] body * {
    border-color: #233044;
}

[data-theme="dark"]
    span:not(.amount-income):not(.amount-expense):not(.income-text):not(
        .expense-text
    ):not(.profit-text):not(.amt-in):not(.amt-out):not(.toast-badge):not(.pill),
[data-theme="dark"]
    div:not(.card):not(.panel):not(.modal-content):not(.sheet):not(
        .toast-badge
    ):not(.sc-circle):not(.shortcut-icon-wrapper):not(.site-item):not(
        .block
    ):not(.total-card):not(.total-amount-card):not(.summary-card) {
    color: inherit;
}

[data-theme="dark"]
    p:not(.title):not(.transaction-title):not(.section-header):not(
        .amount-income
    ):not(.amount-expense) {
    color: #d0d5dd !important;
}

/* ========== LOADING & ERROR MESSAGES ========== */
[data-theme="dark"] #loading-activities,
[data-theme="dark"] #activity-error,
[data-theme="dark"] #auth-error-message {
    color: #d0d5dd !important;
}

[data-theme="dark"] #activity-error {
    color: #f87171 !important;
}

[data-theme="dark"] #auth-error-message {
    color: #fbbf24 !important;
}

/* ========== SITE-EDIT.HTML SPECIFIC ========== */
/* Page container */
[data-theme="dark"] .page {
    background: #0b1118 !important;
}

/* Content area */
[data-theme="dark"] .page .content {
    background: #0b1118 !important;
}

/* Field labels */
[data-theme="dark"] .field-label {
    color: #d0d5dd !important;
}

/* Form controls - white fields in light mode become dark */
[data-theme="dark"] .page .form-control,
[data-theme="dark"] .page .form-select {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

/* Date inputs - calendar icon fix */
[data-theme="dark"] .page input[type="date"].form-control {
    background: #1a2332 !important;
    color: #e5e7eb !important;
    color-scheme: dark;
}

[data-theme="dark"]
    .page
    input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 1;
    cursor: pointer;
}

[data-theme="dark"]
    .page
    input[type="date"].form-control::-webkit-datetime-edit {
    color: #e5e7eb;
}

[data-theme="dark"]
    .page
    input[type="date"].form-control::-webkit-datetime-edit-fields-wrapper {
    color: #e5e7eb;
}

[data-theme="dark"]
    .page
    input[type="date"].form-control::-webkit-datetime-edit-text {
    color: #98a2b3;
}

[data-theme="dark"]
    .page
    input[type="date"].form-control::-webkit-datetime-edit-month-field,
[data-theme="dark"]
    .page
    input[type="date"].form-control::-webkit-datetime-edit-day-field,
[data-theme="dark"]
    .page
    input[type="date"].form-control::-webkit-datetime-edit-year-field {
    color: #e5e7eb;
}

[data-theme="dark"] .page .form-control::placeholder {
    color: #6b7280 !important;
}

[data-theme="dark"] .page .form-control:focus,
[data-theme="dark"] .page .form-select:focus {
    border-color: #0c6047 !important;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.18) !important;
}

/* Owner row input group */
[data-theme="dark"] .owner-group .input-group-text {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #6b7280 !important;
}

[data-theme="dark"] .owner-group .form-select {
    background: #1a2332 !important;
    border-color: #233044 !important;
}

/* Image upload box */
[data-theme="dark"] .image-upload-box {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .image-upload-box i {
    color: #98a2b3 !important;
}

/* Image preview thumbnails */
[data-theme="dark"] #imagePreview .thumb {
    background: #0f1621 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] #imagePreview .thumb .x {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] #imagePreview .thumb .x:hover {
    background: #f87171 !important;
    border-color: #f87171 !important;
    color: #fff !important;
}

/* Fullscreen viewer */
[data-theme="dark"] .viewer {
    background: rgba(0, 0, 0, 0.92) !important;
}

[data-theme="dark"] .viewer .close,
[data-theme="dark"] .viewer .nav {
    color: #e5e7eb !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .viewer .close:hover,
[data-theme="dark"] .viewer .nav:hover {
    color: #fff !important;
}

/* Section headers */
[data-theme="dark"] .page h5 {
    color: #d0d5dd !important;
}

/* Error messages */
[data-theme="dark"] .page .err {
    color: #f87171 !important;
}

[data-theme="dark"] .page .is-invalid {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15) !important;
}

/* Primary action button (Update) - Blue themed */
[data-theme="dark"] .btn-primary-action,
[data-theme="dark"] .page .btn-primary-action,
[data-theme="dark"] #save.btn-primary-action {
    background: #0b5db8 !important;
    color: #fff !important;
    border: 0 !important;
}

[data-theme="dark"] .btn-primary-action:hover,
[data-theme="dark"] .page .btn-primary-action:hover,
[data-theme="dark"] #save.btn-primary-action:hover {
    background: #0a52a3 !important;
}

/* Secondary action button (Cancel) - Red themed */
[data-theme="dark"] .btn-secondary-action,
[data-theme="dark"] .page .btn-secondary-action,
[data-theme="dark"] #cancel.btn-secondary-action {
    background: #e24a3a !important;
    color: #fff !important;
    border: 0 !important;
}

[data-theme="dark"] .btn-secondary-action:hover,
[data-theme="dark"] .page .btn-secondary-action:hover,
[data-theme="dark"] #cancel.btn-secondary-action:hover {
    background: #c0392b !important;
}

/* Toast for site-edit */
[data-theme="dark"] .page #toast {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .page .toast-msg {
    color: #e5e7eb !important;
}

[data-theme="dark"] .page .toast-x {
    color: #98a2b3 !important;
}

[data-theme="dark"] .page .toast-badge {
    background: #34d399 !important;
}

[data-theme="dark"] .page .toast-badge.error {
    background: #f87171 !important;
}

/* ========== PARTY.HTML SPECIFIC ========== */
/* Page container */
[data-theme="dark"] #party-page.mobile-container {
    background: #0f1621 !important;
}

/* Page content area */
[data-theme="dark"] #party-page .page-content {
    background: #0b1118 !important;
}

/* Total amount card - red border box with darker background */
[data-theme="dark"] .total-amount-card .inner {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

[data-theme="dark"] .total-amount-card .label {
    color: #d0d5dd !important;
}

[data-theme="dark"] .total-amount-card .amount {
    color: #f87171 !important;
}

/* Section heading */
[data-theme="dark"] .section-heading {
    color: #d0d5dd !important;
}

/* Activity list items */
[data-theme="dark"] .activity-item {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .activity-item:hover {
    background: rgba(15, 23, 42, 0.05) !important;
}

[data-theme="dark"] .activity-item.deleted {
    opacity: 0.5 !important;
    filter: grayscale(0.3) !important;
}

[data-theme="dark"] .activity-title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .activity-description {
    color: #98a2b3 !important;
}

[data-theme="dark"] .activity-amount {
    color: #f87171 !important;
}

[data-theme="dark"] .activity-date-bubble {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #d0d5dd !important;
}

/* Empty state */
[data-theme="dark"] .empty-state h3 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .empty-state p {
    color: #98a2b3 !important;
}

/* Floating action button */
[data-theme="dark"] .floating-actions .action-btn {
    background: #1a2332 !important;
    border: 1.5px solid #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .floating-actions .action-btn.primary {
    background: #e24a3a !important;
    border-color: #e24a3a !important;
    color: #fff !important;
}

[data-theme="dark"] .floating-actions .action-btn:hover {
    background: #233044 !important;
}

[data-theme="dark"] .floating-actions .action-btn.primary:hover {
    background: #c0392b !important;
}

/* Modal overlay */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .modal-overlay.active {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Modal content */
[data-theme="dark"] .modal-content {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .modal-title {
    color: #e5e7eb !important;
}

/* Form groups in modal */
[data-theme="dark"] .form-group label {
    color: #d0d5dd !important;
}

[data-theme="dark"] .label-row label {
    color: #d0d5dd !important;
}

/* Mini button (Today button) */
[data-theme="dark"] .btn-mini {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .btn-mini:hover {
    background: rgba(15, 23, 42, 0.15) !important;
    border-color: rgba(15, 23, 42, 0.3) !important;
}

/* Modal inputs */
[data-theme="dark"] .modal-input,
[data-theme="dark"] .modal-textarea {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .modal-input::placeholder,
[data-theme="dark"] .modal-textarea::placeholder {
    color: #6b7280 !important;
}

[data-theme="dark"] .modal-input:focus,
[data-theme="dark"] .modal-textarea:focus {
    border-color: #0c6047 !important;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.18) !important;
}

[data-theme="dark"] .modal-input[readonly] {
    background: #0f1621 !important;
    color: #98a2b3 !important;
    opacity: 0.8 !important;
}

/* Field errors */
[data-theme="dark"] .field-error {
    color: #f87171 !important;
}

/* Modal action buttons */
[data-theme="dark"] .modal-action-buttons .btn-primary {
    background: #0c6047 !important;
    color: #fff !important;
}

[data-theme="dark"] .modal-action-buttons .btn-danger {
    background: #e24a3a !important;
    color: #fff !important;
}

[data-theme="dark"] .modal-action-buttons .btn-outline {
    background: #1a2332 !important;
    border: 1.5px solid #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .modal-action-buttons .btn-blue {
    background: #0b5db8 !important;
    color: #fff !important;
}

[data-theme="dark"] .modal-action-buttons .btn-restore {
    background: rgba(14, 165, 233, 0.15) !important;
    border: 1.5px solid rgba(14, 165, 233, 0.4) !important;
    color: #0ea5e9 !important;
}

[data-theme="dark"] .modal-action-buttons .btn:hover {
    opacity: 0.9;
}

/* Delete confirmation card */
[data-theme="dark"] .delete-card {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .delete-card h3 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .delete-card p {
    color: #d0d5dd !important;
}

[data-theme="dark"] .delete-actions .btn-outline {
    background: #1a2332 !important;
    border: 1.5px solid #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .delete-actions .btn-danger {
    background: #e24a3a !important;
    color: #fff !important;
}

[data-theme="dark"] .delete-actions .btn:hover {
    opacity: 0.9;
}

/* Toast notification */
[data-theme="dark"] #party-page #toast {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #party-page .toast-msg {
    color: #e5e7eb !important;
}

[data-theme="dark"] #party-page .toast-x {
    color: #98a2b3 !important;
}

[data-theme="dark"] #party-page .toast-badge {
    background: #34d399 !important;
}

[data-theme="dark"] #party-page .toast-badge.error {
    background: #f87171 !important;
}

/* Bottom nav for party page */
[data-theme="dark"] #party-page .bottom-nav {
    background: #0f1621 !important;
    border-top-color: #233044 !important;
}

[data-theme="dark"] #party-page .bottom-nav .nav-item {
    color: #6b7280 !important;
}

[data-theme="dark"] #party-page .bottom-nav .nav-item.active {
    color: #0c6047 !important;
}

/* Deleted item indicator */
[data-theme="dark"] .activity-title span[style*="color:#b42318"] {
    color: #f87171 !important;
}

/* ========== SPLASH SCREEN SPECIFIC ========== */
[data-theme="dark"] .splash-container {
    background: #0b1118 !important;
}

[data-theme="dark"] .splash-container .app-logo img {
    /* Optional: if logo needs adjustment in dark mode */
    filter: brightness(1.1);
}

[data-theme="dark"] .splash-container .spinner {
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-top-color: transparent !important;
    border-right-color: #0c6047 !important;
    border-bottom-color: transparent !important;
    border-left-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .main-content {
    background: #0f1621 !important;
    color: #e5e7eb !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .main-content h1 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .main-content p {
    color: #d0d5dd !important;
}

/* ========== HOME.HTML SPECIFIC ========== */
/* Mobile container */
[data-theme="dark"] .mobile-container {
    background: #0f1621 !important;
}

/* Content area */
[data-theme="dark"] .content-area {
    background: #0b1118 !important;
}

/* Hero section - dark slate instead of green */
[data-theme="dark"] .hero {
    background: #0c6047 !important;
}

/* Sheet (main content card) */
[data-theme="dark"] .sheet {
    background: #0b1118 !important;
}

/* Filter pills */
[data-theme="dark"] .btn-dark-blue {
    background: #0b5db8 !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-filter {
    background: #0c6047 !important;
    color: #fff !important;
}
[data-theme="dark"] .bar-income {
    color: #1ab189 !important;
}
/* Summary cards */
[data-theme="dark"] .summary-card.income {
    background: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

[data-theme="dark"] .summary-card.income .icon,
[data-theme="dark"] .summary-card.income .amount {
    color: #34d399 !important;
}

[data-theme="dark"] .summary-card.income .label {
    color: #98a2b3 !important;
}

[data-theme="dark"] .summary-card.expense {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

[data-theme="dark"] .summary-card.expense .icon,
[data-theme="dark"] .summary-card.expense .amount {
    color: #f87171 !important;
}

[data-theme="dark"] .summary-card.expense .label {
    color: #98a2b3 !important;
}

/* Section headers */
[data-theme="dark"] .section-header {
    color: #e5e7eb !important;
}

/* Shortcuts panel */
[data-theme="dark"] .panel {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .shortcut-icon-wrapper {
    background: rgba(15, 23, 42, 0.15) !important;
}

[data-theme="dark"] .shortcut-icon-wrapper i {
    color: #1ab189 !important;
}

[data-theme="dark"] .shortcut-link span {
    color: #d0d5dd !important;
}

/* Recent activities - FIX TEXT VISIBILITY */
[data-theme="dark"] .recent-activities .transaction-item {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .transaction-title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .transaction-date {
    background: #1a2332 !important;
    border: 1px solid #233044 !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .recent-activities .label {
    color: #98a2b3 !important;
}

[data-theme="dark"] .amount-income {
    color: #34d399 !important;
}

[data-theme="dark"] .amount-expense {
    color: #f87171 !important;
}

/* Chart card */
[data-theme="dark"] .chart-card {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .chart-head .label-text {
    color: #d0d5dd !important;
}

[data-theme="dark"] .chart-head .form-select,
[data-theme="dark"] .chart-select-btn {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .chart-select-menu {
    background: #0f1621 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .chart-select-menu .dropdown-item {
    color: #d0d5dd !important;
}

[data-theme="dark"] .chart-select-menu .dropdown-item.active {
    background: rgba(15, 23, 42, 0.12) !important;
    color: #0c6047 !important;
}

[data-theme="dark"] .y-axis {
    color: #98a2b3 !important;
}

[data-theme="dark"] .y-axis::after {
    background: #233044 !important;
}

[data-theme="dark"] .bars-area::after {
    background: #233044 !important;
}

[data-theme="dark"] .x-axis {
    color: #98a2b3 !important;
}

[data-theme="dark"] .chart-caption {
    color: #e5e7eb !important;
}

[data-theme="dark"] .chart-summary .label {
    color: #98a2b3 !important;
}

[data-theme="dark"] .chart-summary .income-text {
    color: #34d399 !important;
}

[data-theme="dark"] .chart-summary .expense-text {
    color: #f87171 !important;
}

[data-theme="dark"] #sumProfitTxt.positive {
    color: #34d399 !important;
}

[data-theme="dark"] #sumProfitTxt.negative {
    color: #f87171 !important;
}

/* Edit menu button */
/* Edit menu button */
[data-theme="dark"] .edit-menu-btn {
    color: #1ab189 !important;
}

/* Date filter modal */
[data-theme="dark"] .modal-content {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #1e2838 !important;
}

[data-theme="dark"] .modal-title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .modal-body .form-label {
    color: #d0d5dd !important;
}

[data-theme="dark"] .modal-body .form-control {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
    color-scheme: dark;
}

[data-theme="dark"]
    .modal-body
    input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

[data-theme="dark"] .modal-footer {
    border-top-color: #1e2838 !important;
}

[data-theme="dark"] .btn-outline-secondary {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .btn-success {
    background: #0c6047 !important;
    color: #fff !important;
}

/* Shortcut modal */
[data-theme="dark"] .edit-modal .modal-content {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .edit-modal .inset-panel {
    background: #0b1118 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .sc-tile .sc-circle {
    background: rgba(15, 23, 42, 0.15) !important;
}

[data-theme="dark"] .sc-tile .sc-circle i {
    color: #0c6047 !important;
}

[data-theme="dark"] .sc-name {
    color: #d0d5dd !important;
}

/* Empty state text */
[data-theme="dark"] .text-muted {
    color: #98a2b3 !important;
}

/* View all button */
[data-theme="dark"] .btn-oval {
    background: #0b5db8 !important;
    color: #fff !important;
}

/* ========== MODAL TITLES - FORCE DARK MODE (HIGHEST SPECIFICITY) ========== */
[data-theme="dark"] .sheet-overlay .sheet h3[style],
[data-theme="dark"] .sheet-overlay .sheet h2[style],
[data-theme="dark"] #filter-modal .sheet h3[style*="color"],
[data-theme="dark"] #income-modal .sheet h2[style],
[data-theme="dark"] #expense-modal .sheet h2[style],
[data-theme="dark"] #finance-edit-modal .sheet h2[style],
[data-theme="dark"] #finance-delete-modal h2[style],
[data-theme="dark"] h2#fd-title[style],
[data-theme="dark"] p#fd-desc[style] {
    color: #e5e7eb !important;
}

/* Modal paragraph descriptions */
[data-theme="dark"] #finance-delete-modal p#fd-desc[style*="color"] {
    color: #d0d5dd !important;
}

/* Additional catch-all for any modal title with inline styles */
[data-theme="dark"] .sheet h2[style*="font"],
[data-theme="dark"] .sheet h3[style*="font"],
[data-theme="dark"] .modal-content h2[style],
[data-theme="dark"] .modal-content h3[style] {
    color: #e5e7eb !important;
}

/* ========== NOTES PAGE DARK THEME ========== */

/* Page container */
[data-theme="dark"] .page-container {
    background: #0f1621 !important;
}

/* Content area background */
[data-theme="dark"] .content {
    background: #0b1118 !important;
}

/* Note list items - regular cards */
[data-theme="dark"] .list-item {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .list-item:hover {
    background: rgba(15, 23, 42, 0.05) !important;
}

/* Important/Priority notes - red tint */
[data-theme="dark"] .list-item.important {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

[data-theme="dark"] .list-item.important:hover {
    background: rgba(248, 113, 113, 0.12) !important;
}

/* Note title text */
[data-theme="dark"] .item-title {
    color: #e5e7eb !important;
}

/* Note date text */
[data-theme="dark"] .item-date {
    color: #98a2b3 !important;
}

/* Alert icon for important notes */
[data-theme="dark"] .alert-icon {
    background: #f87171 !important;
    color: #fff !important;
}

/* Arrow icon */
[data-theme="dark"] .arrow-right {
    color: #6b7280 !important;
}

/* Empty state styling */
[data-theme="dark"] .empty-state {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .empty-sub {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-cta {
    background: #13a87d !important;
    color: #fff !important;
}

/* Empty state illustration - adjust brightness */
[data-theme="dark"] .empty-ill {
    opacity: 0.8;
    filter: brightness(0.85);
}

/* Toast notification */
[data-theme="dark"] #toast {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .toast-msg {
    color: #e5e7eb !important;
}

[data-theme="dark"] .toast-x {
    color: #98a2b3 !important;
}

[data-theme="dark"] .toast-badge {
    background: #34d399 !important;
}

[data-theme="dark"] .toast-badge.error {
    background: #f87171 !important;
}

/* New button - keep blue as is (CTA color) */
[data-theme="dark"] .new-button {
    background: var(--cta-blue, #186b97) !important;
    color: #fff !important;
}

/* Header - dark slate */
[data-theme="dark"] .header {
    background: #0c6047 !important;
}

[data-theme="dark"] .back-arrow {
    color: #fff !important;
}

[data-theme="dark"] .page-title {
    color: #fff !important;
}

/* Safe area inset color bar */
[data-theme="dark"] body::before {
    background: #0c6047 !important;
}

/* ========== NOTE.HTML DARK THEME ========== */

/* Page background */
[data-theme="dark"] .page {
    background: #0f1621 !important;
}

/* Content area */
[data-theme="dark"] .content {
    background: #0b1118 !important;
}

/* Header - dark slate */
[data-theme="dark"] .header {
    background: #0c6047 !important;
}

[data-theme="dark"] .back {
    color: #fff !important;
}

[data-theme="dark"] .title {
    color: #fff !important;
}

/* Delete button pill */
[data-theme="dark"] .pill-danger {
    background: var(--danger, #e24a3a) !important;
    color: #fff !important;
}

[data-theme="dark"] .pill-danger svg {
    stroke: #fff !important;
}

/* Note text box */
[data-theme="dark"] .note-box {
    background: #0f1621 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .textarea {
    background: transparent !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .textarea::placeholder {
    color: #6b7280 !important;
}

/* Error state for textarea */
[data-theme="dark"] .is-invalid {
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25) inset !important;
    border-color: #f87171 !important;
}

[data-theme="dark"] .err {
    color: #f87171 !important;
}

/* Checkbox row */
[data-theme="dark"] .check-row {
    color: #d0d5dd !important;
}

[data-theme="dark"] .custom-checkbox {
    background: #1a2332 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .custom-checkbox:checked {
    background: #0c6047 !important;
    border-color: #0c6047 !important;
}

[data-theme="dark"] .custom-checkbox:checked::after {
    color: #fff !important;
}

/* Primary update button - keep blue */
[data-theme="dark"] .primary-btn {
    background: var(--blue, #186b97) !important;
    color: #fff !important;
}

/* Toast notification */
[data-theme="dark"] #toast {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .toast-msg {
    color: #e5e7eb !important;
}

[data-theme="dark"] .toast-x {
    color: #98a2b3 !important;
}

[data-theme="dark"] .toast-badge {
    background: #34d399 !important;
}

[data-theme="dark"] .toast-badge.error {
    background: #f87171 !important;
}

/* ========== DELETE MODAL DARK THEME ========== */

/* Modal overlay backdrop */
[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Modal card */
[data-theme="dark"] .modal-card {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

/* Modal title */
[data-theme="dark"] .modal-card h3 {
    color: #e5e7eb !important;
}

/* Modal description text */
[data-theme="dark"] .modal-card p {
    color: #d0d5dd !important;
}

/* Cancel button (outline/secondary) */
[data-theme="dark"] .btn-outline {
    background: #1a2332 !important;
    border: 1.5px solid #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .btn-outline:hover {
    background: #233044 !important;
}

/* Delete button (danger/red) */
[data-theme="dark"] .btn-danger {
    background: #e24a3a !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-danger:hover {
    background: #c0392b !important;
}

/* Safe area inset bar */
[data-theme="dark"] body::before {
    background: #0c6047 !important;
}

/* highlight checked radio buttons */
.btn-check:checked + .btn {
    background: #effef7 !important;
    border-color: #78d8be !important;
}

/* Dark mode fix for expense modal tab switches */
[data-theme="dark"] .btn-check:checked + .btn,
[data-theme="dark"] .btn-check:checked + .btn-light {
    background: rgba(12, 96, 71, 0.15) !important;
    border-color: rgba(12, 96, 71, 0.4) !important;
    color: #1ab189 !important;
}

[data-theme="dark"] .btn-group .btn-light {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}
/* ========== RESOURCE TABLE DARK THEME FIX ========== */

/* Table wrapper and container */
[data-theme="dark"] .table-wrap {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

/* Table element */
[data-theme="dark"] table,
[data-theme="dark"] .resource-table {
    background: #0f1621 !important;
}

/* Table header */
[data-theme="dark"] thead th {
    background: #1a2332 !important;
    color: #d0d5dd !important;
    border-bottom-color: #233044 !important;
}

/* Table body cells - THIS IS THE KEY FIX */
[data-theme="dark"] tbody td {
    background: #0f1621 !important;
    color: #e5e7eb !important;
    border-bottom-color: #1e2838 !important;
}

/* Table rows hover effect */
[data-theme="dark"] tbody tr:hover {
    background: rgba(15, 23, 42, 0.05) !important;
}

[data-theme="dark"] tbody tr:hover td {
    background: rgba(15, 23, 42, 0.05) !important;
}

/* Amount column - keep red color for amounts */
[data-theme="dark"] td.col-amt {
    color: #f87171 !important;
}

/* Status pills in table */
[data-theme="dark"] .status-pill.paid {
    background: rgba(52, 211, 153, 0.15) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .status-pill.unpaid {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
}

/* Action buttons in table */
[data-theme="dark"] .act-btn {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .act-btn:hover {
    background: rgba(148, 163, 184, 0.15) !important;
}

[data-theme="dark"] .act-btn.edit {
    background: rgba(96, 165, 250, 0.1) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .act-btn.edit:hover {
    background: rgba(96, 165, 250, 0.15) !important;
}

[data-theme="dark"] .act-btn.del {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .act-btn.del:hover {
    background: rgba(248, 113, 113, 0.15) !important;
}

/* Panel containing the table */
[data-theme="dark"] .panel {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

/* Section head with filter button */
[data-theme="dark"] .section-head h2 {
    color: #e5e7eb !important;
}

/* Empty state */
[data-theme="dark"] .empty-state {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-state h3 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .empty-state p {
    color: #98a2b3 !important;
}

/* Add button (fixed at bottom) */
[data-theme="dark"] .add-fixed {
    background: var(--cta-blue, #0b5db8) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(11, 93, 184, 0.3) !important;
}

/* ========== RESOURCE MODAL DARK THEME ========== */

/* Modal inputs in edit modal */
[data-theme="dark"] #editModal input,
[data-theme="dark"] #editModal select,
[data-theme="dark"] #editModal textarea {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] #editModal input::placeholder,
[data-theme="dark"] #editModal textarea::placeholder {
    color: #6b7280 !important;
}

[data-theme="dark"] #editModal label {
    color: #d0d5dd !important;
}

[data-theme="dark"] #editModal .hint {
    color: #98a2b3 !important;
}

/* Date input calendar picker */
[data-theme="dark"] #editModal input[type="date"] {
    color-scheme: dark;
}

[data-theme="dark"]
    #editModal
    input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 1;
}

/* Checkbox in edit modal */
[data-theme="dark"] #editModal input[type="checkbox"] {
    accent-color: var(--brand-green, #0c6047) !important;
}

/* ========== PARTY MODAL DARK THEME ========== */

[data-theme="dark"] #partyModal input {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] #partyModal input::placeholder {
    color: #6b7280 !important;
}

[data-theme="dark"] #partyModal label {
    color: #d0d5dd !important;
}

/* ========== FILTER MODAL DARK THEME ========== */

[data-theme="dark"] #filterModal .range-btn {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] #filterModal .range-btn:hover {
    background: rgba(148, 163, 184, 0.15) !important;
}

[data-theme="dark"] #filterModal .range-btn.active {
    background: rgba(12, 96, 71, 0.15) !important;
    border-color: rgba(12, 96, 71, 0.4) !important;
    color: #1ab189 !important;
}

[data-theme="dark"] #filterModal .range-btn.active::after {
    background: #0c6047 !important;
}

[data-theme="dark"] #filterModal input[type="date"] {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
    color-scheme: dark;
}

[data-theme="dark"]
    #filterModal
    input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

[data-theme="dark"] #filterModal label {
    color: #d0d5dd !important;
}

[data-theme="dark"] #filterModal .hint {
    color: #98a2b3 !important;
}

/* ========== SCROLLBAR FOR TABLE ========== */

[data-theme="dark"] .table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] .table-wrap::-webkit-scrollbar-track {
    background: #0b1118 !important;
}

[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb {
    background: #233044 !important;
    border-radius: 4px;
}

[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb:hover {
    background: #2d4161 !important;
}

/* ========== SUBSCRIPTION MODAL DARK THEME (C-SITE-LIST.HTML) ========== */

/* Modal backdrop - matching other modals */
[data-theme="dark"] #subModal-backdrop {
    background: rgba(0, 0, 0, 0.65) !important;
}

/* Modal card container - matching other modal cards */
[data-theme="dark"] .subcard {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

/* Crown icon badge - matching other icon badges */
[data-theme="dark"] .subcard-badge {
    background: rgba(26, 177, 137, 0.12) !important;
    color: #1ab189 !important;
}

/* Modal title - matching other modal titles */
[data-theme="dark"] .subcard-title,
[data-theme="dark"] #subTitle {
    color: #e5e7eb !important;
}

/* Modal description text - matching other modal text */
[data-theme="dark"] .subcard-text {
    color: #d0d5dd !important;
}

/* Cancel button - matching btn-cancel style */
[data-theme="dark"] .subcard-cancel {
    background: transparent !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .subcard-cancel:hover {
    color: #e5e7eb !important;
}

/* Subscribe CTA button - matching primary action buttons */
[data-theme="dark"] .subcard-cta {
    background: #0c6047 !important;
    color: #fff !important;
}

[data-theme="dark"] .subcard-cta:hover {
    background: #0a5038 !important;
}

/* ========== SITE LIST PAGE DARK THEME ========== */

/* Page header */
[data-theme="dark"] .page-header {
    background: #0c6047 !important;
}

/* Add new button */
[data-theme="dark"] .btn-add-new {
    background: var(--cta-blue, #0b5db8) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(11, 93, 184, 0.3) !important;
}

/* Content area */
[data-theme="dark"] .content-area {
    background: #0b1118 !important;
}

/* Search input */
[data-theme="dark"] .search-input {
    background: #0f1621 !important;
    border-color: rgba(12, 96, 71, 0.4) !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .search-input::placeholder {
    color: #6b7280 !important;
}

/* Search button icon */
[data-theme="dark"] .search-btn {
    background: #0c6047 !important;
}

/* Site list items */
[data-theme="dark"] .site-item {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

[data-theme="dark"] .site-item:hover {
    background: rgba(15, 23, 42, 0.05) !important;
}

/* Site name text */
[data-theme="dark"] .site-name {
    color: #e5e7eb !important;
}

/* Site location text */
[data-theme="dark"] .site-location {
    color: #98a2b3 !important;
}

/* Site arrow icon */
[data-theme="dark"] .site-arrow {
    color: #6b7280 !important;
}

/* Status tags */
[data-theme="dark"] .status-tag {
    opacity: 0.9;
}

[data-theme="dark"] .status-ongoing,
[data-theme="dark"] .status-completed {
    background: rgba(52, 211, 153, 0.15) !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .status-paused {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
    color: #fbbf24 !important;
}

/* Empty state */
[data-theme="dark"] .empty-state {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-state h3 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .empty-state p {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-state .empty-cta {
    background: var(--brand-green, #1ab189) !important;
    color: #fff !important;
}

/* Empty state illustration - adjust brightness for dark mode */
[data-theme="dark"] .empty-state img {
    opacity: 0.85;
    filter: brightness(0.9);
}
/* ========== PARTY.HTML SPECIFIC ========== */
/* Page container */
[data-theme="dark"] #party-page.mobile-container {
    background: #0f1621 !important;
}

/* Activity status badges - paid/due */
[data-theme="dark"] .activity-status {
    opacity: 0.95;
}

[data-theme="dark"] .activity-status.paid {
    background: rgba(52, 211, 153, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
}

[data-theme="dark"] .activity-status.due {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}

/* ========== RESOURCE REPORTS PAGE DARK THEME ========== */

/* Mobile container */
[data-theme="dark"] .mobile-container {
    background: #0b1118 !important;
}

/* App header - keep green */
[data-theme="dark"] .app-header {
    background: #0c6047 !important;
}

[data-theme="dark"] .header-row {
    background: #0c6047 !important;
}

/* Back button */
[data-theme="dark"] .back-btn {
    color: #fff !important;
}

/* Header title */
[data-theme="dark"] .header-title h1,
[data-theme="dark"] .header-title p {
    color: #fff !important;
}

/* Content area */
[data-theme="dark"] .content {
    background: #0b1118 !important;
}

/* Section head */
[data-theme="dark"] .section-head {
    background: #0b1118 !important;
}

[data-theme="dark"] .section-head h2 {
    color: #e5e7eb !important;
}

/* Filter button */
[data-theme="dark"] .btn-filter {
    background: #0c6047 !important;
    color: #fff !important;
    border-color: #0c6047 !important;
}

[data-theme="dark"] .btn-filter:hover {
    background: #0a5038 !important;
}

/* Table container */
[data-theme="dark"] .table-container {
    background: #0f1621 !important;
}

/* Table */
[data-theme="dark"] table {
    background: #0f1621 !important;
}

/* Table header */
[data-theme="dark"] thead {
    background: #1a2332 !important;
}

[data-theme="dark"] thead th {
    background: #1a2332 !important;
    color: #d0d5dd !important;
    border-bottom-color: #233044 !important;
}

/* Table body - THIS IS THE KEY FIX */
[data-theme="dark"] tbody {
    background: #0f1621 !important;
}

[data-theme="dark"] tbody td {
    background: #0f1621 !important;
    color: #e5e7eb !important;
    border-bottom-color: #1e2838 !important;
}

/* Table rows hover */
[data-theme="dark"] tbody tr:hover {
    background: rgba(15, 23, 42, 0.05) !important;
}

[data-theme="dark"] tbody tr:hover td {
    background: rgba(15, 23, 42, 0.05) !important;
}

/* Amount column - keep red */
[data-theme="dark"] td.col-amt {
    color: #f87171 !important;
}

/* Status pills */
[data-theme="dark"] .status-pill {
    opacity: 0.95;
}

[data-theme="dark"] .status-pill.paid {
    background: rgba(52, 211, 153, 0.15) !important;
    color: #34d399 !important;
}

[data-theme="dark"] .status-pill.unpaid {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
}

/* Empty state in table */
[data-theme="dark"] .empty-row td {
    background: #0f1621 !important;
}

[data-theme="dark"] .empty-cell {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-cell strong {
    color: #e5e7eb !important;
}

[data-theme="dark"] .empty-cell p {
    color: #98a2b3 !important;
}

/* Bottom Navigation */
[data-theme="dark"] .bottom-nav {
    background: #0f1621 !important;
    border-top-color: #233044 !important;
}

[data-theme="dark"] .bottom-nav .nav-item {
    color: #6b7280 !important;
}

[data-theme="dark"] .bottom-nav .nav-item:hover {
    color: #98a2b3 !important;
}

[data-theme="dark"] .bottom-nav .nav-item.active {
    color: #1ab189 !important;
}

/* Filter Modal */
[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .modal .card {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .card h3 {
    color: #e5e7eb !important;
}

/* Range buttons in filter modal */
[data-theme="dark"] .range-btn {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .range-btn:hover {
    background: rgba(148, 163, 184, 0.15) !important;
}

[data-theme="dark"] .range-btn.active {
    background: rgba(12, 96, 71, 0.15) !important;
    border-color: rgba(12, 96, 71, 0.4) !important;
    color: #1ab189 !important;
}

[data-theme="dark"] .range-btn.active::after {
    background: #0c6047 !important;
}

/* Date inputs in filter modal */
[data-theme="dark"] input[type="date"] {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
    color-scheme: dark;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 1;
    cursor: pointer;
}

[data-theme="dark"] label {
    color: #d0d5dd !important;
}

/* Modal action buttons */
[data-theme="dark"] .btn-save {
    background: #0c6047 !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-save:hover {
    background: #0a5038 !important;
}

[data-theme="dark"] .btn-cancel {
    background: #1a2332 !important;
    color: #e5e7eb !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .btn-cancel:hover {
    background: #233044 !important;
}

/* Grid layout for date inputs */
[data-theme="dark"] .grid-2 {
    color: #e5e7eb !important;
}

/* Toast notification */
[data-theme="dark"] #toast {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .toast-msg {
    color: #e5e7eb !important;
}

[data-theme="dark"] .toast-icon {
    background: #34d399 !important;
}

[data-theme="dark"] .toast-icon.error {
    background: #f87171 !important;
}

/* PDF content (hidden but styled) */
[data-theme="dark"] .pdf-content {
    background: #fff !important;
    color: #000 !important;
}

/* Debug panel */
[data-theme="dark"] #apiDebug {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

/* Scrollbar for table */
[data-theme="dark"] .table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] .table-container::-webkit-scrollbar-track {
    background: #0b1118 !important;
}

[data-theme="dark"] .table-container::-webkit-scrollbar-thumb {
    background: #233044 !important;
    border-radius: 4px;
}

[data-theme="dark"] .table-container::-webkit-scrollbar-thumb:hover {
    background: #2d4161 !important;
}

/* Actions section in modal */
[data-theme="dark"] .actions {
    background: transparent !important;
}

/* Range grid */
[data-theme="dark"] .range-grid {
    background: transparent !important;
}

/* Custom dates box */
[data-theme="dark"] #customDates {
    background: transparent !important;
}

/* Ensure all text in modal is visible */
[data-theme="dark"] .modal * {
    border-color: #233044;
}

[data-theme="dark"] .modal span,
[data-theme="dark"] .modal div:not(.card):not(.range-btn) {
    color: inherit;
}

/* Focus states */
[data-theme="dark"] input[type="date"]:focus {
    border-color: #0c6047 !important;
    box-shadow: 0 0 0 2px rgba(12, 96, 71, 0.18) !important;
}

[data-theme="dark"] .range-btn:focus {
    outline: 2px solid rgba(12, 96, 71, 0.5) !important;
    outline-offset: 2px;
}

/* Safe area inset (for iOS devices) */
[data-theme="dark"] body::before {
    background: #0c6047 !important;
}
/* ========== PROFIT/LOSS CARD DARK THEME FIX ========== */

/* Base profit card styling */
[data-theme="dark"] .summary-card.profit {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

/* Profit card - positive (green tint) */
[data-theme="dark"] .summary-card.profit-positive {
    background: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.25) !important;
}

[data-theme="dark"] .summary-card.profit-positive .amount {
    color: #34d399 !important;
}

[data-theme="dark"] .summary-card.profit-positive .label {
    color: #98a2b3 !important;
}

/* Profit card - negative/loss (red tint) */
[data-theme="dark"] .summary-card.profit-negative {
    background: rgba(248, 113, 113, 0.08) !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

[data-theme="dark"] .summary-card.profit-negative .amount {
    color: #f87171 !important;
}

[data-theme="dark"] .summary-card.profit-negative .label {
    color: #98a2b3 !important;
}

/* Profit card - break even (neutral gray) */
[data-theme="dark"] .summary-card.profit-break-even {
    background: rgba(148, 163, 184, 0.08) !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
}

[data-theme="dark"] .summary-card.profit-break-even .amount {
    color: #e5e7eb !important;
}

[data-theme="dark"] .summary-card.profit-break-even .label {
    color: #98a2b3 !important;
}

/* Icon color in profit card */
[data-theme="dark"] .summary-card.profit .icon i {
    color: #f97316 !important;
}

/* Ensure all text is visible */
[data-theme="dark"] #profit-card .amount,
[data-theme="dark"] #profit-amount {
    color: inherit !important;
}

[data-theme="dark"] #profit-card .label,
[data-theme="dark"] #profit-label {
    color: #98a2b3 !important;
}
/* ========== REPORTS.HTML DARK THEME FIX ========== */

/* Page background */
[data-theme="dark"] #reports-page.page {
    background: #0b1118 !important;
}

/* Content area background */
[data-theme="dark"] #reports-page .content {
    background: #0b1118 !important;
}

/* Card background */
[data-theme="dark"] #reports-page .card {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
}

/* Remove ALL interaction states - no hover, active, or focus backgrounds */
[data-theme="dark"] #reports-page .rowlink,
[data-theme="dark"] #reports-page .rowlink:hover,
[data-theme="dark"] #reports-page .rowlink:active,
[data-theme="dark"] #reports-page .rowlink:focus,
[data-theme="dark"] #reports-page .rowlink:focus-visible {
    background: transparent !important;
}

/* Only show outline on keyboard focus, no background */
[data-theme="dark"] #reports-page .rowlink:focus-visible {
    outline: 2px solid rgba(26, 177, 137, 0.5) !important;
    outline-offset: -2px;
}

/* Fix white borders between rows */
[data-theme="dark"] #reports-page .rowlink + .rowlink {
    border-top-color: #1e2838 !important;
}

/* Row link text colors */
[data-theme="dark"] #reports-page .label {
    color: #e5e7eb !important;
}

/* Icon colors - matching more.html */
[data-theme="dark"] #reports-page .ico {
    color: #d0d5dd !important;
}

[data-theme="dark"] #reports-page .ico path,
[data-theme="dark"] #reports-page .ico circle,
[data-theme="dark"] #reports-page .ico rect {
    stroke: currentColor !important;
}

/* Chevron arrow colors - matching more.html */
[data-theme="dark"] #reports-page .chev {
    color: #6b7280 !important;
}

[data-theme="dark"] #reports-page .chev path {
    stroke: currentColor !important;
}

/* Section titles */
[data-theme="dark"] #reports-page .section-title {
    color: #98a2b3 !important;
}

/* Header */
[data-theme="dark"] #reports-page .header {
    background: #0c6047 !important;
}

[data-theme="dark"] #reports-page .header-row {
    background: #0c6047 !important;
}

/* Back button and title */
[data-theme="dark"] #reports-page .back {
    color: #fff !important;
}

[data-theme="dark"] #reports-page .title {
    color: #fff !important;
}

/* Block spacing */
[data-theme="dark"] #reports-page .block {
    background: transparent !important;
}

/* Ensure item-left and item-right don't have backgrounds */
[data-theme="dark"] #reports-page .item-left,
[data-theme="dark"] #reports-page .item-right {
    background: transparent !important;
}

/* Override any webkit tap highlight */
[data-theme="dark"] #reports-page .rowlink {
    -webkit-tap-highlight-color: transparent !important;
    tap-highlight-color: transparent !important;
}

/* ========== INCOME/EXPENSE DETAIL PAGES DARK THEME ========== */
/* (आम्दानीको विवरण / खर्चको विवरण pages) */

/* Page background */
[data-theme="dark"] .page {
    background: #0b1118 !important;
}

/* Header - keep green */
[data-theme="dark"] .header {
    background: #0c6047 !important;
}

[data-theme="dark"] .header .back,
[data-theme="dark"] .header .title {
    color: #fff !important;
}

/* Content area background */
[data-theme="dark"] .content {
    background: #0b1118 !important;
}

/* Filter pills */
[data-theme="dark"] .filter-pills .btn-dark-blue {
    background: #0b5db8 !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(11, 93, 184, 0.3) !important;
}

[data-theme="dark"] .filter-pills .btn-dark-blue:hover,
[data-theme="dark"] .filter-pills .btn-dark-blue:focus {
    background: #0a52a3 !important;
    color: #fff !important;
}

[data-theme="dark"] .filter-pills .btn-dark-blue.active {
    background: #0a52a3 !important;
    color: #fff !important;
}

[data-theme="dark"] .filter-pills .btn-filter {
    background: #0c6047 !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(12, 96, 71, 0.35) !important;
}

[data-theme="dark"] .filter-pills .btn-filter:hover,
[data-theme="dark"] .filter-pills .btn-filter:focus,
[data-theme="dark"] .filter-pills .btn-filter:active {
    background: #0a5038 !important;
    color: #fff !important;
}

/* Transaction list cards */
[data-theme="dark"] .tx-list .tx-card {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .tx-card .tx-title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .tx-card .tx-date-pill {
    background: #1a2332 !important;
    border: 1px solid #233044 !important;
    color: #d0d5dd !important;
}

[data-theme="dark"] .tx-card .tx-col small {
    color: #98a2b3 !important;
}

[data-theme="dark"] .tx-card .tx-income {
    color: #34d399 !important;
}

[data-theme="dark"] .tx-card .tx-expense {
    color: #f87171 !important;
}

/* Empty state */
[data-theme="dark"] .empty-state {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-state h3 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .empty-state p {
    color: #98a2b3 !important;
}

[data-theme="dark"] .empty-state img {
    opacity: 0.85;
    filter: brightness(0.9);
}

/* Date filter modal */
[data-theme="dark"] .modal-content {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #1e2838 !important;
}

[data-theme="dark"] .modal-title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .modal-body .form-label {
    color: #d0d5dd !important;
}

[data-theme="dark"] .modal-body .form-control {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
    color-scheme: dark;
}

[data-theme="dark"]
    .modal-body
    input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 1;
    cursor: pointer;
}

[data-theme="dark"] .modal-footer {
    border-top-color: #1e2838 !important;
}

[data-theme="dark"] .modal-footer .btn-outline-secondary {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .modal-footer .btn-success {
    background: #0c6047 !important;
    color: #fff !important;
}

/* Bottom Navigation */
[data-theme="dark"] .bottom-nav {
    background: #0f1621 !important;
    border-top-color: #233044 !important;
}

[data-theme="dark"] .bottom-nav .nav-item {
    color: #6b7280 !important;
}

[data-theme="dark"] .bottom-nav .nav-item:hover {
    color: #98a2b3 !important;
}

[data-theme="dark"] .bottom-nav .nav-item.active {
    color: #1ab189 !important;
}

/* Toast notification */
[data-theme="dark"] #toast {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .toast-badge {
    background: #34d399 !important;
}

[data-theme="dark"] .toast-badge.error {
    background: #f87171 !important;
}

[data-theme="dark"] .toast-msg {
    color: #e5e7eb !important;
}

[data-theme="dark"] .toast-x {
    color: #98a2b3 !important;
}

/* Loading/Error messages */
[data-theme="dark"] #loadingMsg {
    color: #d0d5dd !important;
}

/* Debug panel */
[data-theme="dark"] #apiDebug {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

/* PDF content (hidden but keep light for export) */
[data-theme="dark"] .pdf-content {
    background: #fff !important;
    color: #000 !important;
}

/* ========== SUBSCRIPTION PAGE DARK THEME ========== */
/* (सब्स्क्राइब page) */

/* Screen background */
[data-theme="dark"] .screen {
    background: #0b1118 !important;
}

/* Header - keep green */
[data-theme="dark"] header {
    background: #0c6047 !important;
}

[data-theme="dark"] header h1 {
    color: #fff !important;
}

[data-theme="dark"] header .back {
    color: #fff !important;
}

/* Main content area */
[data-theme="dark"] main {
    background: #0b1118 !important;
}

/* Intro section */
[data-theme="dark"] .intro-badge {
    background: rgba(26, 177, 137, 0.12) !important;
    color: #1ab189 !important;
}

[data-theme="dark"] .intro-text h2 {
    color: #e5e7eb !important;
}

[data-theme="dark"] .intro-text p {
    color: #98a2b3 !important;
}

/* Plan cards */
[data-theme="dark"] .plan {
    background: #0f1621 !important;
    border-color: #1e2838 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .plan-label {
    color: #e5e7eb !important;
}

[data-theme="dark"] .plan-price {
    color: #e5e7eb !important;
}

[data-theme="dark"] .plan-suffix {
    color: #98a2b3 !important;
}

[data-theme="dark"] .feature {
    color: #d0d5dd !important;
}

[data-theme="dark"] .check {
    background: #34d399 !important;
    color: #fff !important;
}

/* Accent plan (lifetime) */
[data-theme="dark"] .plan.accent {
    background: rgba(246, 145, 14, 0.08) !important;
    border-color: rgba(246, 145, 14, 0.3) !important;
}

[data-theme="dark"] .corner-crown {
    color: #f6910e !important;
}

/* Top pill badges */
[data-theme="dark"] .pill-over {
    background: #0c6047 !important;
    color: #fff !important;
}

/* Buttons */
[data-theme="dark"] .btn-primary {
    background: #0c6047 !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-disabled {
    background: #1a2332 !important;
    color: #6b7280 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .btn-accent {
    background: #f6910e !important;
    color: #fff !important;
}

/* ========== PAYMENT PAGE DARK THEME ========== */
/* (भुक्तानी विधि page) */

/* Screen background */
[data-theme="dark"] .screen {
    background: #0b1118 !important;
}

/* Header */
[data-theme="dark"] header {
    background: #0c6047 !important;
}

[data-theme="dark"] header h1 {
    color: #fff !important;
}

[data-theme="dark"] .back-btn {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Main content */
[data-theme="dark"] main {
    background: #0b1118 !important;
}

/* Tabs */
[data-theme="dark"] .tabs {
    background: #1a2332 !important;
}

[data-theme="dark"] .tab-btn {
    color: #98a2b3 !important;
}

[data-theme="dark"] .tab-btn.active {
    background: #0f1621 !important;
    color: #1ab189 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

/* Amount summary card */
[data-theme="dark"] .amount-card {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .amount-row {
    border-bottom-color: #233044 !important;
}

[data-theme="dark"] .amount-label {
    color: #98a2b3 !important;
}

[data-theme="dark"] .amount-value {
    color: #e5e7eb !important;
}

[data-theme="dark"] .amount-row-total {
    background: #0b5db8 !important;
}

[data-theme="dark"] .amount-row-total .amount-label,
[data-theme="dark"] .amount-row-total .amount-value {
    color: #fff !important;
}

/* Card sections */
[data-theme="dark"] .card {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .card-title {
    color: #e5e7eb !important;
}

/* QR wrapper */
[data-theme="dark"] .qr-wrapper {
    background: #1a2332 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .qr-image {
    background: #0f1621 !important;
}

[data-theme="dark"] .qr-note {
    color: #d0d5dd !important;
}

/* Helper note */
[data-theme="dark"] .helper-note {
    background: rgba(96, 165, 250, 0.08) !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(96, 165, 250, 0.2) !important;
}

[data-theme="dark"] .helper-note i {
    color: #60a5fa !important;
}

/* Photo upload section */
[data-theme="dark"] .photo-header .photo-icon {
    background: rgba(26, 177, 137, 0.12) !important;
    color: #1ab189 !important;
}

[data-theme="dark"] .photo-title {
    color: #e5e7eb !important;
}

[data-theme="dark"] .photo-sub {
    color: #98a2b3 !important;
}

[data-theme="dark"] .photo-drop {
    background: #1a2332 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] .photo-empty {
    color: #98a2b3 !important;
}

[data-theme="dark"] .photo-empty-icon {
    background: rgba(26, 177, 137, 0.12) !important;
    color: #1ab189 !important;
}

[data-theme="dark"] #imagePreview .thumb {
    background: #0f1621 !important;
    border-color: #233044 !important;
}

[data-theme="dark"] #imagePreview .thumb .x {
    background: #1a2332 !important;
    border-color: #233044 !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] #imagePreview .thumb .x:hover {
    background: #f87171 !important;
    border-color: #f87171 !important;
    color: #fff !important;
}

/* Esewa section */
[data-theme="dark"] .esewa-logo-box {
    background: transparent !important;
}

[data-theme="dark"] .esewa-logo-img {
    filter: brightness(1.1);
}

[data-theme="dark"] .info-warning {
    background: rgba(251, 191, 36, 0.08) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

[data-theme="dark"] .info-warning i {
    color: #fbbf24 !important;
}

/* Buttons */
[data-theme="dark"] .btn-confirm,
[data-theme="dark"] .btn-esewa {
    background: #0c6047 !important;
    color: #fff !important;
}

[data-theme="dark"] .btn-confirm:hover,
[data-theme="dark"] .btn-esewa:hover {
    background: #0a5038 !important;
}

[data-theme="dark"] .btn-confirm:active,
[data-theme="dark"] .btn-esewa:active {
    background: #094230 !important;
}

/* Modal overlay */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Safe area inset */
[data-theme="dark"] body::before {
    background: #0c6047 !important;
}

/* ========== GLOBAL FIXES FOR ALL PAGES ========== */

/* Ensure all modals have consistent dark styling */
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.8 !important;
}

[data-theme="dark"] .btn-close:hover {
    opacity: 1 !important;
}

/* Scrollbar consistency */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0b1118 !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #233044 !important;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #2d4161 !important;
}

/* Focus states */
[data-theme="dark"] *:focus-visible {
    outline: 2px solid rgba(26, 177, 137, 0.5) !important;
    outline-offset: 2px;
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease,
        border-color 0.2s ease, box-shadow 0.2s ease !important;
}
/* Amount summary card */
[data-theme="dark"] .amount-card {
    background: #0f1621 !important;
    border: 1px solid #1e2838 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .amount-row {
    border-bottom-color: #233044 !important;
}

[data-theme="dark"] .amount-row:first-child {
    background: #0f1621 !important;
    border-bottom: 1px dashed #233044 !important;
}

[data-theme="dark"] .amount-row-total {
    background: #0b5db8 !important;
}

[data-theme="dark"] .amount-label {
    color: #98a2b3 !important;
}

[data-theme="dark"] .amount-value {
    color: #e5e7eb !important;
}

[data-theme="dark"] .amount-row-total .amount-label,
[data-theme="dark"] .amount-row-total .amount-value {
    color: #ffffff !important;
}
/* ========== FILTER MODAL BUTTONS DARK THEME FIX ========== */

/* Apply button - force green background in dark mode */
[data-theme="dark"] #apply-filter,
[data-theme="dark"] .header-btn[style*="background: #1ab189"],
[data-theme="dark"] .header-btn[style*="background:#1ab189"] {
    background: #0c6047 !important;
    color: #fff !important;
    border: 0 !important;
}

[data-theme="dark"] #apply-filter:hover,
[data-theme="dark"] .header-btn[style*="background: #1ab189"]:hover,
[data-theme="dark"] .header-btn[style*="background:#1ab189"]:hover {
    background: #0a5038 !important;
}

/* Cancel button - force dark background in dark mode */
[data-theme="dark"] #cancel-filter,
[data-theme="dark"] .header-btn[style*="background: #e5e7eb"],
[data-theme="dark"] .header-btn[style*="background:#e5e7eb"] {
    background: #1a2332 !important;
    color: #e5e7eb !important;
    border: 1.5px solid #233044 !important;
}

[data-theme="dark"] #cancel-filter:hover,
[data-theme="dark"] .header-btn[style*="background: #e5e7eb"]:hover,
[data-theme="dark"] .header-btn[style*="background:#e5e7eb"]:hover {
    background: #233044 !important;
}

/* Additional specificity for modal button row */
[data-theme="dark"] .modal-button-row .header-btn[style] {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}
/* ========== PROFILE.HTML SUBSCRIPTION CARD DARK THEME FIX ========== */

/* Lifetime subscription card - orange/brown tint for dark mode */
[data-theme="dark"] .sub-card.lifetime {
    background: rgba(246, 145, 14, 0.08) !important;
    border-color: rgba(246, 145, 14, 0.25) !important;
}

/* Lifetime subscription label text and icon */
[data-theme="dark"] .sub-card.lifetime .sub-label {
    color: #fb923c !important;
}

[data-theme="dark"] .sub-card.lifetime .sub-label i {
    color: #fb923c !important;
}

/* Lifetime subscription name text */
[data-theme="dark"] .sub-card.lifetime .sub-name {
    color: #fb923c !important;
}

/* Lifetime subscription price */
[data-theme="dark"] .sub-card.lifetime .sub-price {
    color: #fb923c !important;
}

/* Regular (non-lifetime) subscription card - green tint */
[data-theme="dark"] .sub-card:not(.lifetime) {
    background: rgba(26, 177, 137, 0.08) !important;
    border-color: rgba(26, 177, 137, 0.25) !important;
}

[data-theme="dark"] .sub-card:not(.lifetime) .sub-label {
    color: #34d399 !important;
}

[data-theme="dark"] .sub-card:not(.lifetime) .sub-label i {
    color: #34d399 !important;
}

[data-theme="dark"] .sub-card:not(.lifetime) .sub-name {
    color: #34d399 !important;
}

[data-theme="dark"] .sub-card:not(.lifetime) .sub-price {
    color: #34d399 !important;
}

/* Active tag for both types */
[data-theme="dark"] .sub-tag {
    background: rgba(26, 177, 137, 0.12) !important;
    border-color: rgba(26, 177, 137, 0.3) !important;
    color: #34d399 !important;
}

/* Helper text below subscription card */
[data-theme="dark"] .sub-helper {
    color: #98a2b3 !important;
}