/* Dunkelmodus: Farben kommen aus tokens.css ([data-theme="dark"]). Diese Datei enthält nur noch
   komponentenspezifische Dunkel-Ausnahmen; Legacy-Variablen sind Aliase auf Tokens. */

html[data-theme="dark"] body {
  background: var(--bg-canvas);
  background-repeat: no-repeat;
  color: var(--text-primary);
}

html[data-theme="dark"] #app-boot-screen{
  background: var(--bg-canvas);
}

html[data-theme="dark"] :is( #app-boot-screen img){
  filter: brightness(0) invert(1) !important;
}

html[data-theme="dark"] :is(.card,.panel,.current-item,.setting-group,.year-total,.month-detail-kpis article,.month-breakdown-list article,.video-list-item,.kpi-card,.inventory-metric-card,.stat-comparison-card,.account-statistics-list article,.time-series-chart,.trend-tooltip,.trend-profile-picker,.production-video-list-item,.production-nas-item,.production-detail-block,.production-final-content-card,.production-workflow-panel,.production-drive-file-item,.social-production-candidate,.employee-workspace-account,.linked-production-content-card){
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}

html[data-theme="dark"] .panel {
  background: var(--bg-surface);
  box-shadow: none;
}

html[data-theme="dark"] :is(.video-list-item, .compact-video) {
  background: var(--bg-surface) !important;
  border-color: var(--border-default) !important;
  color: var(--text-primary);
}

html[data-theme="dark"] .video-list-item:is(a, [role="button"]):hover {
  background: var(--bg-surface-2) !important;
  border-color: color-mix(in srgb,var(--brand-primary) 35%,transparent) !important;
}

html[data-theme="dark"] :is(.video-detail-page-panel){
  background: var(--bg-surface);
}

html[data-theme="dark"] :is(select:where(:not([class*="sw-"],.shell-search *,.sw-pager *)),textarea:where(:not([class*="sw-"])),input:not([type="checkbox"]):not([type="radio"]):where(:not([class*="sw-"],.shell-search *)),.setting-field input,.setting-field select,.production-form input,.production-form select,.production-form textarea,.video-search-filter input){
  background: var(--bg-surface);
  border-color: color-mix(in srgb,var(--status-info) 35%,transparent);
  color: var(--text-primary);
}

html[data-theme="dark"] :is(input, textarea)::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

