/* ZaPhi Manager v0.22.48 · abschließende Dark-Mode-Schicht.
   Diese Datei wird absichtlich nach allen älteren Release-Styles geladen. */
html[data-zaphi-theme="dark"]{
  color-scheme:dark;
  --v2248-page:#101419;
  --v2248-surface:#1b2229;
  --v2248-surface-2:#202830;
  --v2248-surface-3:#28323b;
  --v2248-border:#3b4651;
  --v2248-text:#edf2f6;
  --v2248-muted:#aeb8c2;
  --v2248-orange:#f47b20;
  --color-page:var(--v2248-page);
  --color-surface:var(--v2248-surface);
  --color-text:var(--v2248-text);
  --color-text-muted:var(--v2248-muted);
  --color-border:var(--v2248-border);
  --page-bg:var(--v2248-page);
  --bg:var(--v2248-page);
  --card:var(--v2248-surface);
  --ink:var(--v2248-text);
  --muted:var(--v2248-muted);
  --line:var(--v2248-border);
}

html[data-zaphi-theme="dark"] :where(body,.app,.main,.page){background-color:var(--v2248-page);color:var(--v2248-text)}
html[data-zaphi-theme="dark"] :where(h1,h2,h3,h4,h5,h6,strong,label,legend,.label,.section-title){color:var(--v2248-text)}
html[data-zaphi-theme="dark"] :where(p,small,.muted,.hint,.sub,.model,.empty){color:var(--v2248-muted)}

/* Karten, Listen, Kennzahlen und Arbeitsbereiche. */
html[data-zaphi-theme="dark"] :where(
  .card,.detail,.panel,.subcard,.mini,.kv,.notice,.list-card,.list-item,.table-wrap,
  .profile-section,.doc-list-card,.doc-editor,.v09-section,.v12-setting-card,.v20-settings-section,
  .v20-hub-card,.v20-employee-record section,.v20-more-settings,.v20-qr-toggle,.v20-dunning-level,
  .v14-employee-card,.v14-time-employee,.v14-time-kpis>div,.v14-form-summary,.v11-worktime-model,.v11-worktime-table,
  .v203-invoice-list,.v203-invoice-kpis>button,.v203-receipt-card,.v203-receipt-kpis>div,
  .v211-offer-kpis>*,.v211-offer-status-actions,.v195-kva-summary>*,.v194-kva-summary>*,
  .v212-case-kpi,.v195-case-summary>button,.v217-case-summary>button,
  .v217-customer-panel-content,.v217-case-files,.v217-case-file-browser,.v217-case-file,
  .v217-csv-file-card,.v217-csv-summary>div,.v217-csv-history-row,.v217-teamup-import-card,
  .v217-teamup-status,.v217-teamup-source-summary>div,.v217-teamup-preview-grid>div,
  .v217-teamup-preview-samples>div,.v217-holtikon-import-card,.v217-holtikon-summary>div,
  .v217-holtikon-checks>div,.v217-holtikon-identities,.v217-holtikon-status-mappings,
  .v218-source-area,.v196-source-meta,.v217-holtikon-source-meta,.v217-pc-source-meta,
  .zfr-section,.zfr-object,.zfr-object-detail
){background:var(--v2248-surface)!important;color:var(--v2248-text)!important;border-color:var(--v2248-border)!important}

html[data-zaphi-theme="dark"] :where(
  .v203-invoice-kpis,.v211-offer-kpis,.v195-kva-summary,.v194-kva-summary,.v217-case-summary
){background:var(--v2248-page)!important}

