/* ============================================================
   orbita:dunkel 08.10.2026 - dark mode, the corrections.

   The tokens in tokens.css carry most of it: every rule that uses a
   variable follows the theme by itself. What is collected here are the
   places that hard-code a light colour (a white surface, a pastel badge,
   a navy tile) in a stylesheet or in a template's own <style>. Each block
   names where the original rule lives. Everything is scoped to
   :root[data-theme="dark"], so the light theme is untouched.
   ============================================================ */

/* -- Surfaces that were white or a light gradient ending in white ---------- */
/* dashboard.html, checkout.html, subscription_checkout.html, pubblica_choice.html,
   submit_book.html, agb_hinweis.html, tools.html, login.html */
:root[data-theme="dark"] .hero {
  background:
    radial-gradient(560px 260px at 88% -25%, rgba(34, 195, 240, 0.12), transparent 62%),
    linear-gradient(120deg, #1F2430, #202328 60%);
  border-color: var(--border);
}
:root[data-theme="dark"] .hero .btn-glass { background: var(--popover); color: var(--text); border-color: var(--border-strong); }
:root[data-theme="dark"] .price-box,
:root[data-theme="dark"] .ak-preis {
  background:
    radial-gradient(460px 220px at 92% -25%, rgba(34, 195, 240, 0.12), transparent 62%),
    linear-gradient(120deg, #1F2430, #222631);
  border-color: var(--border-strong);
}
:root[data-theme="dark"] .new-card { background: linear-gradient(135deg, var(--card), var(--blue-50)); }
:root[data-theme="dark"] .new-card .step { background: rgba(255, 255, 255, 0.04); }
:root[data-theme="dark"] .korr-strip { background: linear-gradient(90deg, var(--warning-soft), var(--card) 75%); border-color: var(--lg-warning-border); }
:root[data-theme="dark"] .korr-strip .icon { background: var(--card); border-color: var(--lg-warning-border); }
:root[data-theme="dark"] .draft-strip { background: linear-gradient(90deg, var(--blue-50), var(--card) 70%); }
:root[data-theme="dark"] .draft-strip .icon { background: var(--card); }
:root[data-theme="dark"] .earn-bar { background: linear-gradient(90deg, var(--blue-50), var(--card) 55%); }
:root[data-theme="dark"] .isbn-row { background: linear-gradient(90deg, var(--blue-50), var(--card) 70%); }
:root[data-theme="dark"] .agb-note { background: linear-gradient(90deg, var(--blue-50), var(--card) 70%); }
:root[data-theme="dark"] .agb-note.is-ending { background: linear-gradient(90deg, rgba(240, 98, 106, 0.14), var(--card) 70%); }
:root[data-theme="dark"] .agb-note-icon { background: var(--card); }
:root[data-theme="dark"] .rp-kpi,
:root[data-theme="dark"] .rp-in:focus,
:root[data-theme="dark"] .ru-mode.is-active { background: var(--card); }
:root[data-theme="dark"] .tab-link.active .code-chip,
:root[data-theme="dark"] .btn-primary .code-chip { background: rgba(255, 255, 255, 0.92); color: #1F49D9; }
/* the barcode and the light logo preview stay white on purpose: they show
   what is printed on paper (tools.html .tl-barcode-preview, .tl-logo .light) */

/* the skeleton shimmer was a white sheen */
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); }

/* -- Navy used as a surface (tokens.css turns navy into a heading colour) --- */
:root[data-theme="dark"] .badge-dark { background: #0A1A3F; color: #fff; }
:root[data-theme="dark"] .view-toggle-fab:hover { background: #10265A; }
:root[data-theme="dark"] .payout-stage--withdrawn { color: var(--slate-700); }
:root[data-theme="dark"] .sidebar-logo .brand-mark,
:root[data-theme="dark"] .auth-brand .brand-mark,
:root[data-theme="dark"] .inv-mark,
:root[data-theme="dark"] .app-footer .footer-brand svg { color: #10265A; }

/* -- Pastel badges and boxes: one dark tone per colour family --------------- */
/* green */
:root[data-theme="dark"] :is(.badge.mkt-it, .rp-badge.liquidato, .rp-kpi .badge, .badge.liquidato,
  .badge.pubblicato, .ru-badge.liquidato, .aic-v-pass, .ru-liq-btn) {
  background: #15322A; color: #7FE3C3; border-color: #2A5A4B;
}
:root[data-theme="dark"] .ru-liq-btn:hover { background: #1B4136; }
:root[data-theme="dark"] .rp-msg.ok { background: #15322A; border-color: #2A5A4B; color: #7FE3C3; }
:root[data-theme="dark"] :is(.alert-success, .check-ok, .bs-file--ok) { border-color: #2A5A4B; }
:root[data-theme="dark"] .tier-name .tier-badge { color: #7FE3C3; }
:root[data-theme="dark"] .badge-mkt { color: #7FE3C3; }
/* amber */
:root[data-theme="dark"] :is(.badge.mkt-de, .badge.mkt-at, .badge.mkt-ch, .badge.mkt-es,
  .rp-badge.bozza, .badge.confermato, .ru-badge.bozza, .aic-v-review, .aic-v-open) {
  background: #362A14; color: #F7C980;
}
:root[data-theme="dark"] .aic-stat-open { background: #2E2412; border-color: #6A4E1E; }
:root[data-theme="dark"] :is(.aic-stat-open .stat-value, .aic-issue-warn) { color: #F7C980; }
:root[data-theme="dark"] :is(.ann-warning, .alert-warning, .slot-frist--bald, .slot-frist--bald .slot-frist-icon,
  .check-warning, .feedback-box.warn, .bs-agb, .legal-preview-banner) { border-color: #6A4E1E; }
:root[data-theme="dark"] .slot-frist-hinweis { border-top-color: #6A4E1E; }
/* red */
:root[data-theme="dark"] :is(.aic-v-block, .aic-v-failed) { background: #3A1E22; color: #F8AAB0; }
:root[data-theme="dark"] :is(.aic-warn, .aic-stat-alarm, .ru-skip, .ru-err, .ru-del-btn, .rp-msg.err) {
  background: #3A1E22; border-color: #6B2D33; color: #F8AAB0;
}
:root[data-theme="dark"] .ru-del-btn:hover { background: #48252A; }
:root[data-theme="dark"] :is(.aic-stat-alarm .stat-value, .aic-issue-block, .cd-warn,
  .orb-consent-error, .orb-confirm-error) { color: #F8AAB0; }
:root[data-theme="dark"] :is(.ann-error, .alert-error, .danger-zone, .check-error, .klappe--gefahr > summary:hover,
  .lq-bad, .warn-box) { border-color: #6B2D33; }
/* blue */
:root[data-theme="dark"] :is(.badge.mkt-int, .badge.mkt-us, .rp-badge.confermato, .badge.inviato, .badge.revisione,
  .badge.correzioni, .badge.approvato, .ru-badge.confermato, .ru-badge.dashboard, .rp-dash) {
  background: #1E2640; color: #9DB4FF; border-color: #34437A;
}
:root[data-theme="dark"] :is(.ann-info, .st-in_lavorazione, .role-staff) { color: #9DB4FF; }
/* purple */
:root[data-theme="dark"] .badge.mkt-uk { background: #2B2245; color: #C9B8F7; }
:root[data-theme="dark"] :is(.tk-ki-badge, .tk-ki-regeln li, .tk-ki--decision) { color: #B9B4FF; }
/* cyan */
:root[data-theme="dark"] .badge.mkt-au { background: #173A45; color: #7DD8F0; }
:root[data-theme="dark"] :is(.badge-cyan, .chat-auto, .stato-risposto, .tk-ki--auto) { color: #7DD8F0; }
/* pink, olive */
:root[data-theme="dark"] .badge.mkt-fr { background: #3A1F2B; color: #F4A8C4; }
:root[data-theme="dark"] .badge.mkt-eu { background: #26301C; color: #B9D59A; }
/* neutral grey */
:root[data-theme="dark"] :is(.rp-ohne-tag, .rp-null-tag, .ru-badge.null_statement, .ru-badge.ohne-gs, .badge.bozza) {
  background: #2E3238; color: #C9D1DE;
}
/* the black active pill on analytics */
:root[data-theme="dark"] .an-pill.active { color: #0F1115; }

/* -- Consent overlay (consent_overlay.html): neutral hovers ------------------ */
:root[data-theme="dark"] :is(.orb-consent-foot button.orb-secondary:hover:not(:disabled),
  .orb-closed-list a:hover, .orb-confirm-actions .orb-cancel:hover:not(:disabled)) {
  background: var(--menu-hover); border-color: var(--border-strong);
}

/* the quiet decline link of the consent wall: grey, red only under the pointer */
:root[data-theme="dark"] .orb-consent-foot .orb-decline:hover:not(:disabled) { color: #F8AAB0; }

/* -- Sign-in page (login.html): the glass cards were white ----------------- */
:root[data-theme="dark"] .auth-point { background: rgba(255, 255, 255, 0.04); border-color: var(--border); }
:root[data-theme="dark"] .auth-point:hover { background: rgba(255, 255, 255, 0.07); }
:root[data-theme="dark"] .auth-point .ic { background: var(--card); }
:root[data-theme="dark"] .auth-figure { background: rgba(32, 35, 40, 0.85); }

/* -- Tour (tour.css): card border and the drawn mini window --------------- */
:root[data-theme="dark"] .tour-card { border-color: var(--border); }
:root[data-theme="dark"] .tour-ort { background: var(--card); }
:root[data-theme="dark"] .nh-illu-win { background: rgba(32, 35, 40, 0.96); }
:root[data-theme="dark"] .nh-illu-bar { background: #24272C; border-bottom-color: #30343A; }
:root[data-theme="dark"] .nh-illu-bar i { background: #3B4049; }
:root[data-theme="dark"] .nh-illu-side { background: #1C1F23; border-right-color: #30343A; }
:root[data-theme="dark"] .nh-illu-side b { background: #2E3238; }
:root[data-theme="dark"] .nh-illu-side b:nth-child(1) { background: #253055; }
:root[data-theme="dark"] .nh-illu-card { background: #202328; border-color: #30343A; }
:root[data-theme="dark"] .nh-illu-card::before { background: #253055; }
:root[data-theme="dark"] .nh-illu-card::after { background: #2E3238; }
:root[data-theme="dark"] .nh-illu-card.c3::before { background: #173A45; }
:root[data-theme="dark"] .auth {
  background:
    radial-gradient(820px 520px at 46% -8%, rgba(34, 195, 240, 0.08), transparent 62%),
    radial-gradient(760px 620px at -8% 108%, rgba(42, 91, 255, 0.12), transparent 62%),
    linear-gradient(160deg, #1A1D21 0%, #191C1F 100%);
}

/* -- Info alert: blue-700 text on the dark blue tint was too dim ------------ */
:root[data-theme="dark"] .alert-info { color: #B9CAFF; border-color: var(--blue-200); }
:root[data-theme="dark"] .alert-info a { color: #DCE4FF; }

/* -- Cookie bar (site/_consent.html, also shown inside the portal) --------- */
:root[data-theme="dark"] #sp-consent { color: var(--text); }
:root[data-theme="dark"] #sp-consent .spc-box { background: var(--popover); border-color: var(--border); }
:root[data-theme="dark"] #sp-consent .spc-text { color: var(--slate-700); }
:root[data-theme="dark"] #sp-consent :is(.spc-text strong, .spc-row strong) { color: var(--text); }
:root[data-theme="dark"] #sp-consent .spc-row { border-color: var(--border); }
:root[data-theme="dark"] #sp-consent .spc-row p { color: var(--text-muted); }
:root[data-theme="dark"] #sp-consent :is(a, .spc-link) { color: #8FA9FF; }
:root[data-theme="dark"] #sp-consent .spc-sw { background: #444A53; }
:root[data-theme="dark"] #sp-consent .spc-sw[aria-checked="true"] { background: #2A5BFF; }
:root[data-theme="dark"] #sp-consent .spc-btn { background: #E6EAF2; color: #14161A; border-color: #E6EAF2; }
:root[data-theme="dark"] #sp-consent .spc-btn:hover { background: #C9D1DE; border-color: #C9D1DE; }

/* -- Gradients that use blue-700 as a colour stop (tokens.css makes blue-700
      a text colour in the dark theme) ---------------------------------------- */
:root[data-theme="dark"] .sidebar-bottom .btn-cta { background: linear-gradient(100deg, #1F49D9, var(--blue-600) 60%, var(--cyan-500)); }
:root[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--blue-600), #1F49D9); }
:root[data-theme="dark"] .hero .btn-light { background: linear-gradient(100deg, #1F49D9, var(--blue-600) 62%, var(--cyan-500)); }
:root[data-theme="dark"] .view-toggle-fab { background: linear-gradient(100deg, #1F49D9, var(--blue-600) 65%, var(--cyan-500)); }
:root[data-theme="dark"] .bar { background: linear-gradient(180deg, var(--blue-500), #1F49D9); }
:root[data-theme="dark"] .an-bar b { background: linear-gradient(180deg, var(--blue-500), #1F49D9); }
:root[data-theme="dark"] .nh-intro-ico { background: linear-gradient(140deg, var(--blue-500), #1F49D9 60%, var(--cyan-500)); }
:root[data-theme="dark"] .hero h2 span { background: linear-gradient(110deg, #7C9CFF, #6088FF 55%, var(--cyan-500)); -webkit-background-clip: text; background-clip: text; }

/* admin/access_requests.html: the active tab was "text colour as surface" */
:root[data-theme="dark"] .ar-tabs a.on { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
:root[data-theme="dark"] .tour-hero { background: linear-gradient(140deg, var(--blue-500), #1F49D9 55%, var(--cyan-500)); }

/* -- Live sales (report_live.html, report.html tab badge) ------------------ */
:root[data-theme="dark"] .rp-tab-tag { background: #362A14; color: #F7C980; }
:root[data-theme="dark"] .lv-tip { background: var(--popover); color: var(--text); border-color: var(--border); }