html[data-theme="dark"] select:not([class*="sw-"]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px !important;
  background-image:var(--status-info);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

html[data-theme="dark"] :is(.nav-button,.metadata-edit,.video-details-button){
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

html[data-theme="dark"] :is(.nav-button,.metadata-edit,.video-details-button):hover{
  background: var(--bg-surface-2);
}

html[data-theme="dark"] :is(.production-progress-track){
  background: var(--bg-surface-2);
}

html[data-theme="dark"] :is(.trend-grid-line, .trend-series-grid) {
  stroke: var(--border-strong);
}

html[data-theme="dark"] :is(.trend-axis-label, .trend-series-label) {
  fill: var(--text-secondary);
}

html[data-theme="dark"] :is(.trend-dot, .trend-series-dot) {
  fill: var(--bg-surface);
}

html[data-theme="dark"] :is(.production-asset-cover, .production-drive-file-cover, .video-thumb-placeholder) {
  background:var(--bg-surface-2);
}

html[data-theme="dark"] .production-asset-cover.production-cover-idea {
  background:var(--status-warning-soft);
  color: var(--status-warning);
}

html[data-theme="dark"] .production-asset-cover.production-cover-raw-folder {
  background:var(--bg-surface-2);
  color: var(--status-info);
}

html[data-theme="dark"] :is(.production-drive-file-item){
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-primary);
}

html[data-theme="dark"] :is(.production-upload-code,.production-nas-waiting){
  background: var(--bg-surface-2);
  border-color: var(--border-default);
}

html[data-theme="dark"] :is(.deadline-notice,.production-raw-access-note,.production-review-without-raw){
  background: var(--status-warning-soft);
  border-color: color-mix(in srgb,var(--status-warning) 35%,transparent);
  color: var(--status-warning);
}

html[data-theme="dark"] :is(.deadline-notice.has-overdue,.production-rejection-alert,.production-assignment-warning){
  background: var(--status-danger-soft);
  border-color: color-mix(in srgb,var(--status-danger) 35%,transparent);
}

html[data-theme="dark"] .production-review-alert-count{
  color: var(--status-danger) !important;
}

html[data-theme="dark"] :is(.deadline-notice.has-release,.account-statistics-list .account-statistics-total){
  background: var(--status-success-soft);
  border-color: color-mix(in srgb,var(--status-success) 35%,transparent);
  color: var(--status-success);
}

html[data-theme="dark"] :is(.asset-status-awaiting-edit, .posting-check.neutral) {
  background: var(--bg-surface-2);
  color: var(--status-info);
}

html[data-theme="dark"] :is(.asset-status-editing){
  background: var(--status-warning-soft);
  color: var(--status-warning);
}

html[data-theme="dark"] .asset-status-review {
  background: var(--brand-soft);
  color: var(--brand-soft-text);
}

html[data-theme="dark"] :is(.asset-status-rejected, .production-assignment-badge) {
  background: var(--status-danger-soft);
  color: var(--status-danger);
}

html[data-theme="dark"] :is(.asset-status-approved){
  background: var(--status-success-soft);
  color: var(--status-success);
}

html[data-theme="dark"] .asset-status-posted {
  background: var(--bg-surface-2);
  color: var(--status-info);
}

html[data-theme="dark"] :is(.account-statistics-list a,.linked-production-content-card){
  color: var(--text-primary);
}

html[data-theme="dark"] ::selection {
  background: color-mix(in srgb,var(--brand-primary) 33%,transparent);
  color: var(--text-primary);
}

html[data-theme="dark"] * {
  scrollbar-color: var(--border-strong) var(--bg-surface);
}

/* Production/content cards must stay dark; only semantic success states use green. */
html[data-theme="dark"] :is(.production-final-content-card,.production-workflow-panel,.production-nas-item){
  background: var(--bg-surface) !important;
  color: var(--text-primary);
  border-color: var(--border-default) !important;
}
html[data-theme="dark"] :is(.production-nas-assigned){
  background: var(--bg-surface-2) !important;
  border-color: var(--border-default) !important;
}
html[data-theme="dark"] :is(.production-review-without-raw,.production-assignment-warning){
  background: var(--status-danger-soft) !important;
  border-color: color-mix(in srgb,var(--status-danger) 35%,transparent) !important;
  color: var(--status-danger);
}
html[data-theme="dark"] :is(.production-raw-access-note, .production-review-without-raw) {
  background: var(--status-warning-soft) !important;
  border-color: color-mix(in srgb,var(--status-warning) 35%,transparent) !important;
  color: var(--status-warning);
}

html[data-theme="dark"] :is(a.production-video-list-item,a.employee-workspace-account,a.account-operation-item,.production-nas-item-head > a):hover{
  background: var(--bg-surface-2) !important;
  border-color: color-mix(in srgb,var(--brand-primary) 35%,transparent) !important;
  color: var(--text-primary) !important;
}

/* Neutral information is always dark. Green is reserved for compact success badges. */
html[data-theme="dark"] :is(.alltime-milestone,.milestone-card,.period-comparisons article,.period-card,.account-kpis article,.account-statistics-list .account-statistics-total,.inventory-metric-card,.stat-comparison-card,.month-detail-kpis article,.month-breakdown-list article,.time-series-chart,.trend-tooltip,.trend-profile-picker,.trend-comparison-legend > span,.setting-group,.year-total,.account-social-profile,.video-details-button,.metadata-edit,.video-metric-grid > div,.video-detail-metrics > div,.video-milestone){
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-default) !important;
}

html[data-theme="dark"] :is(.posting-recommendation-warning, .account-next-posting-warning) {
  background: var(--status-warning-soft) !important;
  border-color: color-mix(in srgb,var(--status-warning) 35%,transparent) !important;
  color: var(--status-warning) !important;
}

html[data-theme="dark"] .posting-recommendation-unavailable {
  background:var(--bg-surface-2);
  border-color: color-mix(in srgb,var(--status-warning) 35%,transparent) !important;
}

html[data-theme="dark"] .posting-recommendation-unavailable .posting-priority {
  background: var(--status-warning-soft) !important;
  color: var(--status-warning) !important;
}

html[data-theme="dark"] .posting-day-header{
  background: var(--bg-surface);
  border-color: color-mix(in srgb,var(--status-info) 35%,transparent);
}

html[data-theme="dark"] .posting-day-section.is-today .posting-day-header {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--brand-primary) 18%,transparent);
}

html[data-theme="dark"] .posting-video-cover-empty{
  background: var(--status-warning-soft);
  border-color: color-mix(in srgb,var(--status-warning) 35%,transparent);
  color: var(--status-warning);
}