html[data-zaphi-theme="dark"] :where(
  .list-item.active,.doc-list-row.active,.v212-case-kpi.active,.v195-case-summary>button.active,
  .v217-customer-panel-tabs button.active,.v217-file-folder.active
){background:#30241c!important;color:#fff!important;border-color:#c66a28!important}

html[data-zaphi-theme="dark"] :where(
  .list-item:hover,.doc-list-row:hover,.zfr-object:hover,tbody tr.clickable:hover,
  .v20-employee-table tbody tr:hover,.v203-invoice-table tbody tr:hover,.v203-invoice-table tbody tr:focus,
  .v217-case-file:hover,.v217-file-folder:hover
){background:var(--v2248-surface-3)!important;color:var(--v2248-text)!important}

/* Formulare, Suche und nicht hervorgehobene Schaltflächen. */
html[data-zaphi-theme="dark"] :where(
  input:not([type="color"]),select,textarea,.search input,.field input,.field select,.field textarea,
  .v20-interface-row input,.v20-calc-setting-row input,.v20-wage-row input,.v20-unit-add input
){background:var(--v2248-surface-2)!important;color:var(--v2248-text)!important;border-color:#46525e!important;caret-color:#fff}
html[data-zaphi-theme="dark"] :where(input,textarea)::placeholder{color:#8f9ba6!important;opacity:1}
html[data-zaphi-theme="dark"] :where(input:disabled,select:disabled,textarea:disabled){background:#171d23!important;color:#7f8a94!important}

html[data-zaphi-theme="dark"] :where(
  .btn:not(.primary),button:not(.primary):not(.active):not(.v218-license-status):not(.v20-inline-status)
){background:var(--v2248-surface-2)!important;color:var(--v2248-text)!important;border-color:#46525e!important}
html[data-zaphi-theme="dark"] :where(
  .btn:not(.primary):hover,button:not(.primary):not(.active):not(.v218-license-status):not(.v20-inline-status):hover
){background:var(--v2248-surface-3)!important;color:#fff!important;border-color:#697784!important}

/* Die orange Primärsprache bleibt auch im Dark Mode bestehen. */
html[data-zaphi-theme="dark"] :where(
  .btn.primary,button.primary,.v217-teamup-steps span.active,.v217-holtikon-wizard-head span.active,
  .v218-license-booking-start,.v218-license-activate
){background:var(--v2248-orange)!important;color:#fff!important;border-color:var(--v2248-orange)!important}
html[data-zaphi-theme="dark"] :where(.btn.primary,button.primary):hover{background:#ff8b33!important;border-color:#ff8b33!important}
html[data-zaphi-theme="dark"] :where(.btn.primary,button.primary):disabled{background:#7b4c2c!important;color:#c9b8ab!important;border-color:#7b4c2c!important}

/* Tabellen: Zeilen, Fußzeilen und leere Zustände dürfen nicht papierweiß bleiben. */
html[data-zaphi-theme="dark"] :where(table,thead,tbody,tfoot,tr,th,td){border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(table,tbody,tr,td,tfoot,.v203-invoice-table tbody tr,.v203-invoice-table tfoot td){background:var(--v2248-surface)!important;color:var(--v2248-text)!important}
html[data-zaphi-theme="dark"] :where(th,.table th,thead td,.v203-invoice-table th,.v20-number-range-table th){background:var(--v2248-surface-2)!important;color:#c5ced6!important}
html[data-zaphi-theme="dark"] :where(.v194-stale-yellow,.v217-csv-result-warning) td{background:#3b311d!important;color:#f2d38b!important}
html[data-zaphi-theme="dark"] :where(.v194-stale-red,.v217-csv-result-error) td{background:#402326!important;color:#f0afb0!important}

/* Belege, Rechnungen und Kostenvoranschläge. */
html[data-zaphi-theme="dark"] :where(
  .dropzone,.v203-receipt-drop,.v203-receipt-toolbar,.v203-invoice-filters,
  .v203-provider-list>div,.v203-text-excerpt,.v203-skonto-list>div,.v203-payment-result
){background:var(--v2248-surface)!important;color:var(--v2248-text)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(.v203-receipt-drop,.dropzone){background:var(--v2248-surface-2)!important}
html[data-zaphi-theme="dark"] :where(.notice.warn,.notice.warning){background:#3b311d!important;color:#f2d38b!important;border-color:#80672a!important}
html[data-zaphi-theme="dark"] :where(.notice.error){background:#402326!important;color:#f0afb0!important;border-color:#82444a!important}

/* Vorgänge und komplette Vorgangsakte. Statusfarben selbst bleiben erhalten. */
html[data-zaphi-theme="dark"] :where(
  .v20-case-chat,.v20-case-chat-head,.v20-case-chat-form,.v20-chat-message,.v20-chat-mentions,
  .v20-chat-mentions button,.v217-case-file-browser>aside,.v217-case-file-browser>main,
  .v217-case-file-drop,.v217-file-menu summary,.v217-file-menu>div,.timeline-item,
  .v20-customer-terms-editor,.v20-tenant-list-toggle,.v20-document-terms,.v20-terms-grid>.checkline,
  .v20-series-box,.v20-attachment-row,.v20-appt-preview .v20-preview-card
){background:var(--v2248-surface-2)!important;color:var(--v2248-text)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(.v20-chat-message.important,.v217-case-file-drop){background:#382b21!important;border-color:#8a5d38!important}
html[data-zaphi-theme="dark"] .v20-chat-message.urgent{background:#3b2225!important;border-color:#84454a!important}
html[data-zaphi-theme="dark"] .v20-chat-message.resolved{background:#202b27!important;border-color:#3d6352!important}
html[data-zaphi-theme="dark"] :where(.v20-status-popover,.v20-status-choice){background:var(--v2248-surface-2)!important;color:var(--v2248-text)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(.v20-status-choice:hover,.v20-status-choice.selected){background:var(--v2248-surface-3)!important}
html[data-zaphi-theme="dark"] .v20-status-choice-chip{color:var(--v2248-text)!important;background:color-mix(in srgb,var(--v20-status) 24%,var(--v2248-surface-2))!important}
html[data-zaphi-theme="dark"] .v20-status-choice>b{color:var(--v2248-text)!important}
html[data-zaphi-theme="dark"] .v20-status-select{background:var(--v2248-surface-2)!important;color:var(--v2248-text)!important}

/* Planer: Bedienbereich dunkel, Kartenmaterial unverändert. */
html[data-zaphi-theme="dark"] :where(
  .planner-shell,.planner-controls,.planner-hint,.planner-head,.planner-corner,.planner-row,
  .employee-cell,.day-cell,.dayhead,.day-title,.hours-strip,.calendar-grid,.calendar-day,
  .v212-map-controls,.v212-map-note,.v213-map-panel,.v213-map-workspace,.v20-resource-pick
){background-color:var(--v2248-surface)!important;color:var(--v2248-text)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(.planner-head,.planner-corner,.dayhead,.day-title,.hours-strip,.calendar-head,.v212-map-controls){background-color:var(--v2248-surface-2)!important}
html[data-zaphi-theme="dark"] .day-cell{background-image:repeating-linear-gradient(to right,transparent 0,transparent calc(9.0909% - 1px),#394550 calc(9.0909% - 1px),#394550 9.0909%)!important}
html[data-zaphi-theme="dark"] :where(.day-cell.weekend,.calendar-day.weekend){background-color:#171d23!important}
html[data-zaphi-theme="dark"] :where(.v213-map-canvas,.leaflet-container){background:#d7e4e8!important;color:#20262b!important}

/* Zeiterfassung und Einstellungen. */
html[data-zaphi-theme="dark"] :where(.v14-time-kpis>div,.v14-form-summary,.v11-day-total,.v11-week-total strong){background:var(--v2248-surface-2)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] .v20-settings-main-tabs{background:rgba(27,34,41,.97)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(.v20-settings-main-tabs button.active,.v12-settings-tabs button.active){background:#30241c!important;color:#fff!important;border-color:#c66a28!important}
html[data-zaphi-theme="dark"] :where(
  .v20-company-logo-box,.v20-permission-pills span,.v20-unit-picks span,
  .v20-employee-record section,.v20-number-range-wrap,.v11-worktime-model,.v11-worktime-table
){background:var(--v2248-surface-2)!important;color:var(--v2248-text)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] .v20-company-logo-image{background:#fff!important}

/* Dynamische Importdialoge. */
html[data-zaphi-theme="dark"] :where(
  .modal,.modal-card,.modal-head,.modal-body,.modal-foot,.context-menu,.zfr-suggestions,
  .v217-csv-wizard,.v217-teamup-wizard,.v217-holtikon-wizard,.v217-file-menu>div,
  .v217-csv-dropzone,.v217-teamup-dropzone,.v217-holtikon-dropzone
){background:var(--v2248-surface)!important;color:var(--v2248-text)!important;border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(.modal-head,.modal-foot,.section-title,.profile-section-head){border-color:var(--v2248-border)!important}
html[data-zaphi-theme="dark"] :where(.v217-csv-wizard-head span,.v217-teamup-steps span,.v217-holtikon-wizard-head span){background:var(--v2248-surface-2)!important;color:var(--v2248-muted)!important}
html[data-zaphi-theme="dark"] :where(.v217-csv-wizard-head span.active,.v217-teamup-steps span.active,.v217-holtikon-wizard-head span.active){background:var(--v2248-orange)!important;color:#fff!important}
html[data-zaphi-theme="dark"] :where(.v217-csv-wizard-head span.done,.v217-teamup-steps span.done,.v217-holtikon-wizard-head span.done){background:#20392c!important;color:#8fd2aa!important}

/* Lizenzcenter besitzt eigene Tokens. */
html[data-zaphi-theme="dark"] .v218-license-page{--lic-ink:var(--v2248-text);--lic-muted:var(--v2248-muted);--lic-line:var(--v2248-border);--lic-soft:var(--v2248-surface-2);--lic-orange:#f58a3a}

/* Druck- und Dokumentvorschauen bleiben bewusst wie Papier. */
html[data-zaphi-theme="dark"] :where(
  .document-paper,.v09-paper,.paper,.print-page,.v20-paper-page,.v203-invoice-preview .document-paper
){background:#fff!important;color:#111!important;border-color:#dfe2e6!important;color-scheme:light}
html[data-zaphi-theme="dark"] :where(
  .document-paper,.v09-paper,.paper,.print-page,.v20-paper-page
) :where(*,table,thead,tbody,tfoot,tr,th,td){background-color:transparent!important;color:inherit!important;border-color:revert!important}

