/* Superfícies, campos, estados e gráficos compartilham a mesma paleta escura. */
html[data-theme=dark]{color-scheme:dark;--bg:#0f1625;--ink:#e6edf8;--muted:#a9b6cc;--line:#2b3a52;--soft:#273356;--blue:#a1b1ff;--navy:#172840;--navy-dark:#101c30;--green:#85d6b2;--red:#ffadba;--amber:#f1ca83;--theme-surface:#192337;--theme-inset:#141e30;background:var(--bg)}
html[data-theme=dark] :is(.topbar,.panel,.kpi,.pipeline-summary,.after-summary,.lead-metrics button,.deal-card,.card-open,.focus-card,dialog,.dialog-head,.close,.login-choice,.btn,.task-check,.table-open){background:var(--theme-surface);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(.demo-bar,.column,.segmented,.section-footer,.bar-track,.detail-summary,.commercial-summary,.form-footer,.drag-handle,.rule-flow,.priority-row,.priority-more,.forecast-strip,.summary-pending,.delivery-status){background:var(--theme-inset);border-color:var(--line);color:var(--muted)}
html[data-theme=dark] :is(.field input,.field select,.field textarea,.toolbar select,.priorities select,.saved-view-bar select,.heading-actions input,.search,.search input){background:var(--theme-inset);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(.field label,.field-label,.breadcrumb b,.panel h2,.growth-card h2,.after-card h2,.after-values strong,.after-dates dd,.rule-flow>strong,.deal-card .value,.pipeline-summary b,.chart-legend li b,.forecast-strip strong,.goal-grid p b,.detail-summary .values strong,.lead-metrics strong){color:var(--ink)}
html[data-theme=dark] :is(.kpi-top,.kpi small,.panel-header p,.section-footer,.eyebrow,.overline,.bar-name,.chart-legend li,.data-table th,.data-table small,.deal-card .company,.column-summary,.column-summary span,.deal-card .next-action,.card-reference,.forecast-strip p,.forecast-strip small,.donut-label span,.close-zone small,.drag-handle,.priority-row small,.growth-card p,.after-card>p,.growth-card-footer,.rule-flow>span,.rule-flow>small,.after-values,.after-dates dt,.after-notes p,.after-company-row small,.detail-text,.commercial-summary small,.detail-dl dd small,.table-scroll-note,.score-explainer,.goal-label,.goal-grid p,.history-legend,.report-row small,.template-picker>p,.after-summary,.value small,.attachment-name,.filter-note){color:var(--muted)}
html[data-theme=dark] :is(.data-table th,.data-table tbody tr:hover,.btn:hover,.close:hover,.focus-card:hover,.priority-row:hover,.table-open:hover,.login-choice:hover){background:#22304a;border-color:#405570}
html[data-theme=dark] :is(.task-row,.data-table td,.dialog-head,.detail-section,.deal-card .card-bottom,.drag-handle,.after-options,.after-notes,.after-company-row,.table-scroll-note,.priority-more){border-color:var(--line)}
html[data-theme=dark] :is(.tag,.avatar,.kpi-icon,.growth-symbol,.priority-symbol,.company-avatar,.column-heading span,.task-meta .avatar,.deal-card .avatar){background:#283650;color:#c2cdff}
html[data-theme=dark] .tag.blue{background:#28365b;color:#c1cdff}html[data-theme=dark] .tag.green{background:#183d36;color:#a1e4c6}html[data-theme=dark] .tag.amber{background:#413522;color:#f1cf93}html[data-theme=dark] .tag.red{background:#492937;color:#ffb3c1}
html[data-theme=dark] :is(.overdue-text,.deal-card .next-action.overdue,.after-dates .overdue-text){color:var(--red)}
html[data-theme=dark] :is(.notice,.delivery-status){background:#22304a;border-color:#3b4c71;color:#c5d4f0!important}
html[data-theme=dark] :is(.notice.amber,.summary-pending){background:#3a3022;border-color:#5c4b30;color:#efd2a0}html[data-theme=dark] :is(.summary-pending strong,.summary-pending p){color:#efd2a0}
html[data-theme=dark] :is(.form-error,.import-row.invalid){background:#452733;color:#ffb3c1}html[data-theme=dark] .import-row.duplicate{background:#3a3022}
html[data-theme=dark] .btn.primary,html[data-theme=dark] .btn.blue{background:#879bf5;border-color:#879bf5;color:#101a30}html[data-theme=dark] .btn.primary:hover{background:#a6b6ff;border-color:#a6b6ff}
html[data-theme=dark] .btn.ghost{background:transparent;border-color:transparent;color:#bbc9ff}html[data-theme=dark] .btn.danger{color:var(--red)}html[data-theme=dark] .text-button:hover{color:var(--blue)}
html[data-theme=dark] .segmented button.active{background:#354361;color:#d3dcff}html[data-theme=dark] .progress{background:#2c3a53}html[data-theme=dark] .donut .ring-base{stroke:#2c3a53}
html[data-theme=dark] .close-zone{background:#19322d;border-color:#396556;color:#b0dfca}html[data-theme=dark] .close-zone.lost{background:#392631;border-color:#74435b;color:#eab2c9}
html[data-theme=dark] .drop-over{background:#304267!important;border-color:#a1b1ff!important}html[data-theme=dark] .task-check.done{background:#183d36;color:#a1e4c6}html[data-theme=dark] .lead-metrics button.selected{background:#273356;border-color:#879bf5}
html[data-theme=dark] .timeline-entry:before{border-color:var(--theme-surface)}html[data-theme=dark] .timeline{border-color:var(--line)}html[data-theme=dark] .lead-navigation .segmented span{background:#354361}html[data-theme=dark] .growth-symbol{color:#c2cdff}
html[data-theme=dark] .toast{background:#30456f;color:#f2f6ff}html[data-theme=dark] .toast.error{background:#713e53}html[data-theme=dark] .welcome .btn.primary{background:#e4eaff;color:#243660;border-color:#e4eaff}html[data-theme=dark] .welcome .btn.welcome-link{background:transparent;color:#dde1ff}
html[data-theme=dark] .routine-tabs button.active{background:#273356;color:#d3dcff}html[data-theme=dark] .theme-picker select{color:var(--ink)}html[data-theme=dark] .board-scroll{scrollbar-color:#405570 transparent}
@media(max-width:640px){html[data-theme=dark] .sidebar{background:#192337;border-color:var(--line)}html[data-theme=dark] .nav-btn{color:var(--muted)}html[data-theme=dark] .nav-btn.active,html[data-theme=dark] .nav-btn.active:hover{background:#273356;color:#d3dcff;box-shadow:inset 0 2px #a1b1ff}html[data-theme=dark] .nav-btn.active .icon{color:#d3dcff}}

html[data-theme=dark] :is(.after-summary b,.goal-label strong){color:var(--blue)}
html[data-theme=dark] .routine-row .tag.blue{color:#c1cdff}
@media(max-width:640px){html[data-theme=dark] .nav-btn:hover{background:#243552;color:var(--ink)}}