html[data-theme="dark"] :is(.floating-filter-form select, .floating-filter-form input) {
  background-color: var(--bg-surface);
  border-color: color-mix(in srgb,var(--status-info) 35%,transparent);
  color: var(--text-primary);
}

html[data-theme="dark"] .floating-filter-popover {
  background: var(--bg-surface);
  border-color: color-mix(in srgb,var(--status-info) 35%,transparent);
}

html[data-theme="dark"] .floating-filter-close {
  background: var(--bg-surface-2);
  border-color: color-mix(in srgb,var(--status-info) 35%,transparent);
  color: var(--text-primary);
}

html[data-theme="dark"] .floating-filter-trigger {
  background: var(--status-info);
  color: var(--text-on-inverse);
}

html[data-theme="dark"] :is(.posting-actual-action-internal, .posting-actual-actions .video-details-link) {
  background: var(--bg-surface-2);
  border-color: color-mix(in srgb,var(--brand-primary) 35%,transparent);
  color: var(--brand-soft-text);
}

html[data-theme="dark"] :is(.alltime-milestone, .milestone-card, .period-comparisons article, .video-metric-grid > div, .video-detail-metrics > div) {
  background: var(--bg-surface-2) !important;
}

html[data-theme="dark"] :is(.employee-workspace-accounts article){
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-default) !important;
}

html[data-theme="dark"] :is(.production-upload-code,.production-nas-waiting,.production-nas-assigned){
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-default) !important;
}
html[data-theme="dark"] .posting-assignment-choice label,html[data-theme="dark"] .posting-assignment-confirm{border-color:var(--border-default)!important;background:var(--bg-surface)!important;color:var(--text-primary)!important}html[data-theme="dark"] .posting-assignment-choice label:has(input:checked),html[data-theme="dark"] .posting-assignment-confirm:has(input:checked){border-color:var(--brand-primary)!important;background:var(--brand-soft)!important}html[data-theme="dark"] .posting-day-complete{border-color:color-mix(in srgb,var(--status-success) 35%,transparent)!important;background:var(--status-success-soft)!important;color:var(--status-success)!important}
html[data-theme="dark"] .posting-actual-card{border-color:color-mix(in srgb,var(--status-success) 35%,transparent)!important;background:var(--status-success-soft)!important}html[data-theme="dark"] .posting-actual-card-unlinked{border-color:color-mix(in srgb,var(--status-warning) 35%,transparent)!important;background:var(--status-warning-soft)!important}html[data-theme="dark"] .posting-actual-copy h3{color:var(--text-primary)!important}html[data-theme="dark"] .posting-actual-linked{background:var(--status-success-soft)!important;color:var(--status-success)!important}html[data-theme="dark"] .posting-actual-unlinked{background:var(--status-warning-soft)!important;color:var(--status-warning)!important}
html[data-theme="dark"] .posting-actual-workflow-steps li.is-complete .posts-step-icon{border-color:color-mix(in srgb,var(--status-success) 35%,transparent);background:var(--status-success-soft);color:var(--status-success)}html[data-theme="dark"] .posting-actual-workflow-steps .posts-step-icon{background:var(--bg-surface);color:var(--text-secondary)}
html[data-theme="dark"] .posting-assignment-step{background:var(--bg-surface);border-color:var(--border-default)}

html[data-theme="dark"] .posts-correction { background: var(--status-warning-soft); color: var(--status-warning); border-color: color-mix(in srgb,var(--status-warning) 35%,transparent); }
html[data-theme="dark"] .posts-progress__doc li.is-complete span { background: var(--status-success-soft); color: var(--status-success); border-color: color-mix(in srgb,var(--status-success) 35%,transparent); }
html[data-theme="dark"] .posts-historical-approval { background: var(--status-success-soft); color: var(--status-success); border-color: color-mix(in srgb,var(--status-success) 35%,transparent); }

