/* Mistone Gece: presentation only. Dates, quantities, balances and chart geometry stay server-calculated.
   Limit this palette to screens; invoice documents and printed reports retain their own light presentation. */
@media screen and (forced-colors: none) {
    html[data-theme="dark"] :is(.cash-dashboard, .cash-planning, .financial-position) {
        --finance-surface: #1b2921;
        --finance-raised: #223329;
        --finance-soft: #18251e;
        --finance-line: #34483b;
        --finance-text: #e3ece5;
        --finance-muted: #a4b5a8;
        --finance-accent: #91b79c;
        --finance-receipt: #79c6a0;
        --finance-receipt-bg: #203c2e;
        --finance-payment: #ef8790;
        --finance-payment-bg: #3d272d;
        --finance-cheque: #d9b976;
        --finance-cheque-bg: #393322;
        color: var(--finance-text);
    }

    /* Dashboard cards, periods and the operation timeline. */
    html[data-theme="dark"] .dashboard-daily-actions a,
    html[data-theme="dark"] .cash-dashboard :is(.cash-kpi, .cash-plan-card, .cash-mini-card, .dashboard-currency) {
        color: var(--finance-text, #e3ece5);
        background: var(--finance-surface, #1b2921);
        border-color: var(--finance-line, #34483b);
        box-shadow: none;
    }
    html[data-theme="dark"] .dashboard-daily-actions a:hover {
        background: #223329;
        border-color: #73937d;
    }
    html[data-theme="dark"] .dashboard-daily-actions :is(small, .daily-action-icon) {
        color: #a4b5a8;
    }
    html[data-theme="dark"] .dashboard-daily-actions .daily-action-icon {
        color: #91b79c;
        background: #223329;
    }
    html[data-theme="dark"] :is(.cash-dashboard-header p, .cash-dashboard-note),
    html[data-theme="dark"] .cash-dashboard :is(
        .kpi-label, .kpi-caption, .kpi-value small, .cash-section-header p, .cash-period,
        .timeline-operation > span, .timeline-operation small, .cash-legend, .cash-empty,
        .cash-plan-empty, .cash-section-kicker, .cash-period-caption, .cash-readiness,
        .country-key > *, .country-value, .country-center span, .upcoming-date,
        .upcoming-copy, .upcoming-copy small, .upcoming-value small, .cash-plan-tools,
        .cash-position-event-legend, .cash-position-event-legend small,
        .cash-position-heading p, .cash-position h3 span, .cash-position-estimate,
        .cash-position-axis > span, .cash-position-month-label, .cash-position-months > div > span,
        .cash-position-milestone > span, .cash-position-method, .cash-position-details,
        .cash-position-details caption, .cash-position-event-entry span, .cash-position-empty p
    ) {
        color: var(--finance-muted);
    }
    html[data-theme="dark"] .cash-dashboard :is(
        .kpi-value, .timeline-operation strong, .country-key strong, .country-center strong,
        .upcoming-copy strong, .upcoming-date strong, .upcoming-value, .cash-empty strong,
        .cash-plan-empty strong, .cash-position h3, .cash-position-event-panel h4,
        .cash-position-milestone > strong
    ) {
        color: var(--finance-text);
    }
    html[data-theme="dark"] .cash-dashboard .cash-section-link,
    html[data-theme="dark"] .cash-dashboard .cash-position-event-entry a {
        color: var(--finance-accent);
    }
    html[data-theme="dark"] .cash-dashboard :is(
        .cash-period, .cash-timeline, .timeline-operation, .timeline-track, .timeline-grid-line,
        .cash-upcoming-row, .cash-position, .cash-position-axis, .cash-position-months,
        .cash-position-months > div > span, .cash-position-milestones,
        .cash-position-event-entry, .cash-position-details th, .cash-position-details td
    ) {
        border-color: var(--finance-line);
    }
    html[data-theme="dark"] .cash-dashboard :is(.timeline-periods, .timeline-operation-heading, .cash-position-details th) {
        color: var(--finance-muted);
        background: var(--finance-soft);
        border-color: var(--finance-line);
    }
    html[data-theme="dark"] .cash-dashboard .timeline-periods > * {
        color: var(--finance-muted);
        border-color: var(--finance-line);
    }
    html[data-theme="dark"] .cash-dashboard .timeline-event {
        color: var(--finance-receipt);
        background: var(--finance-receipt-bg);
        border-color: var(--finance-receipt);
    }
    html[data-theme="dark"] .cash-dashboard .timeline-event.is-outgoing {
        color: var(--finance-payment);
        background: var(--finance-payment-bg);
        border-color: var(--finance-payment);
    }
    html[data-theme="dark"] .cash-dashboard .timeline-event.is-cheque {
        color: var(--finance-cheque);
        background: var(--finance-cheque-bg);
        border-color: var(--finance-cheque);
    }
    html[data-theme="dark"] .cash-dashboard .timeline-event.is-unconfirmed {
        color: var(--finance-muted);
        background: #2b3530;
        border-color: #889b8e;
    }
    html[data-theme="dark"] .cash-dashboard .cash-today-line { border-color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-today-line small { color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-flow-dot { background: var(--finance-receipt); }
    html[data-theme="dark"] .cash-dashboard .cash-flow-dot.outgoing { background: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-flow-dot.cheque { background: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .cash-flow-tag { color: var(--finance-receipt); }
    html[data-theme="dark"] .cash-dashboard .cash-flow-tag.outgoing { color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-flow-tag.cheque { color: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .kpi-icon { color: var(--finance-accent); background: var(--finance-receipt-bg); }
    html[data-theme="dark"] .cash-dashboard .cash-kpi[data-tone="outgoing"] .kpi-icon { color: var(--finance-payment); background: var(--finance-payment-bg); }
    html[data-theme="dark"] .cash-dashboard .cash-kpi[data-tone="risk"] .kpi-icon { color: var(--finance-cheque); background: var(--finance-cheque-bg); }
    html[data-theme="dark"] .cash-dashboard :is(.cash-kpi[data-tone="risk"], .cash-kpi.is-risk, .cash-kpi.is-negative) .kpi-value { color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .country-color-0 { --country-color: #79c6a0; }
    html[data-theme="dark"] .cash-dashboard .country-color-1 { --country-color: #91b79c; }
    html[data-theme="dark"] .cash-dashboard .country-color-2 { --country-color: #d9b976; }
    html[data-theme="dark"] .cash-dashboard .country-color-3 { --country-color: #9babcf; }
    html[data-theme="dark"] .cash-dashboard .cash-country-code { color: var(--finance-muted); border-color: var(--finance-line); }
    html[data-theme="dark"] .cash-dashboard .cash-country-flag { border-color: var(--finance-line); }

    /* USD/TL and viewport controls use a dark-text sage selected state. */
    html[data-theme="dark"] .cash-dashboard .dashboard-currency button,
    html[data-theme="dark"] :is(.cash-viewport-caption, .cash-viewport-start, .cash-viewport-controls legend) { color: #a4b5a8; }
    html[data-theme="dark"] .cash-dashboard .dashboard-currency button[aria-pressed="true"],
    html[data-theme="dark"] .cash-viewport-options button.is-selected {
        color: #101814;
        background: #91b79c;
    }
    html[data-theme="dark"] :is(.cash-viewport-options, .cash-viewport-start input),
    html[data-theme="dark"] .cash-dashboard .cash-plan-tools select {
        color: #e3ece5;
        background: #223329;
        border-color: #34483b;
    }
    html[data-theme="dark"] .cash-viewport-options button { color: #a4b5a8; }
    html[data-theme="dark"] .cash-viewport-options button:hover:not(.is-selected) { color: #e3ece5; background: #304638; }
    html[data-theme="dark"] :is(.cash-viewport-warning, .cash-viewport-status[data-state="error"]) {
        color: #d9b976;
        background: #393322;
        border-color: #635838;
    }
    html[data-theme="dark"] .cash-viewport-status,
    html[data-theme="dark"] .cash-dashboard :is(.cash-plan-readiness, .dashboard-sample-notice) {
        color: #a4b5a8;
        background: #18251e;
        border-color: #34483b;
    }
    html[data-theme="dark"] .cash-dashboard .cash-plan-readiness > strong,
    html[data-theme="dark"] .cash-dashboard .dashboard-sample-notice strong { color: var(--finance-accent); }
    html[data-theme="dark"] .dashboard-usd-quote { color: #91b79c; background: #203c2e; border-color: #3b5a46; }
    html[data-theme="dark"] .dashboard-usd-quote :is(small, .dashboard-quote-purpose) { color: #a4b5a8; }
    html[data-theme="dark"] .dashboard-usd-quote:is([data-state="last-known"], [data-state="unavailable"]) { background: #393322; border-color: #635838; }
    html[data-theme="dark"] .cash-dashboard .cash-risk-notice { color: var(--finance-cheque); background: var(--finance-cheque-bg); border-color: #635838; }
    html[data-theme="dark"] .cash-dashboard .cash-risk-notice strong { color: var(--finance-cheque); }

    /* Nakit Radarı SVG: positive, negative and reserve meanings remain distinct. */
    html[data-theme="dark"] .cash-dashboard .cash-position { background: var(--finance-surface); }
    html[data-theme="dark"] .cash-dashboard :is(.cash-position-empty, .cash-position-event-panel, .cash-position-selection) {
        color: var(--finance-text);
        background: var(--finance-soft);
        border-color: var(--finance-line);
    }
    html[data-theme="dark"] .cash-dashboard .cash-position-heading p strong { color: var(--finance-accent); }
    html[data-theme="dark"] .cash-dashboard .cash-position-estimate { border-color: var(--finance-line); }
    html[data-theme="dark"] .cash-dashboard :is(.cash-position-axis-negative, .cash-position-negative-number) { color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-position-reserve-number { color: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .cash-position-risk-zone { fill: #342329; }
    html[data-theme="dark"] .cash-dashboard .cash-position-reserve-zone { fill: #302d20; }
    html[data-theme="dark"] .cash-dashboard .cash-position-grid { stroke: #34483b; }
    html[data-theme="dark"] .cash-dashboard .cash-position-zero { stroke: #839a8b; }
    html[data-theme="dark"] .cash-dashboard .cash-position-reserve-line { stroke: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .cash-position-known-start { stroke: #8ca695; }
    html[data-theme="dark"] .cash-dashboard .cash-position-area-positive { fill: var(--finance-receipt); fill-opacity: .13; }
    html[data-theme="dark"] .cash-dashboard .cash-position-area-negative { fill: var(--finance-payment); fill-opacity: .13; }
    html[data-theme="dark"] .cash-dashboard .cash-position-area-reserve { fill: var(--finance-cheque); fill-opacity: .13; }
    html[data-theme="dark"] .cash-dashboard .cash-position-line-positive { stroke: var(--finance-receipt); }
    html[data-theme="dark"] .cash-dashboard .cash-position-line-negative { stroke: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-position-line-reserve { stroke: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .cash-position-reserve-tag { color: var(--finance-cheque); background: #302d20ed; }
    html[data-theme="dark"] .cash-dashboard .cash-position-minimum {
        background: var(--finance-receipt);
        border-color: var(--finance-surface);
        box-shadow: 0 0 0 1px var(--finance-receipt);
    }
    html[data-theme="dark"] .cash-dashboard .cash-position-minimum.is-negative { background: var(--finance-payment); box-shadow: 0 0 0 1px var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-position-minimum.is-below-reserve { background: var(--finance-cheque); box-shadow: 0 0 0 1px var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard :is(.cash-position-point, .cash-position-point.is-receipt) { color: var(--finance-receipt); }
    html[data-theme="dark"] .cash-dashboard .cash-position-point::before { border-color: var(--finance-surface); }
    html[data-theme="dark"] .cash-dashboard :is(.cash-position-point.is-payment, .cash-position-point.is-negative) { color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-position-point.is-below-reserve { color: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .cash-position-point.is-mixed { color: #b1c7bb; }
    html[data-theme="dark"] .cash-dashboard .cash-position-point.is-mixed::before { background: linear-gradient(90deg, #ef8790 50%, #79c6a0 50%); }
    html[data-theme="dark"] .cash-dashboard .cash-position-point[data-cash-event-tooltip]::after {
        color: var(--finance-text);
        background: #223329;
        border-color: #4c6555;
        box-shadow: 0 8px 25px #0005;
    }
    html[data-theme="dark"] .event-receipt-dot { background: #79c6a0; }
    html[data-theme="dark"] .event-payment-dot { background: #ef8790; }
    html[data-theme="dark"] .cash-dashboard .cash-position-milestone { border-color: var(--finance-receipt); }
    html[data-theme="dark"] .cash-dashboard .cash-position-milestone.is-negative { border-color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-position-milestone.is-below-reserve { border-color: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .cash-position-milestone.is-negative > strong { color: var(--finance-payment); }
    html[data-theme="dark"] .cash-dashboard .cash-position-milestone.is-below-reserve > strong { color: var(--finance-cheque); }
    html[data-theme="dark"] .cash-dashboard .cash-position-details tr:is([data-cash-point-selected="true"], .is-selected, [aria-selected="true"]) { background: #284332; }
    html[data-theme="dark"] .cash-dashboard .cash-position-empty details { color: var(--finance-cheque); }

    /* Financial Pusula: no palette transformation is applied to money or accounting data. */
    html[data-theme="dark"] .financial-position { background: #1b2921; border-color: #34483b; box-shadow: none; }
    html[data-theme="dark"] .financial-heading { background: linear-gradient(110deg, #223329, #1b2921); }
    html[data-theme="dark"] .financial-heading p,
    html[data-theme="dark"] .financial-position :is(
        .financial-status div > span, .financial-metrics article > span, .financial-metrics strong small,
        .financial-metrics p, .financial-row strong small, .financial-row > small,
        .financial-cheque-heading p, .financial-cheques > p, .financial-cheque-heading > strong small,
        .financial-cheque-table th, .financial-cheque-table td small, .financial-profit p,
        .financial-profit-values > span, .financial-source, .financial-fx-caption, .financial-fx-details > p
    ) { color: #a4b5a8; }
    html[data-theme="dark"] .financial-position :is(
        .financial-date, .financial-breakdown, .financial-cheque-table-wrap, .financial-cheque-table td,
        .financial-cheques, .financial-metrics article, .financial-profit-note, .financial-source,
        .financial-fx-caption, .financial-fx-details
    ) { border-color: #34483b; }
    html[data-theme="dark"] .financial-position :is(.financial-date, .financial-breakdown, .financial-cheque-table th, .financial-source, .financial-fx-caption, .financial-fx-details) {
        color: #a4b5a8;
        background: #18251e;
    }
    html[data-theme="dark"] .financial-status { background: #203026; border-color: #34483b; }
    html[data-theme="dark"] .financial-status[data-tone="negative"] { background: #3d272d; }
    html[data-theme="dark"] .financial-status-dot { background: #d9b976; box-shadow: 0 0 0 5px #d9b97620; }
    html[data-theme="dark"] .financial-status[data-tone="positive"] .financial-status-dot { background: #79c6a0; box-shadow: 0 0 0 5px #79c6a020; }
    html[data-theme="dark"] .financial-status[data-tone="negative"] .financial-status-dot { background: #ef8790; box-shadow: 0 0 0 5px #ef879020; }
    html[data-theme="dark"] .financial-metrics [data-tone="positive"] strong { color: #79c6a0; }
    html[data-theme="dark"] .financial-metrics [data-tone="negative"] strong { color: #ef8790; }
    html[data-theme="dark"] .financial-position .financial-row { color: #e3ece5; }
    html[data-theme="dark"] .financial-row:hover .financial-row-head > span { color: #91b79c; }
    html[data-theme="dark"] .financial-legend.asset { background: #79c6a0; }
    html[data-theme="dark"] .financial-legend.debt { background: #ef8790; }
    html[data-theme="dark"] .financial-bar { background: #2a4033; }
    html[data-theme="dark"] .financial-bar i { background: linear-gradient(90deg, #497d61, #79c6a0); }
    html[data-theme="dark"] .financial-bar.debt { background: #422e33; }
    html[data-theme="dark"] .financial-bar.debt i { background: linear-gradient(90deg, #8e515b, #ef8790); }
    html[data-theme="dark"] .financial-position :is(.financial-cheque-table a, .financial-profit > a, .financial-fx-details > summary) { color: #91b79c; }
    html[data-theme="dark"] .financial-profit { color: #e3ece5; background: #1c2c31; border-color: #354d54; }
    html[data-theme="dark"] .financial-profit-values strong { color: #c3dbe1; }
    html[data-theme="dark"] :is(.financial-completeness, .financial-warning) { color: #d9b976; background: #393322; border-color: #635838; }

    /* Cash planning editor, fixed expenses, loans and suitable-date results. */
    html[data-theme="dark"] .cash-planning :is(
        .cash-planning-card, .cash-event-row, .cash-scenario-results > section, .cash-loan-card
    ) { background: #1b2921; border-color: #34483b; }
    html[data-theme="dark"] .cash-planning :is(
        .cash-planning-note, .cash-planning-balance-grid fieldset, .cash-save-bar,
        .cash-loan-generator, .cash-simulation-badge, .cash-radar-range.is-unknown
    ) { color: #a4b5a8; background: #18251e; border-color: #34483b; }
    html[data-theme="dark"] .cash-planning :is(
        .cash-planning-heading p, .cash-planning-card > header > small,
        .cash-planning-card > header > a, label, .cash-field-help,
        .cash-event-row legend, .cash-event-empty, .cash-save-bar small,
        .cash-scenario-results span, .cash-scenario-results small,
        .cash-read-balances span, .cash-radar-range small, .cash-radar-disabled,
        .cash-loan-table > tbody > tr > th
    ) { color: #a4b5a8; }
    html[data-theme="dark"] .cash-planning .cash-loan-table > tbody > tr > [data-label]::before { color: #a4b5a8; }
    html[data-theme="dark"] .cash-planning :is(
        .cash-planning-note strong, .cash-planning-balance-grid legend, .cash-save-bar strong,
        .cash-scenario-results strong, .cash-read-balances strong, .cash-loan-card > legend,
        .cash-loan-generator > summary
    ) { color: #e3ece5; }
    html[data-theme="dark"] .cash-planning :is(.form-control, .form-select) {
        color: #e3ece5;
        background-color: #223329;
        border-color: #34483b;
    }
    html[data-theme="dark"] .cash-planning .form-control::placeholder { color: #9aafa0; }
    html[data-theme="dark"] .cash-planning :is(.form-control, .form-select):focus { border-color: #91b79c; box-shadow: 0 0 0 3px #91b79c26; }
    html[data-theme="dark"] .cash-planning .cash-remove { color: #ef8790 !important; }
    html[data-theme="dark"] .cash-planning :is(.cash-event-empty, .cash-recurring-row, .cash-recurring-replacement,
        .cash-loan-table > thead > tr > th, .cash-loan-table > tbody > tr > td,
        .cash-loan-table > tbody > tr > th, .cash-loan-table > tbody > tr) { border-color: #34483b; }
    html[data-theme="dark"] .cash-planning .cash-loan-table > thead > tr > th { color: #a4b5a8; background: #18251e; }
    html[data-theme="dark"] .cash-planning .cash-loan-table > tbody > tr.is-paid { background: #203026; }
    html[data-theme="dark"] .cash-planning :is(.cash-event-row.is-removed, .cash-recurring-row.is-removed, .cash-loan-card.is-removed, .cash-loan-table > tbody > tr.is-removed) { background: #3d272d; border-color: #75444e; }
    html[data-theme="dark"] .cash-planning .cash-event-row.is-removed legend { color: #ef8790; }
    html[data-theme="dark"] .cash-planning :is(.cash-step, .cash-currency-chip) { color: #91b79c; background: #284333; }
    html[data-theme="dark"] .cash-section-nav { background: #18251e; }
    html[data-theme="dark"] .cash-section-nav a { color: #a4b5a8; }
    html[data-theme="dark"] .cash-section-nav a:hover { color: #e3ece5; background: #223329; }
    html[data-theme="dark"] .cash-section-nav a.is-active { color: #101814; background: #91b79c; box-shadow: none; }
    html[data-theme="dark"] .cash-planning :is(.cash-scenario-verdict, .cash-radar-range) { color: #79c6a0; background: #203c2e; border-color: #3b6b4e; }
    html[data-theme="dark"] .cash-planning :is(.cash-scenario-verdict.is-warning, .cash-radar-range.is-watch) { color: #d9b976; background: #393322; border-color: #635838; }
    html[data-theme="dark"] .cash-planning :is(.cash-scenario-verdict.is-negative, .cash-radar-range.is-shortage) { color: #ef8790; background: #3d272d; border-color: #75444e; }
    html[data-theme="dark"] .cash-planning .cash-radar-range.is-unknown { color: #a4b5a8; border-color: #53695b; }
    html[data-theme="dark"] .cash-planning :is(.cash-planning-status, .cash-scenario-results .is-warning strong) { color: #d9b976; }
    html[data-theme="dark"] .cash-planning .cash-scenario-results .is-negative strong { color: #ef8790; }
    html[data-theme="dark"] .cash-radar-legend > span { color: #a4b5a8; background: #223329; }
    html[data-theme="dark"] .cash-radar-legend .is-safe { border-color: #79c6a0; }
    html[data-theme="dark"] .cash-radar-legend .is-watch { border-color: #d9b976; }
    html[data-theme="dark"] .cash-radar-legend .is-shortage { border-color: #ef8790; }
    html[data-theme="dark"] .cash-radar-strip { border-color: #34483b; }
    html[data-theme="dark"] .cash-radar-strip > a { color: #79c6a0; background: #203c2e; border-color: #34483b; }
    html[data-theme="dark"] .cash-radar-strip > .is-watch { color: #d9b976; background: #393322; }
    html[data-theme="dark"] .cash-radar-strip > .is-shortage { color: #ef8790; background: #3d272d; }
    html[data-theme="dark"] .cash-radar-strip > .is-unknown { color: #a4b5a8; background: #2b3530; }
    html[data-theme="dark"] .cash-radar-day { color: #79c6a0; background: #203c2e; border-color: #3b6b4e; }
    html[data-theme="dark"] .cash-radar-day.is-watch { color: #d9b976; background: #393322; border-color: #635838; }
    html[data-theme="dark"] .cash-radar-day.is-shortage { color: #ef8790; background: #3d272d; border-color: #75444e; }
    html[data-theme="dark"] .cash-radar-day.is-unknown { color: #a4b5a8; background: #2b3530; border-color: #53695b; }
}
