/* HHL subpage contrast supplement. Load after v3; original themes remain intact.
   Legacy themes paint cells with !important, not just rows. Pair foreground and
   background here, and retain the meaning of business status/calendar colors.
   No print rules, visibility changes, or interaction changes belong in this file. */
@media screen {
  html:root[data-hhl-skin="hhl"] table :is(th,td) {
    background:#fff!important;color:#183944;border-color:#d5e1db!important;
  }
  html:root[data-hhl-skin="hhl"] table tbody tr:nth-child(even)>:is(th,td) {background:#f5f9f6!important}
  html:root[data-hhl-skin="hhl"] table tbody tr:hover>:is(th,td) {background:#edf5ef!important}
  html:root[data-hhl-skin="hhl"] table thead th,
  html:root[data-hhl-skin="hhl"] table>tbody>tr>th,
  html:root[data-hhl-skin="hhl"] table tfoot :is(th,td) {
    background:#eaf1ed!important;color:#123947!important;
  }
  html:root[data-hhl-skin="hhl"] table thead th a {color:#123947!important}
  html:root[data-hhl-skin="hhl"] table td a {color:#00717c!important}
  html:root[data-hhl-skin="hhl"] :is(.monitor-table-wrap,.csv-table-wrap,.afterbuy-table-scroll,.booking-table-scroll) {
    max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;background:#fff!important;border-color:#d5e1db!important;
  }
  /* Afterbuy has more-specific dark selectors and meaningful colored columns. */
  html:root[data-hhl-skin="hhl"] .afterbuy-table tbody tr>td {background:#fff!important;color:#183944}
  html:root[data-hhl-skin="hhl"] .afterbuy-table tbody tr:nth-child(even)>td {background:#f5f9f6!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-table tbody tr:hover>td {background:#edf5ef!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-table thead th {background:#eaf1ed!important;color:#123947!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-table thead :is(.afterbuy-col-fzg_fertig_am,.afterbuy-col-wa_nr) {
    background:#e1efe3!important;color:#234d32!important;border-bottom-color:#80a58a!important;
  }
  html:root[data-hhl-skin="hhl"] .afterbuy-table thead :is(.afterbuy-col-belegnummer,.afterbuy-col-gesamt_brutto,.afterbuy-col-offen,.afterbuy-col-bezahlt_am,.afterbuy-col-kundenauslieferung_dat) {
    background:#f6edda!important;color:#604717!important;border-bottom-color:#bda260!important;
  }
  html:root[data-hhl-skin="hhl"] .afterbuy-monitor .afterbuy-table tbody tr td.afterbuy-empty {
    background:#f9e3e5!important;color:#86232d!important;box-shadow:inset 3px 0 #b54f60;
  }
  html:root[data-hhl-skin="hhl"] .afterbuy-table td.afterbuy-payment-partial,
  html:root[data-hhl-skin="hhl"] .afterbuy-table td.afterbuy-payment-partial a {color:#805500!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-table td.afterbuy-payment-credit,
  html:root[data-hhl-skin="hhl"] .afterbuy-table td.afterbuy-payment-credit a {color:#176787!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-table td.afterbuy-invoice-settled,
  html:root[data-hhl-skin="hhl"] .afterbuy-table td.afterbuy-invoice-settled a,
  html:root[data-hhl-skin="hhl"] .afterbuy-ready-action {color:#236440!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-table th[aria-sort] .afterbuy-sort-arrow {color:#00717c!important}
  html:root[data-hhl-skin="hhl"] :is(.afterbuy-menu-link,.role-badge) {
    background:#e7f2f3!important;color:#17515c!important;border-color:#b3d0ce!important;
  }
  /* Import/CSV/status badges: a light surface needs dark, readable text. */
  html:root[data-hhl-skin="hhl"] :is(.status-pill,.status-badge,.badge,.pill,.tag) {
    background:#eaf1ed;color:#304f58;border-color:#c1d2c9;
  }
  html:root[data-hhl-skin="hhl"] :is(.status-pill,.status-badge,.badge,.pill,.tag):is(.ok,.success,.done,.active) {
    background:#e2f2e7!important;color:#236440!important;border-color:#9dc5ab!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.status-pill,.status-badge,.badge,.pill,.tag):is(.warn,.warning,.pending,.running,.stale) {
    background:#fff2d3!important;color:#79540c!important;border-color:#d8bd77!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.status-pill,.status-badge,.badge,.pill,.tag):is(.bad,.error,.danger,.failed,.overdue) {
    background:#f9e3e5!important;color:#86232d!important;border-color:#d3a0a7!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.text-success,.date-green,.csv-ok) {color:#236440!important}
  html:root[data-hhl-skin="hhl"] :is(.text-danger,.date-red,.csv-error) {color:#9e3028!important}
  html:root[data-hhl-skin="hhl"] :is(.btn,.button,.search-button,.search-btn,.private-open-button,.repair-btn,input[type="submit"]) {
    background:#087f87!important;background-image:none!important;color:#fff!important;
    border-color:#087f87!important;text-shadow:none!important;box-shadow:none!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.btn,.button):is(.secondary,.btn-secondary) {
    background:#fff!important;color:#123947!important;border-color:#bfd2c9!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.btn,.button):is(.danger,.btn-danger) {
    background:#a33a30!important;color:#fff!important;border-color:#a33a30!important;
  }
  /* Keep calendar states and sticky time cells distinct after cell normalization. */
  html:root[data-hhl-skin="hhl"] :is(.calendar-scroll,.booking-table-scroll) table :is(.time-col,.time-cell,.time-head) {
    background:#eaf1ed!important;color:#123947!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.calendar-scroll,.booking-table-scroll) table td:is(.available,.free) {
    background:#e3f3e8!important;color:#236440!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.calendar-scroll,.booking-table-scroll) table td:is(.not-bookable,.blocked,.blocked-day) {
    background:#e7ece9!important;color:#53686f!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.calendar-scroll,.booking-table-scroll) table td.booked {
    background:#f6e8d6!important;color:#704d1a!important;
  }
}
@media screen and (max-width:720px) {
  html:root[data-hhl-skin="hhl"] :is(.monitor-grid,.csv-summary,.csv-grid,.stats-grid,.stats) {
    grid-template-columns:minmax(0,1fr)!important;gap:12px!important;
  }
  html:root[data-hhl-skin="hhl"] :is(.monitor-hero,.csv-hero,.afterbuy-toolbar,.afterbuy-filters,.afterbuy-seller-filter,.afterbuy-deliverer-filter) {
    flex-wrap:wrap;min-width:0;max-width:100%;gap:10px;
  }
  html:root[data-hhl-skin="hhl"] :is(.monitor-table-wrap,.csv-table-wrap) {padding:0 8px 12px}
  html:root[data-hhl-skin="hhl"] .afterbuy-table {min-width:1200px}
  html:root[data-hhl-skin="hhl"] :is(.afterbuy-monitor,.monitor-page,.csv-page) {min-width:0;max-width:100%}
  html:root[data-hhl-skin="hhl"] :is(.monitor-card,.stat-card,.csv-stat,.kpi,.afterbuy-invoice-note) {overflow-wrap:anywhere}
}
/* Detailed subviews use their own text palettes, including descendants of cells.
   Keep semantic colors, tint families, animation and all controls intact. */
@media screen {
  html:root[data-hhl-skin="hhl"] {--muted:#536b74!important;--link:#00717c!important}
  html:root[data-hhl-skin="hhl"] :is(.subtitle,.muted,.small,.meta,.description,.site-title p,.case-footer,.case-eyebrow,.case-font-control span,.afterbuy-payment-info,.payments-source,.rt-day-date) {color:#536b74!important}
  html:root[data-hhl-skin="hhl"] :is(.panel-header p,.table-title p,.booking-command p,.booking-topbar p,.booking-command-stats span,.booking-stats span,.legend) {color:#536b74!important}
  html:root[data-hhl-skin="hhl"] :is(.mobile-card,.mobile-summary-card) :is(h3,strong) {color:#123947!important}
  html:root[data-hhl-skin="hhl"] :is(.mobile-card,.mobile-summary-card) :is(.date-red,.text-danger,.error) strong {color:#9e3028!important}
  html:root[data-hhl-skin="hhl"] :is(.mobile-card,.mobile-summary-card) :is(.date-green,.text-success,.success) strong {color:#236440!important}
  html:root[data-hhl-skin="hhl"] .csv-preview {background:#f3f8f5!important;color:#183944!important;border-color:#d5e1db!important}
  html:root[data-hhl-skin="hhl"] .csv-preview :is(span,strong,code) {color:#183944!important}
  html:root[data-hhl-skin="hhl"] :is(.year-day,.year-line a) span {color:#4a6a75!important}
  html:root[data-hhl-skin="hhl"] :is(.calendar-scroll,.booking-table-scroll) table th :is(span,small) {color:#435d66!important}
  html:root[data-hhl-skin="hhl"] :is(.calendar-scroll,.booking-table-scroll) table td:is(.not-bookable,.blocked,.blocked-day) span {color:#53686f!important}
  html:root[data-hhl-skin="hhl"] :is(.calendar-scroll,.booking-table-scroll) .slot-link :is(small,em) {color:#604717!important}
  html:root[data-hhl-skin="hhl"] :is(.afterbuy-filter-field,.filters) label {color:#17515c!important}
  html:root[data-hhl-skin="hhl"] body>header:has(.topbar) {background:#eaf1ed!important;color:#123947!important;border-color:#d5e1db!important;box-shadow:none!important}
  html:root[data-hhl-skin="hhl"] :is(.topbar .crumb,.topbar .brand a,.wt-live-kicker) {color:#17515c!important}
  html:root[data-hhl-skin="hhl"] :is(.kpi .good,.wt-live-status strong) {color:#236440!important}
  html:root[data-hhl-skin="hhl"] .kpi .bad {color:#9e3028!important}
  html:root[data-hhl-skin="hhl"] .sort-link.active {background:#dff0e9!important;color:#123947!important}
  html:root[data-hhl-skin="hhl"] .panel [style*="color:#9ca3af"],
  html:root[data-hhl-skin="hhl"] .panel [style*="color: #9ca3af"] {color:#536b74!important}
  html:root[data-hhl-skin="hhl"] :is(.picker-note,.database-state,.sub) {color:#536b74!important}
  html:root[data-hhl-skin="hhl"] .payments-page .payment-gedeckt {color:#236440!important}
  html:root[data-hhl-skin="hhl"] .payments-page :is(.payment-teilzahlung,.payment-offen) {color:#805500!important}
  html:root[data-hhl-skin="hhl"] .payments-page .payment-ueberzahlung {color:#176787!important}
  html:root[data-hhl-skin="hhl"] .payments-page .payment-pruefen {color:#9e3028!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-stage {--case-accent:#17596c}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-vehicle {--case-accent:#425988}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-workshop {--case-accent:#236440}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-payment {--case-accent:#79540c}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-documents {--case-accent:#754370}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-handover {--case-accent:#17606a}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-field dt {color:#435d66!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-case :is(.case-done,.case-complete) {color:#236440!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-ready-notice {background:#e2f2e7!important;color:#236440!important}
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-field-missing,
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-invoices td.case-field-missing {
    background:#f9e3e5!important;color:#86232d!important;box-shadow:inset 3px 0 #b54f60;
  }
  html:root[data-hhl-skin="hhl"] .afterbuy-case .case-field-missing :is(dt,dd) {color:#86232d!important}
  html:root[data-hhl-skin="hhl"] .case-compact-page .afterbuy-case .case-invoices th {color:#123947!important}
}
@media screen and (max-width:720px) {
  html:root[data-hhl-skin="hhl"] .afterbuy-table :is(th,td) {min-width:88px;font-size:12px!important;line-height:1.4}
  html:root[data-hhl-skin="hhl"] .afterbuy-table :is(th,td):is(.afterbuy-col-kundenname,.afterbuy-col-modell) {min-width:130px}
}
/* Final warning/detail labels: semantic indicators keep their own color dots. */
@media screen {
  html:root[data-hhl-skin="hhl"] a {color:#006873}
  html:root[data-hhl-skin="hhl"] .warning-list,
  html:root[data-hhl-skin="hhl"] .warning-list :is(li,span,strong) {color:#79540c!important}
  html:root[data-hhl-skin="hhl"] .error-list,
  html:root[data-hhl-skin="hhl"] .error-list :is(li,span,strong) {color:#86232d!important}
  html:root[data-hhl-skin="hhl"] .legend>span {background:#eaf1ed!important;color:#435d66!important;border-color:#d5e1db!important}
  html:root[data-hhl-skin="hhl"] :is(.booking-command-stats,.booking-stats) strong,
  html:root[data-hhl-skin="hhl"] .topbar .brand strong,
  html:root[data-hhl-skin="hhl"] .afterbuy-case a {color:#006873!important}
  html:root[data-hhl-skin="hhl"] .form-grid .field label span {color:#536b74!important}
}

