/* ==========================================================================
   PromoFAD · Design system · TEMA SCURO (Fase 2, rifinito in Fase 9)
   Si attiva con i due meccanismi esistenti: gestionale `html.dark`, discente `html[data-pf-theme="dark"]`.
   Ridefinisce solo i token: le variabili del tema precedente li leggono già (vedi tokens.css, sezione 2).
   ========================================================================== */
html.dark,
html[data-pf-theme="dark"],
html[data-theme="dark"] {
  --pf-bg: var(--pf-blue-950);
  --pf-bg-band: var(--pf-blue-900);
  --pf-surface: var(--pf-blue-900);
  --pf-surface-2: var(--pf-blue-800);
  --pf-text: var(--pf-grey-50);
  --pf-text-muted: var(--pf-blue-200);
  --pf-heading: #FFFFFF;
  --pf-link: var(--pf-blue-200);
  --pf-link-hover: var(--pf-blue-100);
  --pf-link-on-band: var(--pf-blue-200);
  --pf-action: var(--pf-blue-500);
  --pf-action-hover: var(--pf-blue-600);
  --pf-action-pressed: var(--pf-blue-700);
  --pf-action-soft: var(--pf-blue-800);
  --pf-on-action: #FFFFFF;
  --pf-border: var(--pf-blue-700);
  --pf-border-strong: #8FB3F0;
  --pf-focus: var(--pf-blue-200);
  --pf-disabled-bg: var(--pf-blue-800);
  --pf-disabled-text: #8FB3F0;

  --pf-nav-bg: var(--pf-ink);
  --pf-nav-active-bg: var(--pf-blue-800);
  --pf-hero-bg: var(--pf-blue-800);
  --pf-topbar-bg: var(--pf-blue-900);

  --pf-ok: #6EDC9B;   --pf-ok-bg: #0B2F22;
  --pf-warn: #F2C14E; --pf-warn-bg: #3A2A00;
  --pf-err: #FF8B80;  --pf-err-bg: #3F0F0A;
  --pf-info: #7CD0EA; --pf-info-bg: #06303D;
  --pf-idle: var(--pf-grey-300); --pf-idle-bg: var(--pf-grey-900);

  --pf-cat-training: #8FB3F0;
  --pf-cat-people: #B9A6F0;
  --pf-cat-content: #E49AC8;
  --pf-cat-system: var(--pf-grey-400);

  --pf-shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --pf-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .35);
  --pf-shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);

  /* variabili del tema precedente che non leggono i token */
  --icon: #FFFFFF;
  --icon-color: var(--pf-grey-300);
  --icon-color-active: #FFFFFF;
  --notification-palse: rgba(255, 255, 255, .6);
  --scroll-thumb: var(--pf-blue-700);
  --bs-secondary-color: var(--pf-blue-200);
  --payment-logo-border-color: rgba(231, 234, 238, .15);
  color-scheme: dark;
}

/* ==========================================================================
   FASE 14 · CONTRASTI IN SCURO (misurati a runtime, WCAG 2.2 AA: 4,5:1 testo, 3:1 testo grande)
   Variabili del tema precedente che in tokens.css puntano alla scala di grigi del chiaro e non si invertivano.
   ========================================================================== */
html.dark,
html[data-pf-theme="dark"],
html[data-theme="dark"] {
  --header-search-bg: var(--pf-surface-2);
  --card-header-bg: var(--pf-surface-2);
  --table-head: var(--pf-surface-2);
  --data-table-row-hover: var(--pf-surface-2);
  --disabled-pagination-btn: var(--pf-surface-2);
  --disabled-pagination-color: var(--pf-blue-200);
  --nav-tab: var(--pf-surface-2);
  --border-hover-color: var(--pf-border-strong);
  --topnav-submenu-link: var(--pf-blue-200);
  --footer-bg: var(--pf-surface);
  --menu_bg: var(--pf-surface);
  --menu_text: var(--pf-text);
  --menu_hover_text: var(--pf-link);
  --menu_title_text: var(--pf-heading);
}