html[data-theme="dark"] .posts-published-video-detail,
html[data-theme="dark"] .posts-canonical-asset .production-removed-post-form { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-default); }
html[data-theme="dark"] .posts-publication-plan.is-scheduled { background:var(--status-success-soft); border-color:color-mix(in srgb,var(--status-success) 35%,transparent); color:var(--text-primary); }
html[data-theme="dark"] .posts-publication-plan.is-scheduled .posts-publication-plan-icon { background:var(--status-success-soft); color:var(--status-success); }
html[data-theme="dark"] .posts-publication-plan.is-scheduled .posts-publication-plan-copy strong { color:var(--status-success); }
html[data-theme="dark"] .posts-workflow-stat { background:var(--bg-surface); color:var(--text-primary); border-color:var(--border-default); }
html[data-theme="dark"] .posts-workflow-stat.is-active { background:var(--brand-soft); border-color:var(--brand-primary); box-shadow:none; }
html[data-theme="dark"] a.posts-workflow-stat:is(:hover,:focus-visible) { background:var(--brand-soft); border-color:var(--brand-primary); }
html[data-theme="dark"] .posts-workflow-stat[data-posts-workflow-step="material"] strong { color:var(--status-success); }
html[data-theme="dark"] .posts-workflow-stat[data-posts-workflow-step="final"] strong { color:var(--status-warning); }
html[data-theme="dark"] .posts-workflow-stat[data-posts-workflow-step="review"] strong { color:var(--status-danger); }
html[data-theme="dark"] .posts-workflow-stat[data-posts-workflow-step="publication"] strong { color:var(--status-success); }
html[data-theme="dark"] .production-assets-batch-toolbar { border-color:var(--border-default); background:color-mix(in srgb,var(--bg-surface-2) 72%,transparent); }
html[data-theme="dark"] .production-assets-batch-action { border-color:var(--border-default); background:var(--bg-surface); }
html[data-theme="dark"] :is(.posts-final-detection,.posts-final-suggestion,.posts-attachable-confirm) { background:var(--bg-surface); color:var(--text-primary); border-color:var(--border-default); }
html[data-theme="dark"] .posts-resource-report { background:var(--bg-surface); color:var(--text-primary); border-color:var(--border-default); }
html[data-theme="dark"] .posts-resource-report li { background:var(--bg-surface); border-color:var(--border-default); }
html[data-theme="dark"] .posts-resource-report li.is-ok small { color:var(--status-success); }
html[data-theme="dark"] .posts-resource-report li.is-missing small { color:var(--status-danger); }
html[data-theme="dark"] .posts-danger-action { border-color:color-mix(in srgb,var(--status-danger) 35%,transparent); background:var(--status-danger-soft); color:var(--status-danger); }
html[data-theme="dark"] .posts-danger-action:hover { border-color:var(--status-danger); background:var(--status-danger-soft); color:var(--status-danger); }
html[data-theme="dark"] .posts-customer-approval { background:var(--status-success-soft); border-color:color-mix(in srgb,var(--status-success) 35%,transparent); box-shadow:none; color:var(--text-primary); }
html[data-theme="dark"] .posts-customer-approval :is(h3,dd) { color:var(--text-primary); }
html[data-theme="dark"] .posts-customer-approval :is(.posts-customer-approval-kicker,dt) { color:var(--status-success); }
html[data-theme="dark"] .posts-withdraw-approval { border-color:color-mix(in srgb,var(--status-danger) 35%,transparent)!important; background:var(--status-danger-soft)!important; color:var(--status-danger)!important; }
html[data-theme="dark"] .posts-withdraw-approval:hover { border-color:var(--status-danger)!important; background:var(--status-danger-soft)!important; color:var(--status-danger)!important; }
html[data-theme="dark"] :is(.posting-actual-metrics>div,.posting-day-performance dl>div,.floating-filter-form .floating-filter-option) { border-color:var(--border-default); background:var(--bg-surface); color:var(--text-primary); }
html[data-theme="dark"] .floating-filter-form .floating-filter-option:has(input:checked) { border-color:var(--brand-primary); background:var(--brand-soft); }
html[data-theme="dark"] .posting-day-performance dd small { color:var(--status-warning); }

/* Keep inline comparison SVG labels legible without changing exported reports. */
html[data-theme="dark"] .statistics-period-comparison-chart :is(.comparison-legend, .comparison-value) {
  fill: var(--text-primary);
}
html[data-theme="dark"] .statistics-period-comparison-chart .comparison-axis {
  fill: var(--text-secondary);
}
html[data-theme="dark"] .statistics-period-comparison-chart .comparison-delta-positive {
  fill: var(--text-brand);
}
html[data-theme="dark"] .statistics-period-comparison-chart .comparison-delta-negative {
  fill: var(--status-danger);
}
html[data-theme="dark"] .statistics-period-comparison-chart .comparison-delta-neutral {
  fill: var(--text-secondary);
}

html[data-theme="dark"] :is(.statistics-scope-summary span){
  border-color: var(--border-default);
}

html[data-theme="dark"] .customer-review-auto-note {
  background: var(--bg-surface-2);
  border-left-color: var(--brand-primary);
  color: var(--text-primary);
}

html[data-theme="dark"] .customer-review-auto-approve {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}