/* Classi Bootstrap di colore fisso: un solo valore per tema (sul chiaro restano quelle di theme.css). */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .bg-white { background-color: var(--pf-surface) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .bg-light { background-color: var(--pf-surface-2) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .text-dark:not(.bg-warning):not(.bg-info) { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .text-secondary { color: var(--pf-text-muted) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .text-danger,
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .required_mark { color: var(--pf-err) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .btn-outline-secondary { color: var(--pf-text-muted) !important; border-color: var(--pf-border-strong) !important; }

/* Pastiglie e badge di stato: i token di stato in scuro sono chiari, quindi il testo è scuro (il bianco dava 1,7:1–2,3:1). */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(
  .bg-success, .text-bg-success, .badge-success,
  .bg-danger, .text-bg-danger, .badge-danger,
  .bg-info, .text-bg-info, .badge-info,
  .bg-secondary, .text-bg-secondary, .badge-secondary,
  .course-status-pill, .badge-expired-ribbon, .badge-fad-type, .btn-vc-play, .apx-badge,
  .btn-danger, .mc-access-btn.is-disabled, .theme_btn.small_btn2
):not([class*="bg-opacity"]):not(.primary-btn):not(.badge-fad-async) { color: var(--pf-bg) !important; }

/* Colori di testo scritti nell'attributo style (pensati per il fondo chiaro): in scuro seguono i token. */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#1e293b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #1e293b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#1e293b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #1e293b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#1e293b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #1e293b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#0f172a"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #0f172a"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#0f172a"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #0f172a"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#0f172a"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #0f172a"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#334155"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #334155"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#334155"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #334155"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#334155"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #334155"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#212529"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #212529"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#212529"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #212529"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#212529"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #212529"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#111827"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #111827"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#111827"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #111827"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#111827"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #111827"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#1f2937"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #1f2937"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#1f2937"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #1f2937"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#1f2937"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #1f2937"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#000000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #000000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#000000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #000000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#000000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #000000"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#222"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #222"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#222"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #222"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#222"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #222"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#333"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #333"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#333"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #333"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#333"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #333"] { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#64748b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #64748b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#64748b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #64748b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#64748b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #64748b"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#475569"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #475569"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#475569"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #475569"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#475569"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #475569"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#6b7280"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #6b7280"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#6b7280"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #6b7280"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#6b7280"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #6b7280"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#6c757d"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #6c757d"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#6c757d"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #6c757d"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#6c757d"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #6c757d"] { color: var(--pf-text-muted) !important; }

/* Sfondi chiari scritti nell'attributo style o in classi di singole viste: in scuro diventano superfici. */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is([style*="background: #f8fafc"], [style*="background:#f8fafc"], [style*="background: #f1f5f9"], [style*="background:#f1f5f9"], [style*="background: #fff;"], [style*="background:#fff;"], [style*="background: #ffffff"], [style*="background:#ffffff"]) { background-color: var(--pf-surface-2) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.cert-stat-card) { background-color: var(--pf-surface) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.cc-tools) { background-color: var(--pf-surface-2) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) #previewSpinner { background-color: rgba(2, 25, 60, .85) !important; }

/* Intestazioni di tabella con colore fisso dal foglio della vista */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) table th, html:is(.dark, [data-pf-theme="dark"]):not(#pf) .table thead th { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(code, pre) { color: var(--pf-cat-content); }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) pre { color: var(--pf-text); }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .btn-outline-success { color: var(--pf-ok) !important; border-color: var(--pf-ok) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .btn-outline-dark { color: var(--pf-text) !important; border-color: var(--pf-border-strong) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) #main-nav-for-chat .pf-scope-name { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) #main-nav-for-chat #onlineUsersCount { color: var(--pf-bg) !important; }

/* Badge con sfondo di stato PIENO dato in linea: il testo bianco di theme.css/Bootstrap diventa scuro */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-ok,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-ok,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-ok)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-ok)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-warn,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-warn,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-warn)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-warn)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-err,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-err,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-err)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-err)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-info,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-info,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-info)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-info)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-idle,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-idle,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background:var(--pf-idle)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.badge, button, a, span)[style*="background: var(--pf-idle)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.bg-warning, .qb-btn.danger) { color: var(--pf-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .badge[style*="#6366F1"] { background-color: #4F46E5 !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.bg-success, .bg-danger, .bg-warning, .bg-info)[class*="bg-opacity"] { background-color: transparent !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .bg-success[class*="bg-opacity"] { color: var(--pf-ok) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .bg-danger[class*="bg-opacity"] { color: var(--pf-err) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .bg-warning[class*="bg-opacity"] { color: var(--pf-warn) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .bg-info[class*="bg-opacity"] { color: var(--pf-info) !important; }

/* testi rossi e sfondi chiari scritti in linea */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(b, span, label)[style*="color:#dc2626"], html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(b, span, label)[style*="color: #dc2626"], html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(b, span, label)[style*="color:#ef4444"], html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(b, span, label)[style*="color: #ef4444"], html:is(.dark, [data-pf-theme="dark"]):not(#pf) b.text-danger { color: var(--pf-err) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is([style*="background: #e2e8f0"], [style*="background:#e2e8f0"]) { background-color: var(--pf-surface-2) !important; }
/* intestazione blu della scheda funzionari: etichetta e pulsante restano leggibili anche sul blu d'azione */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .fzp-k { opacity: 1 !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.fzp-back, .fzp-add) { background: rgba(1, 19, 46, .35) !important; }

/* ==========================================================================
   AREA DISCENTE · contrasti in scuro
   ========================================================================== */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.dashboard_lg_card, .sidebar__widget, .details_shadow) { background-color: var(--pf-surface) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.nice-select .list, .nice-select .option) { background-color: var(--pf-surface) !important; color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .nice-select .option:hover, html:is(.dark, [data-pf-theme="dark"]):not(#pf) .nice-select .option.focus, html:is(.dark, [data-pf-theme="dark"]):not(#pf) .nice-select .option.selected.focus { background-color: var(--pf-surface-2) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .language .dropdown-toggle span { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .mon-head small { color: #FFFFFF !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .section__title3 h3, html:is(.dark, [data-pf-theme="dark"]):not(#pf) .cw-title { color: var(--pf-heading) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .close-btn { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .pv-toc b, html:is(.dark, [data-pf-theme="dark"]):not(#pf) .pv-right b { color: var(--pf-link) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .pv-right span { color: var(--pf-text-muted) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) #couponLabel { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.apx-pct)[style*="#16a34a"], html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.apx-pct)[style*="#0f766e"] { color: var(--pf-ok) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .btn-start-course.disabled { color: var(--pf-bg) !important; background-color: var(--pf-idle) !important; opacity: 1 !important; }
/* testo incollato da editor esterni (Google Docs…) con colori in linea pensati per il fondo bianco */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .course_overview_description :is(p, span, li, div, td, th, mark, h1, h2, h3, h4, h5, h6, strong, b, em, a) { color: var(--pf-text) !important; }

/* testi neutri scuri dei fogli del tema discente dentro le schede: in scuro seguono il testo del tema */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.dashboard_lg_card, .sidebar__widget, .details_shadow) :is(p, td, li, h1, h2, h3, h4, h5, h6, label, small, dt, dd):not([class*="badge"]):not([class*="apx-"]):not(.btn):not([class*="text-bg"]) { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.dashboard_lg_card, .sidebar__widget, .details_shadow) :is(span, a):not([class*="badge"]):not([class*="apx-"]):not(.btn):not([class*="btn"]):not([class*="pill"]):not(.theme_btn):not(.mc-access-btn):not(.nav-link):not(.required_mark):not(.text-danger):not(.text-success) { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .page-link { background-color: var(--pf-surface) !important; color: var(--pf-text) !important; border-color: var(--pf-border) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .page-item.active .page-link { background-color: var(--pf-action) !important; color: var(--pf-on-action) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .course_overview_description mark { background-color: transparent !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .nice-select .current { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .apx-badge { color: var(--pf-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf):not(#pf) .apx-badge[style*="0f766e" i] { color: #FFFFFF !important; }

html:is(.dark, [data-pf-theme="dark"]):not(#pf) .profile_img span, html:is(.dark, [data-pf-theme="dark"]):not(#pf) .course-item-info .title { color: var(--pf-text) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .cw .t1 { color: #FFFFFF !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is([style*="background:#ecfeff" i], [style*="background: #ecfeff" i]) { background-color: var(--pf-surface-2) !important; }

/* colori di testo in linea (case-insensitive) per stati e accenti: variante chiara dei token */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#dc2626" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #dc2626" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#dc2626" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #dc2626" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#dc2626" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #dc2626" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#ef4444" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #ef4444" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#ef4444" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #ef4444" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#ef4444" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #ef4444" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#b91c1c" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #b91c1c" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#b91c1c" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #b91c1c" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#b91c1c" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #b91c1c" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#dc3545" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #dc3545" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#dc3545" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #dc3545" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#dc3545" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #dc3545" i] { color: var(--pf-err) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#155e75" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #155e75" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#155e75" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #155e75" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#155e75" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #155e75" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#0284c7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #0284c7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#0284c7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #0284c7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#0284c7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #0284c7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#0369a1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #0369a1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#0369a1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #0369a1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#0369a1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #0369a1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#0e7490" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #0e7490" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#0e7490" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #0e7490" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#0e7490" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #0e7490" i] { color: var(--pf-info) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#166534" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #166534" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#166534" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #166534" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#166534" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #166534" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#15803d" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #15803d" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#15803d" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #15803d" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#15803d" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #15803d" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#16a34a" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #16a34a" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#16a34a" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #16a34a" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#16a34a" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #16a34a" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#0f766e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #0f766e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#0f766e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #0f766e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#0f766e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #0f766e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#198754" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #198754" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#198754" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #198754" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#198754" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #198754" i] { color: var(--pf-ok) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#6366f1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #6366f1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#6366f1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #6366f1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#6366f1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #6366f1" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#4f46e5" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #4f46e5" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#4f46e5" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #4f46e5" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#4f46e5" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #4f46e5" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#4338ca" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #4338ca" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#4338ca" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #4338ca" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#4338ca" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #4338ca" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#2563eb" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #2563eb" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#2563eb" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #2563eb" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#2563eb" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #2563eb" i] { color: var(--pf-link) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#92400e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #92400e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#92400e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #92400e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#92400e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #92400e" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#b45309" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #b45309" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#b45309" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #b45309" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#b45309" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #b45309" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color:#a16207" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style^="color: #a16207" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color:#a16207" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=" color: #a16207" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color:#a16207" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*=";color: #a16207" i] { color: var(--pf-warn) !important; }

/* sfondo di stato pieno dato in linea: sfondo e testo coerenti (token chiaro + testo scuro) */
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-ok,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-ok,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-ok)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-ok)"] { background-color: var(--pf-ok) !important; background-image: none !important; color: var(--pf-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-warn,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-warn,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-warn)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-warn)"] { background-color: var(--pf-warn) !important; background-image: none !important; color: var(--pf-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-err,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-err,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-err)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-err)"] { background-color: var(--pf-err) !important; background-image: none !important; color: var(--pf-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-info,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-info,"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background:var(--pf-info)"],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(button, a, span, div, .btn, .primary-btn)[style*="background: var(--pf-info)"] { background-color: var(--pf-info) !important; background-image: none !important; color: var(--pf-bg) !important; }

html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(#monBar, .mon-bar) { background-color: var(--pf-surface) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) .nav-pills .nav-link:not(.active) { color: var(--pf-link) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is(.message_content_view, .messges_info, .message_pre_left) p { color: var(--pf-text-muted) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) :is([style*="background:#e2e8f0" i], [style*="background: #e2e8f0" i], [style*="background-color:#e2e8f0" i], [style*="background-color: #e2e8f0" i]) { background-color: var(--pf-surface-2) !important; }

html:is(.dark, [data-pf-theme="dark"]):not(#pf) .fzp-l b { color: var(--pf-err) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#fef3c7" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #fef3c7" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#fef3c7" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #fef3c7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#fffbeb" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #fffbeb" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#fffbeb" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #fffbeb" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#fff3cd" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #fff3cd" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#fff3cd" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #fff3cd" i] { background-color: var(--pf-warn-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#dcfce7" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #dcfce7" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#dcfce7" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #dcfce7" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#f0fdf4" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #f0fdf4" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#f0fdf4" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #f0fdf4" i] { background-color: var(--pf-ok-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#fee2e2" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #fee2e2" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#fee2e2" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #fee2e2" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#fef2f2" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #fef2f2" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#fef2f2" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #fef2f2" i] { background-color: var(--pf-err-bg) !important; }
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#e0f2fe" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #e0f2fe" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#e0f2fe" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #e0f2fe" i],
html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background:#ecfeff" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background: #ecfeff" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color:#ecfeff" i], html:is(.dark, [data-pf-theme="dark"]):not(#pf) [style*="background-color: #ecfeff" i] { background-color: var(--pf-info-bg) !important; }

html:is(.dark, [data-pf-theme="dark"]):not(#pf) #cw .cw-ev span { color: #FFFFFF !important; }
