/* ==========================================================================
   PromoFAD · Design system · TEMA (componenti e layout)
   Si riempie per fasi: 3 caratteri · 4 responsive · 5 campi · 6 componenti · 7 stato/categoria · 8 schermate.
   Regola: solo aspetto. Nessun selettore che dipenda dalla logica; `!important` solo dove un valore inline lo impone,
   sempre con un commento che dice quale.
   ========================================================================== */

/* ==========================================================================
   FASE 3 · CARATTERI
   Lexend ovunque; Unbounded solo per i titoli principali (h1/h2 e .pf-display), mai in tabelle, modali,
   etichette e pulsanti. Le icone (Font Awesome, Themify, Flaticon, Material, Feather) e il monospazio del
   codice restano con il proprio carattere.
   ========================================================================== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--pf-font-body);
}

/* !important: i vecchi CSS e gli attributi style="" impostano Poppins, Inter, Montserrat, Dosis, Jost, Cerebri, Atkinson… */
html body *:not(i):not(svg):not(svg *):not(code):not(pre):not(kbd):not(samp):not(.material-icons):not([class^="fa"]):not([class*=" fa"]):not([class*="fa-"]):not([class*="ti-"]):not([class*="flaticon"]):not([class*="feather"]):not([class*="mdi"]):not([class*="bi-"]) {
  font-family: var(--pf-font-body) !important;
}

/* numeri che devono restare allineati (tempi, percentuali): stesso carattere, cifre a larghezza fissa al posto del monospazio */
html body :is(.font-monospace, [style*="monospace"], .pf-tabular, time) {
  font-variant-numeric: tabular-nums;
}

/* Titoli principali */
/* :not(#pf-x) non esclude nulla: alza la specificità sopra la regola universale qui sopra */
html body :is(.student-hero-banner h1, .student-hero-banner h2, .ob-hero h1, .pf-display):not(#pf-x):not(:is(table, th, td, label, .modal, .btn, .dropdown-menu) *):not(:is(th, td, label, .btn)) {
  font-family: var(--pf-font-head) !important;
  /* !important: vedi sopra */
  font-optical-sizing: auto;
  letter-spacing: -.01em;
}

/* ==========================================================================
   Specificità: i vecchi CSS (anche quelli dentro le viste) usano spesso `!important` con 2-3 classi.
   Qui ogni regola parte da `html:not(#pf)`: `:not(#pf)` non esclude nulla (nessun elemento ha quell'id)
   ma porta la specificità sopra qualsiasi selettore a sole classi. Dove c'è `!important` è per battere
   un `!important` o uno `style=""` esistente.
   ========================================================================== */

/* ==========================================================================
   FASE 4 · RESPONSIVE FLUIDO
   ========================================================================== */
:root {
  /* scala dei titoli per la piattaforma (più compatta di quella del sito vetrina) */
  --pf-app-h1: clamp(1.25rem, 1.12rem + .55vw, 1.625rem);
  --pf-app-h2: clamp(1.25rem, 1.08rem + .75vw, 1.75rem);
  --pf-app-h3: clamp(1.125rem, 1.02rem + .45vw, 1.375rem);
}

html {
  scroll-behavior: smooth;
}

html:not(#pf) body {
  min-height: 100vh;
  min-height: 100dvh;
  line-height: var(--pf-lh-body);
}

/* sfondo e colore di base a specificità BASSA: le pagine con uno sfondo proprio (scelta azienda, portali, attivazione, login) restano com'erano */
:where(body) {
  background-color: var(--pf-bg);
  color: var(--pf-text);
}

/* :where() = specificità zero: perde contro qualunque regola della pagina, anche se scritta prima */
html:not(#pf) img,
html:not(#pf) video,
html:not(#pf) canvas {
  max-width: 100%;
}

html:not(#pf) .QA_section,
html:not(#pf) .QA_table,
html:not(#pf) .white_box,
html:not(#pf) .main_content,
html:not(#pf) .main_content_iner {
  min-width: 0;
  max-width: 100%;
}

html:not(#pf) .table-responsive,
html:not(#pf) .dataTables_scrollBody {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html:not(#pf) .ob-hero h1 {
  font-size: var(--pf-app-h1);
  line-height: var(--pf-lh-heading);
  letter-spacing: 0;
}

/* gestionale: corpo del testo 13 px (Lexend è più larga del vecchio carattere: a 16 px tutto risultava ingrandito) */
html:not(#pf) body.admin {
  font-size: .8125rem;
  line-height: 1.5;
}

/* margine laterale di pagina fluido */
html:not(#pf) .main_content_padding,
html:not(#pf) .main_content_iner {
  padding-left: var(--pf-page-pad);
  padding-right: var(--pf-page-pad);
}

/* contenuti sempre dentro lo schermo con zoom fino al 400% */
@media (max-width: 575.98px) {
  html:not(#pf) .modal-dialog {
    margin: .5rem;
    max-width: calc(100vw - 1rem);
  }

  html:not(#pf) .dropdown-menu {
    max-width: calc(100vw - 1rem);
  }
}

/* movimento ridotto (WCAG 2.2): niente animazioni per chi lo chiede; i caricamenti restano */
@media (prefers-reduced-motion: reduce) {

  html:not(#pf) *:not(.fa-spin):not(.spinner-border):not(.spinner-grow),
  html:not(#pf) *::before,
  html:not(#pf) *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   FASE 5 · CAMPI DI INPUT: 16 px ovunque (evita lo zoom automatico di Safari su iPhone/iPad)
   ========================================================================== */
/* !important: i campi hanno font-size 12,5-14,5 px nei CSS del tema, nelle varianti -sm e in attributi style */
html:not(#pf) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea, .form-control, .form-control-sm, .form-select, .form-select-sm, .primary-input, .primary_input_field, .theme_search_field input, .nice-select, .nice-select .current, .nice-select .option, .select2-selection__rendered, .select2-search__field, .select2-results__option, .dataTables_filter input, .dataTables_length select, .note-editable, .daterangepicker input, .bootstrap-datetimepicker-widget input) {
  font-size: max(16px, 1rem) !important;
}

/* caselle e radio non hanno testo: il corpo 16 px non cambia l'aspetto, ma li allinea al controllo "campi >= 16 px" */
html:not(#pf) :is(input[type="checkbox"], input[type="radio"]) {
  font-size: max(16px, 1rem);
}

/* aspetto dei campi: bordo ben visibile (>= 3:1), raggio 8, altezza utile al tocco */
html:not(#pf) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea, .form-control, .form-select, .primary-input, .primary_input_field) {
  border: var(--pf-border-w) solid var(--pf-border-strong);
  border-radius: var(--pf-r-sm);
  background-color: var(--pf-surface);
  color: var(--pf-text);
  box-shadow: none;
}

html:not(#pf) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, .form-control, .form-select, .nice-select) {
  min-height: var(--pf-h-md);
}

@media (pointer: coarse) {
  html:not(#pf) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, .form-control, .form-select, .nice-select) {
    min-height: var(--pf-touch);
  }
}

html:not(#pf) :is(input, select, textarea, .form-control, .form-select)::placeholder {
  color: var(--pf-text-muted);
  opacity: 1;
}

html:not(#pf) :is(input, select, textarea, .form-control, .form-select):disabled,
html:not(#pf) :is(input, select, textarea)[readonly] {
  background-color: var(--pf-disabled-bg);
  color: var(--pf-disabled-text);
}

html:not(#pf) :is(input, select, textarea, .form-control, .form-select).is-invalid,
html:not(#pf) .was-validated :invalid {
  border-color: var(--pf-err);
}

html:not(#pf) :is(.nice-select, .select2-selection) {
  border: var(--pf-border-w) solid var(--pf-border-strong) !important;
  border-radius: var(--pf-r-sm) !important;
  background-color: var(--pf-surface);
}

html:not(#pf) label,
html:not(#pf) .primary_input_label {
  font-size: .875rem;
  font-weight: 500;
  color: var(--pf-text);
}

html:not(#pf) :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--pf-action);
}

/* ==========================================================================
   FOCUS VISIBILE (WCAG 2.2) · mai nascosto
   ========================================================================== */
html:not(#pf) :is(a, button, input, select, textarea, summary, [tabindex], .btn, .nice-select):focus-visible {
  outline: 2px solid var(--pf-focus) !important;
  /* !important: il tema toglie l'outline con outline:0 */
  outline-offset: 2px !important;
}

html:not(#pf) :is(input, select, textarea, .form-control, .form-select):focus {
  border-color: var(--pf-focus);
  box-shadow: 0 0 0 3px rgba(5, 99, 240, .25);
}

/* Campi dentro un contenitore che disegna GIÀ bordo e anello di focus (login, ricerca del discente…):
   niente secondo anello/ombra sul campo interno (si vedeva un riquadro dentro il riquadro).
   Il focus resta ben visibile: lo mostra il contenitore con `:focus-within` (bordo blu + alone). */
html:not(#pf) :is(.custom_group_field, .theme_search_field, .category_search .input-group, .cart-quantity) :is(input, textarea, select, .form-control):is(:focus, :focus-visible) {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  /* !important: l'anello globale del campo e quello di Bootstrap */
}

html:not(#pf) :is(.custom_group_field, .theme_search_field, .category_search .input-group, .cart-quantity):focus-within {
  border-color: var(--pf-focus) !important;
  box-shadow: 0 0 0 3px rgba(5, 99, 240, .25) !important;
}

/* ==========================================================================
   FASE 6 · COMPONENTI DI BASE
   ========================================================================== */
/* ---- Pulsanti (misure S/M/L/XL del design system, stati rest/hover/pressed/disabled, niente gradienti né ombre piene) ---- */
html:not(#pf) :is(.btn, .primary-btn, .theme_btn, .point_btn, .theme_line_btn, .btn-start-course, .btn-completed-course) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: var(--pf-h-md);
  padding: 0 var(--pf-px-md);
  font-size: var(--pf-fs-md);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  border-radius: var(--pf-r-sm);
  border-width: var(--pf-border-w);
  border-style: solid;
  background-image: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

html:not(#pf) :is(.btn-sm, .primary-btn.small, .btn.small) {
  min-height: var(--pf-h-sm);
  padding: 0 var(--pf-px-sm);
  font-size: var(--pf-fs-sm);
}

html:not(#pf) :is(.btn-lg, .primary-btn.semi_large, .primary-btn.semi_large2, .theme_btn.btn-lg) {
  min-height: var(--pf-h-lg);
  padding: 0 var(--pf-px-lg);
  font-size: var(--pf-fs-lg);
}

html:not(#pf) :is(.btn-xl, .primary-btn.large) {
  min-height: var(--pf-h-xl);
  padding: 0 var(--pf-px-xl);
  font-size: var(--pf-fs-xl);
}

@media (pointer: coarse) {
  html:not(#pf) :is(.btn-sm, .primary-btn.small) {
    min-height: var(--pf-touch);
  }
}

/* primario: pieno */
html:not(#pf) :is(.btn-primary, .primary-btn, .primary-btn.fix-gr-bg, .theme_btn, .point_btn, .btn-start-course) {
  background-color: var(--pf-action) !important;
  border-color: var(--pf-action) !important;
  color: var(--pf-on-action) !important;
}

html:not(#pf) :is(.btn-primary, .primary-btn, .theme_btn, .point_btn, .btn-start-course):hover {
  background-color: var(--pf-action-hover) !important;
  border-color: var(--pf-action-hover) !important;
  color: var(--pf-on-action) !important;
}

html:not(#pf) :is(.btn-primary, .primary-btn, .theme_btn, .point_btn, .btn-start-course):active {
  background-color: var(--pf-action-pressed) !important;
  border-color: var(--pf-action-pressed) !important;
}

/* secondario: contorno */
html:not(#pf) :is(.btn-outline-primary, .btn-light, .btn-secondary, .theme_line_btn, .btn-default) {
  background-color: transparent !important;
  border-color: var(--pf-action) !important;
  color: var(--pf-link) !important;
}

html:not(#pf) :is(.btn-outline-primary, .btn-light, .btn-secondary, .theme_line_btn, .btn-default):hover {
  background-color: var(--pf-action-soft) !important;
  color: var(--pf-link-hover) !important;
}

/* esiti */
html:not(#pf) .btn-success,
html:not(#pf) .btn-completed-course {
  background-color: var(--pf-ok-bg) !important;
  border-color: var(--pf-ok) !important;
  color: var(--pf-ok) !important;
}

html:not(#pf) .btn-danger {
  background-color: var(--pf-err) !important;
  border-color: var(--pf-err) !important;
  color: #fff !important;
}

html:not(#pf) .btn-warning {
  background-color: var(--pf-warn-bg) !important;
  border-color: var(--pf-warn) !important;
  color: var(--pf-warn) !important;
}

html:not(#pf) :is(.btn, .primary-btn, .theme_btn):disabled,
html:not(#pf) :is(.btn, .primary-btn, .theme_btn).disabled {
  background-color: var(--pf-disabled-bg) !important;
  border-color: var(--pf-border) !important;
  color: var(--pf-disabled-text) !important;
  cursor: not-allowed;
  opacity: 1;
}

/* link */
html:not(#pf) a:not([class]) {
  color: var(--pf-link);
}

html:not(#pf) a:not([class]):hover {
  color: var(--pf-link-hover);
}

/* ---- Card, riquadri, modali ---- */
html:not(#pf) :is(.white_box, .card, .white-box, .kpi-card, .student-course-card, .cert-card, .assigned-course-card, .dropdown-menu, .popover) {
  background-color: var(--pf-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-r-md);
  box-shadow: var(--pf-shadow-sm);
  color: var(--pf-text);
}

html:not(#pf) .modal-content {
  background-color: var(--pf-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-r-lg);
  box-shadow: var(--pf-shadow-lg);
  color: var(--pf-text);
}

html:not(#pf) :is(.modal-header, .modal-footer) {
  border-color: var(--pf-border);
}

html:not(#pf) .modal-backdrop {
  --bs-backdrop-bg: var(--pf-blue-950);
  --bs-backdrop-opacity: .55;
}

/* ---- Tag / badge a pillola (altezza 20, 12 px) ---- */
html:not(#pf) .badge {
  display: inline-flex;
  align-items: center;
  min-height: var(--pf-h-tag);
  padding: 0 var(--pf-px-tag);
  border-radius: var(--pf-r-pill);
  font-size: var(--pf-fs-tag);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

html:not(#pf) .badge:is(.bg-warning, .text-bg-warning) {
  color: #fff !important;
}

/* ---- Tabelle ---- */
html:not(#pf) .table {
  color: var(--pf-text);
  border-color: var(--pf-border);
}

html:not(#pf) .table thead th {
  background-color: var(--pf-surface-2);
  color: var(--pf-text);
  font-size: var(--pf-fs-caption);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--pf-border);
}

html:not(#pf) .table td,
html:not(#pf) .table th {
  border-color: var(--pf-border);
  vertical-align: middle;
}

html:not(#pf) .table tbody tr:hover>td {
  background-color: var(--pf-surface-2);
}

/* ---- Barre di avanzamento: una principale in blu, il significato lo dà l'etichetta ---- */
html:not(#pf) .progress {
  background-color: var(--pf-grey-100);
  border-radius: var(--pf-r-pill);
}

html:not(#pf) .progress-bar {
  background-color: var(--pf-action) !important;
  background-image: none !important;
  border-radius: var(--pf-r-pill);
}

/* ==========================================================================
   FASE 7 · STATO E CATEGORIA: via gradienti e colori d'azione concorrenti
   ========================================================================== */
html:not(#pf) :is(.bg-primary, .text-bg-primary, .badge-primary) {
  background-color: var(--pf-action) !important;
  color: var(--pf-on-action) !important;
}

html:not(#pf) :is(.bg-success, .text-bg-success, .badge-success) {
  background-color: var(--pf-ok, #16794B) !important;
  color: #ffffff !important;
}

html:not(#pf) :is(.bg-warning, .text-bg-warning, .badge-warning) {
  background-color: var(--pf-warn, #B25E09) !important;
  color: #ffffff !important;
}

html:not(#pf) :is(.bg-danger, .text-bg-danger, .badge-danger) {
  background-color: var(--pf-err, #B42318) !important;
  color: #ffffff !important;
}

html:not(#pf) :is(.bg-info, .text-bg-info, .badge-info) {
  background-color: var(--pf-info, #0B6E8E) !important;
  color: #ffffff !important;
}

html:not(#pf) :is(.bg-secondary, .text-bg-secondary, .badge-secondary) {
  background-color: var(--pf-idle, #575653) !important;
  color: #ffffff !important;
}

html:not(#pf) .trash-header :is(.btn-light, .btn-empty-trash) {
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  color: var(--pf-err, #B42318) !important;
  font-weight: 700 !important;
}

html:not(#pf) .trash-header :is(.btn-light, .btn-empty-trash):hover {
  background-color: var(--pf-err-bg, #FDE8E6) !important;
  border-color: #ffffff !important;
  color: var(--pf-err, #B42318) !important;
}

html:not(#pf) .text-primary {
  color: var(--pf-link) !important;
}

html:not(#pf) .text-success {
  color: var(--pf-ok) !important;
}

html:not(#pf) .text-warning {
  color: var(--pf-warn) !important;
}

html:not(#pf) .text-danger {
  color: var(--pf-err) !important;
}

html:not(#pf) .text-info {
  color: var(--pf-info) !important;
}

html:not(#pf) .text-muted {
  color: var(--pf-text-muted) !important;
}

html:not(#pf) .bg-success-subtle {
  background-color: var(--pf-ok-bg) !important;
  color: var(--pf-ok) !important;
}

html:not(#pf) .bg-warning-subtle {
  background-color: var(--pf-warn-bg) !important;
  color: var(--pf-warn) !important;
}

html:not(#pf) .bg-danger-subtle {
  background-color: var(--pf-err-bg) !important;
  color: var(--pf-err) !important;
}

html:not(#pf) .bg-info-subtle {
  background-color: var(--pf-info-bg) !important;
  color: var(--pf-info) !important;
}

/* marcatori di stato e di categoria per le viste (un colore = un solo significato; mai il solo colore: serve testo o icona) */
.pf-status {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  min-height: var(--pf-h-tag);
  padding: 0 var(--pf-px-tag);
  border-radius: var(--pf-r-pill);
  font-size: var(--pf-fs-caption);
  font-weight: 500;
}

.pf-status--ok {
  background: var(--pf-ok-bg);
  color: var(--pf-ok);
}

.pf-status--warn {
  background: var(--pf-warn-bg);
  color: var(--pf-warn);
}

.pf-status--err {
  background: var(--pf-err-bg);
  color: var(--pf-err);
}

.pf-status--info {
  background: var(--pf-info-bg);
  color: var(--pf-info);
}

.pf-status--idle {
  background: var(--pf-idle-bg);
  color: var(--pf-idle);
}

.pf-cat--training {
  color: var(--pf-cat-training);
}

.pf-cat--people {
  color: var(--pf-cat-people);
}

.pf-cat--content {
  color: var(--pf-cat-content);
}

.pf-cat--system {
  color: var(--pf-cat-system);
}

/* ==========================================================================
   FASE 8A · LAYOUT CONDIVISO (topbar, sidebar) E DASHBOARD DISCENTE
   Topbar chiara; sidebar e hero in blu scuro a tinta unita; nessun gradiente decorativo.
   Le viste hanno <style> con !important (gradienti blu, logo bianco, anello colorato dell'avatar):
   si battono qui con `html:not(#pf)`.
   ========================================================================== */

/* ---- Topbar discente ---- */
html:not(#pf) .dashboard_part .header_iner,
html:not(#pf) .header_iner {
  background: var(--pf-topbar-bg) !important;
  background-image: none !important;
  /* !important: gradiente blu nel <style> della vista */
  border-bottom: 1px solid var(--pf-border) !important;
  box-shadow: none !important;
  color: var(--pf-text) !important;
}

html:not(#pf) .header_iner>div:first-child a img {
  filter: none !important;
}

/* logo a colori sul fondo chiaro */
html:not(#pf) .header_iner .notification_wrapper {
  background: var(--pf-surface-2) !important;
  border: 1px solid var(--pf-border) !important;
  border-radius: var(--pf-r-pill) !important;
}

html:not(#pf) .header_iner .category_search .input-group,
html:not(#pf) .header_iner .category_search .theme_search_field {
  background: var(--pf-surface) !important;
  border: var(--pf-border-w) solid var(--pf-border-strong) !important;
  border-radius: var(--pf-r-sm) !important;
  box-shadow: none !important;
}

html:not(#pf) .header_iner .category_search .theme_search_field input {
  color: var(--pf-text) !important;
  -webkit-text-fill-color: var(--pf-text);
  background: transparent !important;
  border: 0 !important;
  min-height: 0;
}

html:not(#pf) .header_iner .category_search .theme_search_field .btn,
html:not(#pf) .header_iner .category_search .theme_search_field .btn i {
  color: var(--pf-link) !important;
  background: transparent !important;
  border: 0 !important;
  min-height: 0;
  padding: 0 .75rem;
}

html:not(#pf) .header_iner :is(.sidebar_icon, .sidebar_icon i) {
  color: var(--pf-heading) !important;
}

/* Aggiorna, tema, lingua: pulsanti della barra, sobri */
html:not(#pf) .pf-rf-btn,
html:not(#pf) .pf-theme-btn,
html:not(#pf) .pf-lang>summary {
  background: var(--pf-surface) !important;
  border: var(--pf-border-w) solid var(--pf-border-strong) !important;
  color: var(--pf-text) !important;
  box-shadow: none !important;
  border-radius: var(--pf-r-sm) !important;
  transform: none !important;
}

html:not(#pf) .pf-rf-btn {
  min-height: var(--pf-h-md);
  font-size: var(--pf-fs-md);
  font-weight: 500;
}

html:not(#pf) .pf-rf-btn .pf-rf-ico {
  background: var(--pf-action) !important;
  box-shadow: none !important;
  border-radius: var(--pf-r-sm);
}

html:not(#pf) :is(.pf-rf-btn, .pf-theme-btn, .pf-lang > summary):hover {
  background: var(--pf-action-soft) !important;
  border-color: var(--pf-action) !important;
}

html:not(#pf) .pf-lang-menu {
  background: var(--pf-surface);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-r-md);
  box-shadow: var(--pf-shadow);
}

html:not(#pf) .pf-lang-menu a {
  color: var(--pf-text);
  border-radius: var(--pf-r-sm);
}

html:not(#pf) .pf-lang-menu a.on {
  background: var(--pf-action-soft);
  color: var(--pf-link-hover);
}

/* ---- Sidebar discente: blu scuro a tinta unita ---- */
html:not(#pf) .sidebar:not(#sidebar),
html:not(#pf) .sidebar:not(#sidebar) .sidebar_iner {
  background: var(--pf-nav-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  /* !important: gradiente del <style> sidebar-pro-v2 */
}

html:not(#pf) .sidebar:not(#sidebar) {
  border-right: 0 !important;
}

html:not(#pf) .sidebar:not(#sidebar) .logo {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, .12) !important;
}

html:not(#pf) .sidebar:not(#sidebar) .sidebar-profile {
  background: transparent !important;
  border: 2px solid var(--pf-blue-200) !important;
  padding: 3px;
  box-shadow: none !important;
}

html:not(#pf) .sidebar:not(#sidebar) .sidebar-profile img {
  border: 0 !important;
}

html:not(#pf) .sidebar:not(#sidebar) .sidebar-user h4 {
  color: var(--pf-nav-text) !important;
}

html:not(#pf) .sidebar:not(#sidebar) .sidebar-user .sb-role {
  background: rgba(255, 255, 255, .1) !important;
  color: var(--pf-nav-text) !important;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  border-radius: var(--pf-r-pill);
  font-size: var(--pf-fs-caption);
}

html:not(#pf) .sidebar:not(#sidebar) .sb-label {
  color: var(--pf-nav-text-muted) !important;
  font-size: var(--pf-fs-caption);
}

html:not(#pf) .sidebar:not(#sidebar) ul li a {
  color: var(--pf-nav-text-muted) !important;
  border-radius: var(--pf-r-sm) !important;
  min-height: var(--pf-touch);
}

html:not(#pf) .sidebar:not(#sidebar) ul li a span {
  color: inherit !important;
  font-size: .875rem !important;
  font-weight: 500 !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a:hover {
  background: var(--pf-nav-active-bg) !important;
  color: var(--pf-nav-text) !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a:hover span {
  color: var(--pf-nav-text) !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a.active {
  background: var(--pf-nav-active-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--pf-nav-text) !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a.active span {
  color: var(--pf-nav-text) !important;
  font-weight: 600 !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a.active::before {
  background: var(--pf-blue-200) !important;
  background-image: none !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a .menu_icon {
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a.active .menu_icon {
  background: var(--pf-action) !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: none !important;
}

html:not(#pf) .sidebar:not(#sidebar) ul li a:hover .menu_icon {
  background: rgba(255, 255, 255, .12) !important;
  color: var(--pf-nav-text) !important;
}

/* ---- Dashboard discente: hero ---- */
html:not(#pf) .student-hero-banner {
  background: var(--pf-hero-bg) !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: var(--pf-r-lg) !important;
  box-shadow: none !important;
  /* !important: gradiente nel <style> della vista */
}

html:not(#pf) .student-hero-banner::before,
html:not(#pf) .student-hero-banner::after {
  display: none !important;
}

/* decorazioni sfumate */
html:not(#pf) .student-hero-banner :is(h2, h1) {
  color: var(--pf-nav-text) !important;
  font-size: var(--pf-app-h1) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

/* !important: font-size inline di 28 px */
html:not(#pf) .student-hero-banner :is(.text-white-50, p) {
  color: var(--pf-nav-text-muted) !important;
}

/* il 50% di bianco su blu scuro sta al limite del contrasto */
html:not(#pf) .hero-user-badge,
html:not(#pf) .hero-user-badge[style] {
  background: rgba(255, 255, 255, .1) !important;
  border: 1px solid rgba(255, 255, 255, .28) !important;
  color: var(--pf-nav-text) !important;
  border-radius: var(--pf-r-pill) !important;
  font-size: var(--pf-fs-caption) !important;
  /* !important: colori inline verde/ambra */
}

html:not(#pf) .student-hero-banner :is(.text-primary, .text-info, .text-success) {
  color: var(--pf-blue-200) !important;
}

html:not(#pf) .student-hero-banner .btn-light {
  background: #fff !important;
  color: var(--pf-blue-800) !important;
  border-color: #fff !important;
}

html:not(#pf) .student-hero-banner .btn-light:hover {
  background: var(--pf-blue-100) !important;
}

/* ---- Dashboard discente: riquadri numerici (un'unica famiglia di tinte, il significato lo dà l'etichetta) ---- */
html:not(#pf) .kpi-card {
  padding: var(--pf-s-5);
  gap: var(--pf-s-4);
}

html:not(#pf) .kpi-card:hover {
  transform: none !important;
  box-shadow: var(--pf-shadow) !important;
}

html:not(#pf) .kpi-icon-wrap,
html:not(#pf) .kpi-icon-wrap[style] {
  background: var(--pf-action-soft) !important;
  background-image: none !important;
  color: var(--pf-blue-600) !important;
  border: 1px solid var(--pf-blue-200) !important;
  box-shadow: none !important;
  border-radius: var(--pf-r-md) !important;
  /* !important: gradienti e colori inline (quattro tinte diverse) */
}

html:not(#pf) .row>div:nth-child(2) .kpi-icon-wrap {
  background: var(--pf-info-bg) !important;
  color: var(--pf-info) !important;
  border-color: transparent !important;
}

html:not(#pf) .row>div:nth-child(3) .kpi-icon-wrap {
  background: var(--pf-ok-bg) !important;
  color: var(--pf-ok) !important;
  border-color: transparent !important;
}

html:not(#pf) .kpi-value {
  color: var(--pf-heading) !important;
  font-weight: 700 !important;
}

html:not(#pf) .kpi-label {
  color: var(--pf-text-muted) !important;
  font-size: .875rem !important;
}

/* ---- Dashboard discente: card dei corsi ---- */
html:not(#pf) .student-course-card:hover {
  transform: none !important;
  box-shadow: var(--pf-shadow) !important;
  border-color: var(--pf-blue-200) !important;
}

html:not(#pf) .course-card-thumb::after {
  background: linear-gradient(180deg, rgba(1, 19, 46, 0) 40%, rgba(1, 19, 46, .55) 100%) !important;
}

/* velo di leggibilità sulla foto, non decorativo */
html:not(#pf) .course-type-pill,
html:not(#pf) .course-status-pill {
  border-radius: var(--pf-r-pill) !important;
  font-size: var(--pf-fs-caption) !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

html:not(#pf) .course-card-title,
html:not(#pf) .course-card-title a {
  color: var(--pf-heading) !important;
  font-weight: 600 !important;
}

html:not(#pf) .course-card-title a:hover {
  color: var(--pf-link) !important;
}

html:not(#pf) .progress-box-fad {
  background: var(--pf-surface-2) !important;
  border: 1px solid var(--pf-border) !important;
  border-radius: var(--pf-r-md) !important;
}

html:not(#pf) .btn-start-course {
  width: auto;
}

html:not(#pf) .cert-card:hover {
  transform: none !important;
  border-color: var(--pf-blue-200) !important;
}

/* ---- Sfondo e contenitore della pagina discente ---- */
html:not(#pf) .dashboard_part,
html:not(#pf) .main_content.dashboard_part {
  background: var(--pf-bg) !important;
  background-image: none !important;
}

/* ==========================================================================
   FASE 8D (parte comune) · GESTIONALE: sidebar blu scuro a tinta unita, topbar chiara
   ========================================================================== */
html:not(#pf) #sidebar,
html:not(#pf) .sidebar-header {
  background: var(--pf-nav-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  /* !important: gradiente e box-shadow nel componente backend-dynamic-color */
}

html:not(#pf) #sidebar {
  border-right: 0 !important;
}

html:not(#pf) .sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, .12) !important;
}

html:not(#pf) #sidebar_menu li>a {
  color: var(--pf-nav-text-muted) !important;
  border-radius: var(--pf-r-sm);
  min-height: var(--pf-touch);
}

html:not(#pf) #sidebar_menu li>a .nav_title span {
  color: inherit !important;
  font-size: .875rem;
  font-weight: 500;
}

html:not(#pf) #sidebar_menu li>a:hover,
html:not(#pf) #sidebar_menu li.mm-active>a {
  background: var(--pf-nav-active-bg) !important;
  color: var(--pf-nav-text) !important;
  box-shadow: none !important;
}

html:not(#pf) #sidebar_menu li.mm-active>a .nav_title span,
html:not(#pf) #sidebar_menu li>a:hover .nav_title span {
  color: var(--pf-nav-text) !important;
  font-weight: 600;
}

/* icone del menu: tutte nello stesso tono (erano multicolore); quella attiva su fondo blu */
html:not(#pf) #sidebar_menu .nav_icon_small {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: var(--pf-r-sm);
}

html:not(#pf) #sidebar_menu .nav_icon_small :is(span, i) {
  color: var(--pf-nav-text-muted) !important;
}

/* !important: classi text-info, text-purple, text-warning… */
html:not(#pf) #sidebar_menu li.mm-active>a .nav_icon_small {
  background: var(--pf-action) !important;
}

html:not(#pf) #sidebar_menu li.mm-active>a .nav_icon_small :is(span, i) {
  color: #fff !important;
}

html:not(#pf) #sidebar_menu .menu_seperator,
html:not(#pf) #sidebar .menu_seperator {
  color: var(--pf-nav-text-muted) !important;
  font-size: var(--pf-fs-caption);
  letter-spacing: .08em;
}

html:not(#pf) #sidebar_menu ul li a {
  color: var(--pf-nav-text-muted) !important;
}

html:not(#pf) #sidebar_menu ul li a:hover {
  color: var(--pf-nav-text) !important;
}

/* topbar gestionale */
html:not(#pf) #main-nav-for-chat .header_iner {
  background: var(--pf-topbar-bg) !important;
  border-bottom: 1px solid var(--pf-border);
  box-shadow: none;
}

html:not(#pf) .admin .sidebar_icon i,
html:not(#pf) .admin .collaspe_icon i {
  color: var(--pf-heading);
}

/* titolo di pagina e briciole */
html:not(#pf) .sms-breadcrumb {
  background: transparent;
}

html:not(#pf) .sms-breadcrumb h1 {
  color: var(--pf-heading);
}

/* ==========================================================================
   FASE 8B · LOGIN (riferimento visivo: "Accesso a PromoFAD")
   Solo aspetto: stessi testi, stessi campi, stesso form (action, method, @csrf, name, id), stessa logica.
   Desktop (>= 900 px): un'unica scheda a due pannelli, modulo a sinistra e immagine a destra su blu scuro.
   Mobile: immagine sopra, scheda del modulo sotto. Campi a 16 px, bersagli >= 44 px, focus visibile.
   Mappatura sul markup esistente: scheda = .login_wrapper · modulo = .login_wrapper_left · immagine = .login_wrapper_right.
   ========================================================================== */
html:not(#pf) body:has(.login_wrapper) {
  background: var(--pf-blue-800) !important;
  background-image: none !important;
  color: var(--pf-text) !important;
  /* !important: sfondo scuro con foto nel <style> della vista */
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  /* il margin:auto della scheda la centra senza tagliarla in alto */
  min-height: 100vh !important;
  min-height: 100dvh !important;
  padding: clamp(.75rem, 2.5vh, 2rem) clamp(1rem, 3vw, 3.5rem) !important;
  overflow-y: auto !important;
}

html:not(#pf) .login_wrapper {
  width: 100% !important;
  max-width: 1080px !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: clamp(1rem, 2.5vw, 1.25rem);
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ---- Pannello del modulo ---- */
html:not(#pf) .login_wrapper .login_wrapper_left,
html:not(#pf) .login_wrapper_left {
  background: var(--pf-bg) !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 36px rgba(1, 19, 46, .35) !important;
  padding: clamp(1.25rem, 0.6rem + 3vw, 3rem) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: clamp(.75rem, 1.6vh + .25rem, 1.5rem);
  width: 100% !important;
  align-self: stretch !important;
  height: auto !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

html:not(#pf) .login_wrapper_left .logo {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  justify-content: flex-start !important;
}

html:not(#pf) .login_wrapper_left .logo img,
html:not(#pf) .login-logo-img {
  max-height: 44px !important;
  width: auto !important;
  max-width: 220px !important;
  height: auto !important;
}

html:not(#pf) .mobile-hero-card {
  display: none !important;
}

/* l'immagine è nel pannello .login_wrapper_right, anche su mobile */
html:not(#pf) .login_wrapper_left .login_wrapper_content {
  display: flex !important;
  flex-direction: column;
  gap: clamp(.625rem, 1.4vh + .2rem, 1.25rem);
  padding: 0 !important;
  margin: 0 !important;
  width: 100%;
}

html:not(#pf) .login_wrapper_left .login_wrapper_content h4 {
  margin: 0 !important;
  font-family: var(--pf-font-head) !important;
  font-weight: 700 !important;
  font-size: clamp(1.125rem, 0.95rem + 0.8vw, 1.375rem) !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  color: var(--pf-heading) !important;
  text-align: left !important;
  /* !important: Dosis, colore chiaro e dimensioni nel <style> della vista */
}

html:not(#pf) .login_wrapper_left .login_wrapper_content h4 sup {
  font-size: .7em;
  line-height: 0;
}

html:not(#pf) .login_wrapper_left .login_wrapper_content .login_sub_title {
  margin: .5rem 0 0 !important;
  font-size: clamp(.875rem, .84rem + .2vw, .9375rem) !important;
  line-height: 1.6 !important;
  color: var(--pf-text) !important;
  text-align: left !important;
}

html:not(#pf) .login_wrapper form#loginForm,
html:not(#pf) .login_wrapper #loginForm {
  display: block;
  margin: 0 !important;
}

html:not(#pf) .login_wrapper form .row {
  display: flex !important;
  flex-direction: column;
  margin: 0 !important;
  gap: .75rem;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}

html:not(#pf) .login_wrapper form .row>[class*="col-"] {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
}

html:not(#pf) .login_wrapper form .row>[class*="col-"]:not(:has(*)) {
  display: none !important;
}

/* colonna vuota del captcha quando è disattivato */
html:not(#pf) .login_wrapper .mt_20,
html:not(#pf) .login_wrapper form .mt-2 {
  margin-top: 0 !important;
}

/* campi: altezza 52, bordo 1,5 px (>= 3:1), raggio 12, icona a sinistra */
html:not(#pf) .custom_group_field {
  min-height: 52px;
  height: 52px;
  display: flex !important;
  align-items: center;
  flex-wrap: nowrap !important;
  position: relative;
  background: var(--pf-surface) !important;
  border: 1.5px solid var(--pf-border-strong) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  overflow: visible;
}

html:not(#pf) .custom_group_field:hover {
  border-color: var(--pf-text-muted) !important;
}

html:not(#pf) .custom_group_field:focus-within {
  border-color: var(--pf-focus) !important;
  box-shadow: 0 0 0 3px var(--pf-action-soft) !important;
}

html:not(#pf) .custom_group_field .input-group-prepend,
html:not(#pf) .custom_group_field .input-group-text {
  background: transparent !important;
  border: 0 !important;
  padding: 0 0 0 16px !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  height: 100%;
  color: var(--pf-text-muted) !important;
}

html:not(#pf) .custom_group_field .input-group-text svg,
html:not(#pf) .custom_group_field .input-group-text svg path {
  fill: var(--pf-text-muted) !important;
  width: 20px;
  height: 20px;
}

html:not(#pf) .custom_group_field:focus-within .input-group-text svg,
html:not(#pf) .custom_group_field:focus-within .input-group-text svg path {
  fill: var(--pf-link) !important;
}

html:not(#pf) .custom_group_field .form-control {
  flex: 1 1 auto;
  height: 100% !important;
  min-height: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 16px 0 12px !important;
  color: var(--pf-text) !important;
  -webkit-text-fill-color: var(--pf-text);
}

html:not(#pf) .custom_group_field .form-control::placeholder {
  color: var(--pf-text-muted) !important;
  -webkit-text-fill-color: var(--pf-text-muted);
  opacity: 1;
}

/* !important su position/transform/top/right: l'HTML ha style="position:absolute; top:50%; transform:translateY(-50%)" che la spostava fuori dal campo */
html:not(#pf) .btn-toggle-password {
  position: static !important;
  transform: none !important;
  top: auto !important;
  right: auto !important;
  flex: 0 0 44px;
  width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 4px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--pf-link) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

html:not(#pf) .btn-toggle-password:hover {
  background: var(--pf-action-soft) !important;
  color: var(--pf-link-hover) !important;
}

html:not(#pf) .btn-toggle-password svg {
  width: 20px !important;
  height: 20px !important;
  fill: none !important;
  stroke: currentColor !important;
}

html:not(#pf) .btn-toggle-password svg * {
  fill: none !important;
}

/* ricordami, forza l'accesso, password dimenticata */
html:not(#pf) .remember_forgot_pass {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start !important;
  gap: .25rem 1.5rem !important;
  font-size: .875rem;
  margin: 0 !important;
  width: 100%;
}

html:not(#pf) .remember_forgot_pass .primary_checkbox {
  position: relative;
  min-height: 44px;
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--pf-text) !important;
  cursor: pointer;
}

html:not(#pf) .remember_forgot_pass .primary_checkbox input[type="checkbox"] {
  position: absolute !important;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
  z-index: 1;
}

/* riga delle opzioni: "Ricordami" a sinistra e "Password dimenticata?" a destra sulla stessa riga; "Forza l'Accesso" sotto */
html:not(#pf) .remember_forgot_pass {
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0;
  margin: 0 !important;
  width: 100%;
}

html:not(#pf) .remember_forgot_pass>label:nth-of-type(1) {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

html:not(#pf) .remember_forgot_pass>.forgot_pass {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

html:not(#pf) .remember_forgot_pass>label:nth-of-type(2) {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
}

/* caselle: quadrato 20 px, bordo ben visibile; selezionata = blu pieno con spunta bianca (disegnata dallo sfondo, senza pseudo-elementi) */
html:not(#pf) .remember_forgot_pass .primary_checkbox {
  gap: .625rem !important;
}

html:not(#pf) .remember_forgot_pass .primary_checkbox .checkmark {
  position: relative !important;
  flex: 0 0 20px;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  top: auto !important;
  left: auto !important;
  display: inline-block !important;
  box-sizing: border-box;
  border: 1.5px solid var(--pf-border-strong) !important;
  border-radius: 5px !important;
  background: var(--pf-surface) !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background-color .12s ease, border-color .12s ease;
}

html:not(#pf) .remember_forgot_pass .primary_checkbox .checkmark::before,
html:not(#pf) .remember_forgot_pass .primary_checkbox .checkmark::after {
  display: none !important;
  content: none !important;
}

html:not(#pf) .remember_forgot_pass .primary_checkbox:hover .checkmark {
  border-color: var(--pf-action) !important;
}

html:not(#pf) .remember_forgot_pass .primary_checkbox input:checked~.checkmark {
  background: var(--pf-action) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") no-repeat center / 14px 14px !important;
  border-color: var(--pf-action) !important;
}

html:not(#pf) .remember_forgot_pass .primary_checkbox input:focus-visible~.checkmark {
  outline: 2px solid var(--pf-focus);
  outline-offset: 2px;
}

/* link: a destra, senza sottolineatura finché non si passa sopra */
html:not(#pf) .remember_forgot_pass .forgot_pass {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none !important;
  color: var(--pf-link) !important;
}

html:not(#pf) .remember_forgot_pass .forgot_pass:hover {
  text-decoration: underline !important;
  color: var(--pf-link-hover) !important;
}

html:not(#pf) .remember_forgot_pass .label_name,
html:not(#pf) .remember_forgot_pass .label_name[style] {
  color: var(--pf-text) !important;
  font-size: .875rem !important;
  font-weight: 400 !important;
}

/* !important: lo stile in linea di "Forza l'Accesso" è viola chiaro (contrasto insufficiente) */
html:not(#pf) .remember_forgot_pass .forgot_pass {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--pf-link-on-band, var(--pf-link)) !important;
  font-weight: 500;
  text-decoration: underline;
}

html:not(#pf) .remember_forgot_pass .forgot_pass:hover {
  color: var(--pf-link-hover) !important;
}

/* pulsante Accedi: altezza 52, primario */
html:not(#pf) .login_wrapper_left .theme_btn,
html:not(#pf) .login_wrapper_left button[type="submit"] {
  width: 100%;
  min-height: 52px;
  height: 52px;
  border-radius: 12px !important;
  background: var(--pf-action) !important;
  border: 0 !important;
  color: var(--pf-on-action) !important;
  box-shadow: none !important;
  transform: none !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase;
  padding: 0 1rem !important;
}

html:not(#pf) .login_wrapper_left .theme_btn:hover,
html:not(#pf) .login_wrapper_left button[type="submit"]:hover {
  background: var(--pf-action-hover) !important;
}

html:not(#pf) .login_wrapper_left .theme_btn:active,
html:not(#pf) .login_wrapper_left button[type="submit"]:active {
  background: var(--pf-action-pressed) !important;
}

/* accessi social e demo: secondari */
html:not(#pf) .login_wrapper_left .theme_btn.small_btn2 {
  background: transparent !important;
  border: 1.5px solid var(--pf-action) !important;
  color: var(--pf-link) !important;
  height: auto;
  min-height: 44px;
  font-size: .875rem !important;
  letter-spacing: 0 !important;
  text-transform: none;
}

html:not(#pf) .login_wrapper_left .theme_btn.small_btn2:hover {
  background: var(--pf-action-soft) !important;
}

html:not(#pf) .shitch_text {
  margin: 0 !important;
  font-size: .875rem !important;
  color: var(--pf-text) !important;
  text-align: center;
}

html:not(#pf) .shitch_text a {
  color: var(--pf-link) !important;
  font-weight: 500;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* versione (il blocco ha stili in linea): testo piccolo centrato, senza riquadro */
html:not(#pf) .login_wrapper_left>div.text-center.border-top {
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  align-self: center;
}

html:not(#pf) .login_wrapper_left>div.text-center.border-top .badge {
  background: transparent !important;
  border: 0 !important;
  color: var(--pf-text-muted) !important;
  font-size: var(--pf-fs-caption) !important;
  font-weight: 400 !important;
  padding: 0 !important;
  white-space: normal;
  text-align: center;
}

html:not(#pf) .login_wrapper_left>div.text-center.border-top .badge i {
  display: none;
}

/* ---- Pannello dell'immagine ---- */
html:not(#pf) .login_wrapper_right {
  order: -1;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  width: 100% !important;
  flex: none !important;
  padding: 0 !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  overflow: visible !important;
  position: static !important;
  /* !important: gradiente viola con foto nel <style> della vista */
}

html:not(#pf) .login_main_info {
  display: contents;
}

html:not(#pf) .login_main_info h4,
html:not(#pf) .login_main_info .other_links,
html:not(#pf) .login_main_info>div.text-center {
  display: none !important;
}

/* su mobile resta solo l'immagine */
html:not(#pf) .login_main_info .thumb {
  margin: 0 !important;
  width: 100% !important;
  max-width: none;
  padding: 0 !important;
  background: transparent !important;
}

html:not(#pf) .login_main_info .thumb img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px !important;
  box-shadow: none !important;
  transform: none !important;
  max-width: 100%;
}

/* ---- Desktop: una scheda, due pannelli ---- */
@media (min-width: 900px) {
  html:not(#pf) body:has(.login_wrapper) {
    background: var(--pf-blue-900) !important;
  }

  html:not(#pf) .login_wrapper {
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 0;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 24px 56px rgba(1, 19, 46, .45) !important;
    min-height: min(680px, calc(100dvh - 2 * clamp(.75rem, 2.5vh, 2rem)));
    max-height: calc(100dvh - 2 * clamp(.75rem, 2.5vh, 2rem));
    height: auto !important;
  }

  html:not(#pf) .login_wrapper .login_wrapper_left,
  html:not(#pf) .login_wrapper_left {
    flex: 0 0 clamp(420px, 48%, 520px) !important;
    width: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: clamp(1.25rem, 3.4vh, 3rem) clamp(1.5rem, 1rem + 2.5vw, 3rem) !important;
    overflow-y: auto !important;
  }

  html:not(#pf) .login_wrapper_right {
    order: 0;
    flex: 1 1 0 !important;
    min-width: 0;
    align-self: stretch !important;
    height: auto !important;
    margin: 0 !important;
    background: var(--pf-blue-800) !important;
    padding: clamp(1.25rem, 3vh, 2.5rem) clamp(1.5rem, 3vw, 2.5rem) !important;
    box-sizing: border-box;
    overflow: hidden !important;
  }

  html:not(#pf) .login_main_info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    width: 100%;
    max-width: 440px;
  }

  html:not(#pf) .login_main_info h4 {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 0 !important;
    max-width: 25rem;
    text-align: center !important;
    font-family: var(--pf-font-head) !important;
    font-weight: 700 !important;
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.1875rem) !important;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
    color: #fff !important;
  }

  html:not(#pf) .login_main_info h4::before {
    content: "";
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: var(--pf-blue-200);
  }

  html:not(#pf) .login_main_info .thumb img {
    border-radius: 16px !important;
    box-shadow: 0 16px 36px rgba(1, 19, 46, .4) !important;
  }

  html:not(#pf) .login_main_info .other_links {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem 1rem;
    margin: 0 !important;
  }

  html:not(#pf) .login_main_info .other_links span {
    color: var(--pf-blue-200) !important;
    font-size: var(--pf-fs-caption) !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
  }

  html:not(#pf) .login_main_info>div.text-center {
    display: block !important;
    font-size: var(--pf-fs-caption) !important;
    line-height: 1.4;
    color: var(--pf-blue-200) !important;
    opacity: 1 !important;
  }

  html:not(#pf) .login_main_info>div.text-center i {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not(#pf) .login_wrapper_left .theme_btn {
    transition: none;
  }
}


/* ---- Pannello destro (desktop), versione 3 ----
   Titolo e versione sono già nel modulo a sinistra: qui restano la foto (intera, senza ritagli né filtri) e gli slogan, in una sola riga.
   Sfondo piatto con due cerchi a contorno sottile (nessun gradiente); la foto ha una cornice doppia. */
@media (min-width: 900px) {
  html:not(#pf) .login_wrapper_right {
    position: relative !important;
    overflow: hidden !important;
    background: var(--pf-blue-800) !important;
  }

  html:not(#pf) .login_wrapper_right::before,
  html:not(#pf) .login_wrapper_right::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    border: 1px solid rgba(175, 206, 253, .14);
    background: transparent;
    clip-path: none;
  }

  html:not(#pf) .login_wrapper_right::before {
    width: 560px;
    height: 560px;
    right: -230px;
    top: -230px;
    box-shadow: inset 0 0 0 70px rgba(175, 206, 253, .03);
  }

  html:not(#pf) .login_wrapper_right::after {
    width: 420px;
    height: 420px;
    left: -190px;
    bottom: -190px;
    box-shadow: inset 0 0 0 54px rgba(175, 206, 253, .03);
  }

  html:not(#pf) .login_main_info {
    position: relative;
    z-index: 1;
    max-width: 500px;
    gap: 2rem;
    width: 100%;
  }

  html:not(#pf) .login_main_info h4,
  html:not(#pf) .login_main_info>div.text-center {
    display: none !important;
  }

  /* già presenti a sinistra */
  html:not(#pf) .login_main_info .thumb {
    position: relative;
    width: 100% !important;
    margin: 0 !important;
  }

  html:not(#pf) .login_main_info .thumb::before {
    content: "";
    position: absolute;
    inset: -12px;
    border: 1px solid rgba(175, 206, 253, .22);
    border-radius: 26px;
    pointer-events: none;
  }

  html:not(#pf) .login_main_info .thumb img {
    aspect-ratio: auto !important;
    object-fit: contain;
    width: 100% !important;
    height: auto !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 48px rgba(1, 19, 46, .5) !important;
    border: 1px solid rgba(175, 206, 253, .25);
  }

  html:not(#pf) .login_main_info .other_links {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0 !important;
    margin: 0 !important;
    padding-top: 1.25rem;
    width: 100%;
    border-top: 1px solid rgba(175, 206, 253, .2);
  }

  html:not(#pf) .login_main_info .other_links span {
    display: inline-flex !important;
    align-items: center;
    flex: 1 1 0;
    justify-content: center;
    padding: 0 .75rem !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #fff !important;
    font-size: .8125rem !important;
    font-weight: 500 !important;
    line-height: 1.2;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  html:not(#pf) .login_main_info .other_links span+span {
    border-left: 1px solid rgba(175, 206, 253, .3) !important;
  }

  html:not(#pf) .login_main_info .other_links span::before {
    display: none;
  }
}

/* ---- Login · schermi stretti (fino a 320 px e zoom 400%) ----
   Nessuno scroll orizzontale, campi sempre a 16 px e alti 52 px, bersagli >= 44 px. Il vecchio CSS della vista, sotto i 400 px,
   riduce campi (42 px) e testo (12-13 px) con !important: qui si riporta tutto ai valori del design system. */
html:not(#pf) .login_wrapper,
html:not(#pf) .login_wrapper_left,
html:not(#pf) .login_wrapper_right,
html:not(#pf) .login_wrapper_content {
  min-width: 0;
  max-width: 100%;
}

html:not(#pf) .login_wrapper_left .login_wrapper_content h4,
html:not(#pf) .login_wrapper_left .login_wrapper_content .login_sub_title,
html:not(#pf) .remember_forgot_pass .label_name {
  overflow-wrap: anywhere;
}

html:not(#pf) .custom_group_field .form-control {
  min-width: 0;
  text-overflow: ellipsis;
}

html:not(#pf) .custom_group_field .form-control::placeholder {
  font-size: max(16px, 1rem) !important;
}

@media (max-width: 575.98px) {
  html:not(#pf) body:has(.login_wrapper) {
    padding: .75rem !important;
    justify-content: flex-start !important;
  }

  html:not(#pf) .login_wrapper {
    gap: .75rem;
  }

  html:not(#pf) .login_wrapper .login_wrapper_left,
  html:not(#pf) .login_wrapper_left {
    padding: 1.25rem 1rem !important;
    border-radius: 16px !important;
  }

  html:not(#pf) .login_main_info .thumb img {
    border-radius: 12px !important;
  }

  html:not(#pf) .login_wrapper_left .login_wrapper_content h4 {
    text-align: left !important;
    font-size: clamp(1.0625rem, .98rem + .5vw, 1.1875rem) !important;
    margin: 0 !important;
  }

  html:not(#pf) .login_wrapper_left .login_wrapper_content .login_sub_title {
    text-align: left !important;
    font-size: .875rem !important;
    margin: .375rem 0 0 !important;
  }

  html:not(#pf) .login_wrapper_left .logo {
    text-align: left !important;
  }

  html:not(#pf) .login_wrapper_left .logo img,
  html:not(#pf) .login-logo-img {
    max-height: 40px !important;
    max-width: 180px !important;
  }
}

@media (max-width: 420px) {

  /* opzioni in colonna: "Ricordami", "Forza l'Accesso", "Password dimenticata?" */
  html:not(#pf) .remember_forgot_pass {
    grid-template-columns: 1fr;
  }

  html:not(#pf) .remember_forgot_pass>label:nth-of-type(1),
  html:not(#pf) .remember_forgot_pass>label:nth-of-type(2) {
    grid-column: 1;
  }

  html:not(#pf) .remember_forgot_pass>label:nth-of-type(1) {
    grid-row: 1;
  }

  html:not(#pf) .remember_forgot_pass>label:nth-of-type(2) {
    grid-row: 2;
  }

  html:not(#pf) .remember_forgot_pass>.forgot_pass {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  html:not(#pf) .custom_group_field {
    height: 52px !important;
    min-height: 52px !important;
  }

  /* !important: il vecchio CSS porta il campo a 42 px */
  html:not(#pf) .custom_group_field .form-control {
    font-size: max(16px, 1rem) !important;
  }

  html:not(#pf) .login_wrapper_left .theme_btn,
  html:not(#pf) .login_wrapper_left button[type="submit"] {
    font-size: .9375rem !important;
    letter-spacing: .04em !important;
  }
}

@media (max-width: 359.98px) {
  html:not(#pf) body:has(.login_wrapper) {
    padding: .5rem !important;
  }

  html:not(#pf) .login_wrapper .login_wrapper_left,
  html:not(#pf) .login_wrapper_left {
    padding: 1rem .875rem !important;
  }

  html:not(#pf) .custom_group_field .input-group-prepend,
  html:not(#pf) .custom_group_field .input-group-text {
    padding-left: 12px !important;
  }

  html:not(#pf) .custom_group_field .form-control {
    padding-left: 8px !important;
  }

  html:not(#pf) .login_wrapper_left .login_wrapper_content h4 {
    font-size: 1rem !important;
  }
}

/* ---- Login · mobile e tablet (< 900 px): pannelli impilati, ognuno alto quanto il proprio contenuto ----
   Il vecchio CSS dà ai due pannelli `flex: 0.95` e `flex: 1.15` con !important: in colonna facevano gonfiare il pannello dell'immagine
   e lasciavano un grande vuoto blu tra foto e modulo. Qui si azzerano altezze e crescita. */
@media (max-width: 899.98px) {
  html:not(#pf) body:has(.login_wrapper) {
    justify-content: flex-start !important;
    align-items: center !important;
  }

  html:not(#pf) .login_wrapper {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
    margin: 0 auto !important;
  }

  html:not(#pf) .login_wrapper_right {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    align-self: stretch !important;
    margin: 0 !important;
    justify-content: flex-start !important;
    padding: 0 !important;
  }

  html:not(#pf) .login_wrapper_left,
  html:not(#pf) .login_wrapper .login_wrapper_left {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html:not(#pf) .login_main_info {
    max-width: none !important;
  }

  html:not(#pf) .login_main_info .thumb {
    margin: 0 !important;
  }

  html:not(#pf) .login_main_info .thumb img {
    max-height: none !important;
  }

  html:not(#pf) .login_wrapper_left .login_wrapper_content h4 {
    text-wrap: balance;
  }
}

/* orientamento orizzontale su telefono (altezza ridotta): niente immagine, il modulo sta in una schermata */
@media (max-height: 520px) and (max-width: 899.98px) {
  html:not(#pf) .login_wrapper_right {
    display: none !important;
  }
}

/* finestre della pagina di accesso (reimposta password, dispositivi…) */
html:not(#pf) body:has(.login_wrapper) .modal-content {
  background: var(--pf-surface) !important;
  color: var(--pf-text) !important;
  border: 1px solid var(--pf-border) !important;
}

html:not(#pf) body:has(.login_wrapper) .modal-content :is(.modal-title, h4, h5, label) {
  color: var(--pf-heading) !important;
}

html:not(#pf) body:has(.login_wrapper) .modal-content .text-muted {
  color: var(--pf-text-muted) !important;
}

/* ==========================================================================
   FASE 8B · ATTIVAZIONE ACCOUNT (stessa struttura a passi, nuovi token)
   La pagina ha le proprie variabili (--brand, --ok…): si riallineano ai token, solo qui.
   ========================================================================== */
html:has(.ob-wrap) {
  --bg: var(--pf-bg);
  --card: var(--pf-surface);
  --ink: var(--pf-text);
  --muted: var(--pf-text-muted);
  --line: var(--pf-border);
  --brand: var(--pf-action);
  --brand-dark: var(--pf-blue-800);
  --brand-soft: var(--pf-action-soft);
  --ok: var(--pf-ok);
  --err: var(--pf-err);
  --warn: var(--pf-warn);
}

html:not(#pf) body:has(.ob-wrap) {
  background: var(--pf-bg) !important;
  background-image: none !important;
}

html:not(#pf) .ob-banner {
  background: var(--pf-hero-bg) !important;
  background-image: none !important;
}

/* !important: gradienti e aloni nel <style> della vista */
html:not(#pf) .ob-banner::before,
html:not(#pf) .ob-banner::after {
  display: none !important;
}

html:not(#pf) .ob-hero h1 {
  font-size: var(--pf-app-h1) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

html:not(#pf) .ob-lang a.on {
  color: var(--pf-blue-800);
}

html:not(#pf) .btn-p {
  background: var(--pf-action) !important;
  background-image: none !important;
  color: var(--pf-on-action) !important;
  box-shadow: none !important;
  transform: none !important;
  border-radius: var(--pf-r-sm) !important;
}

html:not(#pf) .btn-p:hover {
  background: var(--pf-action-hover) !important;
}

html:not(#pf) .btn-g {
  border-radius: var(--pf-r-sm) !important;
  border: var(--pf-border-w) solid var(--pf-border-strong) !important;
}

html:not(#pf) .btn-s {
  background: var(--pf-ok) !important;
  color: #fff !important;
  border-radius: var(--pf-r-sm) !important;
}

html:not(#pf) .ob-wrap .in {
  border: var(--pf-border-w) solid var(--pf-border-strong) !important;
  border-radius: var(--pf-r-sm) !important;
  background: var(--pf-surface) !important;
  color: var(--pf-text) !important;
}

html:not(#pf) .in:focus {
  border-color: var(--pf-focus) !important;
  box-shadow: 0 0 0 3px rgba(5, 99, 240, .25) !important;
}

html:not(#pf) .mcard {
  border-radius: var(--pf-r-md) !important;
}

html:not(#pf) .mcard.on {
  border-color: var(--pf-action) !important;
  background: var(--pf-action-soft) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   FASE 8C/8D · DECORAZIONI DA TOGLIERE (aloni sfumati dietro le pagine, effetti di sollevamento)
   ========================================================================== */
html:not(#pf) .student-dashboard-wrapper {
  background-image: none !important;
}

/* !important: aloni radiali indaco/ciano nel <style> della vista */
html:not(#pf) :is(.student-course-card, .assigned-course-card, .kpi-card, .cert-card, .white_box):hover {
  transform: none !important;
}

/* sfondi a quaderno / pattern decorativi dietro i contenuti */
html:not(#pf) .main_content.dashboard_part,
html:not(#pf) .dashboard_part {
  background-image: none !important;
}

/* ==========================================================================
   TOPBAR DEL GESTIONALE · rifinitura
   Tutti i controlli alti 40 px, allineati al centro, bordi leggeri; le icone sono pulsanti quadrati uguali.
   ========================================================================== */
html:not(#pf) #main-nav-for-chat .header_iner {
  min-height: 64px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  align-items: center !important;
  gap: 12px;
  background: var(--pf-topbar-bg) !important;
  border-bottom: 1px solid var(--pf-border) !important;
  box-shadow: none !important;
}

html:not(#pf) #main-nav-for-chat .header_iner>.d-flex.align-items-center:not(.header_right) {
  gap: 12px;
}

/* ricerca */
html:not(#pf) #main-nav-for-chat .serach_field-area {
  margin-left: 44px !important;
  max-width: 320px;
  width: 100%;
}

/* l'hamburger è in posizione assoluta a sinistra */
html:not(#pf) #main-nav-for-chat .search_field input,
html:not(#pf) #main-nav-for-chat .serach_field-area input {
  height: 40px;
  min-height: 40px;
  border: 1px solid var(--pf-border) !important;
  border-radius: var(--pf-r-pill) !important;
  background: var(--pf-surface-2) !important;
  box-shadow: none !important;
}

html:not(#pf) #main-nav-for-chat .serach_field-area input:focus {
  border-color: var(--pf-focus) !important;
  background: var(--pf-surface) !important;
  box-shadow: 0 0 0 3px rgba(5, 99, 240, .25) !important;
}

/* zona destra: stessa riga, stessa altezza */
html:not(#pf) #main-nav-for-chat .header_right {
  gap: 8px 12px;
  align-items: center;
}

html:not(#pf) #main-nav-for-chat .header_notification_warp {
  gap: 4px !important;
  align-items: center;
  margin: 0 !important;
}

html:not(#pf) #main-nav-for-chat .header_right .header_notification_warp {
  margin-left: 4px !important;
  margin-right: 8px !important;
}

/* lingua: compatta, senza bordo pesante */
html:not(#pf) #main-nav-for-chat .header_right .select_style {
  margin: 0;
}

html:not(#pf) #main-nav-for-chat .header_right .nice-select {
  height: 40px;
  min-height: 40px;
  line-height: 38px;
  display: inline-flex;
  align-items: center;
  float: none;
  padding: 0 30px 0 12px;
  margin: 0;
  border: 1px solid transparent !important;
  border-radius: var(--pf-r-sm) !important;
  background: transparent !important;
  box-shadow: none !important;
}

html:not(#pf) #main-nav-for-chat .header_right .nice-select:hover,
html:not(#pf) #main-nav-for-chat .header_right .nice-select.open {
  background: var(--pf-surface-2) !important;
  border-color: var(--pf-border) !important;
}

html:not(#pf) #main-nav-for-chat .header_right .nice-select .current {
  font-weight: 500;
  line-height: 1;
}

html:not(#pf) #main-nav-for-chat .header_right .nice-select::after {
  right: 12px;
  margin-top: -4px;
}

/* pulsante AI: quadrato 40 */
html:not(#pf) #main-nav-for-chat .header_right .header_middle {
  display: flex;
  align-items: center;
}

html:not(#pf) #main-nav-for-chat .header_right .header_middle .rev-primary-btn {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px;
  padding: 0 !important;
  border-radius: var(--pf-r-sm) !important;
  /* come gli altri pulsanti con icona della topbar: niente sfondo blu pieno */
  background: transparent !important;
  background-image: none !important;
  border: 1px solid transparent !important;
  color: var(--pf-text-muted, #6E6E6C) !important;
  box-shadow: none !important;
}

html:not(#pf) #main-nav-for-chat .header_right .header_middle .rev-primary-btn:hover,
html:not(#pf) #main-nav-for-chat .header_right .header_middle .rev-primary-btn:focus-visible {
  background: var(--pf-surface-2, #F7F6F4) !important;
  border-color: var(--pf-border, #D4D3D1) !important;
  color: var(--pf-action, #0563F0) !important;
}

/* azienda attiva */
html:not(#pf) #main-nav-for-chat li:has(.pf-scope-name)>div {
  min-height: 40px;
  border-radius: var(--pf-r-sm) !important;
  border: 1px solid var(--pf-blue-200);
  background: var(--pf-action-soft) !important;
}

html:not(#pf) #main-nav-for-chat li:has(.pf-scope-name)>div>a {
  background: var(--pf-action) !important;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

html:not(#pf) #main-nav-for-chat .pf-scope-name {
  color: var(--pf-blue-800) !important;
  font-weight: 600 !important;
  font-size: .8125rem !important;
}

/* icone: pulsanti quadrati uguali (Aggiorna, sito, layout, tema, notifiche, messaggi) */
html:not(#pf) #main-nav-for-chat :is(.pf-reload-btn, .visit_website_btn, .nav-layout-toggler, .theme-toggler a, .scroll_notification_list > a, .header_notification_warp li > a.pulse) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: var(--pf-r-sm) !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--pf-text-muted) !important;
  box-shadow: none !important;
  position: relative;
}

html:not(#pf) #main-nav-for-chat :is(.pf-reload-btn, .visit_website_btn, .nav-layout-toggler, .theme-toggler a, .scroll_notification_list > a, .header_notification_warp li > a.pulse):hover {
  background: var(--pf-surface-2) !important;
  color: var(--pf-link) !important;
  border-color: var(--pf-border) !important;
}

html:not(#pf) #main-nav-for-chat .nav-layout-toggler {
  padding: 0 !important;
}

html:not(#pf) #main-nav-for-chat .nav-layout-toggler a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
}

html:not(#pf) #main-nav-for-chat .header_notification_warp svg {
  width: 22px;
  height: 22px;
}

/* contatori sulle campanelle */
html:not(#pf) #main-nav-for-chat .notification_count {
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  padding: 0 5px;
  border-radius: var(--pf-r-pill);
  background: var(--pf-action);
  color: #fff;
  font-size: var(--pf-fs-caption);
  font-weight: 600;
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(30%, -20%);
  text-align: center;
}

/* utenti online */
html:not(#pf) #main-nav-for-chat .online-users-nav>a {
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  border-radius: var(--pf-r-pill) !important;
  background: var(--pf-surface-2) !important;
  border: 1px solid var(--pf-border);
  color: var(--pf-text) !important;
}

html:not(#pf) #main-nav-for-chat #onlineUsersCount {
  background: var(--pf-ok) !important;
  color: #fff !important;
  font-size: var(--pf-fs-caption) !important;
}

/* avatar */
html:not(#pf) #main-nav-for-chat .profile_info {
  display: flex;
  align-items: center;
  margin-left: 4px;
}

html:not(#pf) #main-nav-for-chat .profile_info .profileThumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--pf-surface);
  box-shadow: 0 0 0 1px var(--pf-border);
  background-size: cover;
  background-position: center;
}

/* menu a tendina del profilo e delle notifiche */
html:not(#pf) #main-nav-for-chat :is(.profile_info_iner, .Menu_NOtification_Wrap) {
  background: var(--pf-surface) !important;
  border: 1px solid var(--pf-border) !important;
  border-radius: var(--pf-r-md) !important;
  box-shadow: var(--pf-shadow) !important;
}

/* gestionale: pulsanti a 40 px (interfaccia più fitta; sul touch restano 44 px per le regole dei pulsanti piccoli) */
html:not(#pf) body.admin :is(.btn, .primary-btn, .theme_btn):not(.btn-sm):not(.btn-lg):not(.btn-xl) {
  min-height: 40px;
  padding: 0 1rem;
  font-size: .8125rem;
}

@media (pointer: coarse) {
  html:not(#pf) body.admin :is(.btn, .primary-btn, .theme_btn) {
    min-height: var(--pf-touch);
  }
}

/* avatar nella sidebar del gestionale: cerchio (il vecchio tema lo faceva quadrato con angoli arrotondati, raggio 20 px) */
html:not(#pf) #sidebar .sidebar-profile {
  --width: 96px;
  width: var(--width);
  height: var(--width);
  border-radius: 50% !important;
  border: 2px solid var(--pf-blue-200) !important;
  padding: 4px !important;
  background: transparent !important;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: none !important;
}

html:not(#pf) #sidebar .sidebar-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50% !important;
  border: 0 !important;
  box-shadow: none !important;
  display: block;
}

html:not(#pf) #sidebar.mini_sidebar .sidebar-profile {
  --width: 36px;
  padding: 2px !important;
  border-width: 1.5px !important;
}

/* intestazione di pagina del gestionale (titolo + briciole): piatta come nel vecchio template, non un riquadro */
html:not(#pf) .sms-breadcrumb,
html:not(#pf) .sms-breadcrumb.white-box {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: .5rem 0 !important;
  margin-bottom: .5rem;
}

/* !important: la regola delle card (.white-box) e quella del vecchio tema */
html:not(#pf) .sms-breadcrumb h1 {
  font-family: var(--pf-font-body) !important;
  font-size: 1.125rem !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  letter-spacing: .03em !important;
  margin: 0 !important;
  color: var(--pf-heading) !important;
  text-transform: uppercase;
}

html:not(#pf) .sms-breadcrumb .bc-pages a {
  color: var(--pf-text-muted) !important;
  font-size: .8125rem;
  font-weight: 400;
  text-decoration: none;
}

html:not(#pf) .sms-breadcrumb .bc-pages a:hover {
  color: var(--pf-link) !important;
  text-decoration: underline;
}

/* gestionale: campi a 40 px su mouse (restano 16 px di testo e 44 px su touch) */
@media (pointer: fine) {
  html:not(#pf) body.admin :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select, .form-control, .form-select, .nice-select) {
    min-height: 40px;
  }
}

/* sotto-voci del menu del gestionale: compatte, con icona a sinistra (stessa famiglia di tinte, nessun colore per categoria) */
html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li>ul {
  margin: .125rem .5rem .5rem !important;
  padding: .25rem !important;
  background: rgba(1, 19, 46, .35) !important;
  border-radius: var(--pf-r-sm) !important;
  border: 0 !important;
}

html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li ul li a {
  display: flex !important;
  align-items: center !important;
  gap: .625rem !important;
  min-height: 34px !important;
  padding: .3rem .625rem !important;
  margin: 0 !important;
  font-size: .8125rem !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  border-radius: 6px !important;
  color: var(--pf-nav-text-muted) !important;
  background: transparent !important;
  text-indent: 0 !important;
}

html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li ul li a i {
  flex: 0 0 16px;
  width: 16px;
  margin: 0 !important;
  text-align: center;
  font-size: .75rem !important;
  color: var(--pf-blue-200) !important;
  opacity: .85;
  display: inline-block !important;
}

html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li ul li a:hover {
  background: var(--pf-nav-active-bg) !important;
  color: var(--pf-nav-text) !important;
}

html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li ul li a:hover i {
  color: #fff !important;
  opacity: 1;
}

html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li ul li.mm-active>a,
html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li ul li a.active {
  background: var(--pf-action) !important;
  color: #fff !important;
  font-weight: 500 !important;
}

html:not(#pf) nav#sidebar.sidebar:not(.mini_sidebar) #sidebar_menu li ul li.mm-active>a i {
  color: #fff !important;
  opacity: 1;
}

/* sidebar ridotta: i menu a comparsa restano leggibili, con l'icona allineata */
html:not(#pf) nav#sidebar.sidebar.mini_sidebar #sidebar_menu li ul li a {
  display: flex !important;
  align-items: center;
  gap: .5rem;
}

html:not(#pf) nav#sidebar.sidebar.mini_sidebar #sidebar_menu li ul li a i {
  width: 16px;
  text-align: center;
  font-size: .75rem;
}

/* ==========================================================================
   AVVISI (toastr) · notifica professionale
   Scheda bianca in alto a destra (in alto a tutta larghezza su telefono): barra colorata a sinistra, icona in un cerchio tenue,
   titolo e messaggio. Sostituisce il grande riquadro blu al centro con sfondo oscurato.
   I testi non cambiano. Specificità alta e !important perché la vista `_toast_center` e la libreria usano ID, immagini di sfondo e colori pieni.
   ========================================================================== */
html:not(#pf) #toast-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: min(calc(100vw - 24px), 400px) !important;
  z-index: 2147483647 !important;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 !important;
}

html:not(#pf) #toast-container:not(:empty)::before {
  content: none !important;
  display: none !important;
}

/* niente sfondo oscurato dietro l'avviso */
html:not(#pf) #toast-container>div {
  --tc: var(--pf-info);
  --tbg: var(--pf-info-bg);
  --ti: "\f05a";
  position: relative;
  width: 100% !important;
  margin: 0 !important;
  min-height: 64px;
  padding: 14px 42px 14px 62px !important;
  pointer-events: auto;
  background-color: var(--pf-surface) !important;
  background-image: none !important;
  color: var(--pf-text) !important;
  border: 1px solid var(--pf-border) !important;
  border-left: 4px solid var(--tc) !important;
  border-radius: 12px !important;
  box-shadow: var(--pf-shadow-lg) !important;
  opacity: 1 !important;
  font-size: .875rem;
  line-height: 1.45;
  text-shadow: none !important;
}

html:not(#pf) #toast-container>.toast-success {
  --tc: var(--pf-ok);
  --tbg: var(--pf-ok-bg);
  --ti: "\f058";
}

html:not(#pf) #toast-container>.toast-error {
  --tc: var(--pf-err);
  --tbg: var(--pf-err-bg);
  --ti: "\f057";
}

html:not(#pf) #toast-container>.toast-warning {
  --tc: var(--pf-warn);
  --tbg: var(--pf-warn-bg);
  --ti: "\f071";
}

html:not(#pf) #toast-container>.toast-info {
  --tc: var(--pf-info);
  --tbg: var(--pf-info-bg);
  --ti: "\f05a";
}

html:not(#pf) #toast-container>div::before {
  content: var(--ti);
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tbg);
  color: var(--tc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

html:not(#pf) #toast-container>div .toast-title {
  font-size: .875rem !important;
  font-weight: 600 !important;
  color: var(--pf-heading) !important;
  margin: 0 0 2px !important;
  line-height: 1.3;
}

html:not(#pf) #toast-container>div .toast-message {
  font-size: .8125rem !important;
  font-weight: 400 !important;
  color: var(--pf-text) !important;
  line-height: 1.45;
  word-wrap: break-word;
}

html:not(#pf) #toast-container>div .toast-message a {
  color: var(--pf-link) !important;
  text-decoration: underline;
}

html:not(#pf) #toast-container>div .toast-close-button {
  position: absolute;
  top: 8px !important;
  right: 10px !important;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem !important;
  line-height: 1;
  color: var(--pf-text-muted) !important;
  opacity: .8;
  text-shadow: none !important;
  border-radius: 6px;
}

html:not(#pf) #toast-container>div .toast-close-button:hover {
  opacity: 1;
  background: var(--pf-surface-2);
  color: var(--pf-text) !important;
}

html:not(#pf) #toast-container>div .toast-progress {
  height: 3px !important;
  background: var(--tc) !important;
  opacity: .35 !important;
  border-radius: 0 0 0 12px;
}

@media (max-width: 575.98px) {
  html:not(#pf) #toast-container {
    top: 12px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
  }
}

/* campi file con il pulsante "Sfoglia" dentro il riquadro: pulsante centrato in verticale (il vecchio CSS lo posizionava a 7 px dall'alto, valido solo per un pulsante di 32 px) */
html:not(#pf) .primary_file_uploader {
  position: relative;
}

html:not(#pf) .primary_file_uploader button {
  position: absolute !important;
  top: 50% !important;
  right: 6px !important;
  transform: translateY(-50%);
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  z-index: 5;
}

html:not(#pf) .primary_file_uploader button label,
html:not(#pf) .primary_file_uploader button .primary-btn {
  margin: 0 !important;
  min-height: 34px !important;
  height: 34px;
  padding: 0 1rem !important;
  font-size: .8125rem !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

html:not(#pf) .primary_file_uploader input[type="text"] {
  height: 46px;
  padding-right: 110px !important;
}

/* ==========================================================================
   TABELLE (DataTables) · barra degli strumenti e paginazione allineate
   "Mostra [10] voci", pulsanti di esportazione, ricerca: tutti centrati sulla stessa linea e alti 40 px.
   Pagina corrente: numero centrato nel cerchio.
   ========================================================================== */
html:not(#pf) .dataTables_wrapper .dataTables_length,
html:not(#pf) .dataTables_wrapper .dt-buttons,
html:not(#pf) .dataTables_wrapper .dataTables_filter {
  display: flex !important;
  align-items: center !important;
  float: none !important;
  margin: 0 !important;
  min-height: 40px;
}

html:not(#pf) .dataTables_wrapper .dt-buttons {
  gap: 8px;
  flex-wrap: wrap;
}

html:not(#pf) .dataTables_wrapper .dataTables_length label,
html:not(#pf) .dataTables_wrapper .dataTables_filter label {
  display: inline-flex !important;
  align-items: center !important;
  gap: .625rem;
  margin: 0 !important;
  line-height: 1 !important;
  font-size: .8125rem;
  font-weight: 500;
  white-space: nowrap;
}

html:not(#pf) .dataTables_wrapper .dataTables_length .nice-select,
html:not(#pf) .dataTables_wrapper .dataTables_length select {
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  margin: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 1 !important;
  padding: 0 12px !important;
  min-width: 70px;
  width: auto !important;
}

html:not(#pf) .dataTables_wrapper .dataTables_length .nice-select.dataTable_select,
html:not(#pf) .dataTables_wrapper .dataTables_length .nice-select {
  position: relative !important;
  top: 0 !important;
  bottom: auto !important;
  margin: 0 !important;
  padding: 0 12px !important;
  height: 40px !important;
  border: 1.5px solid var(--pf-border-strong) !important;
  border-radius: var(--pf-r-sm) !important;
}

html:not(#pf) .dataTables_wrapper .dataTables_length .nice-select .current {
  display: inline-block;
  line-height: 1 !important;
  padding: 0 !important;
}

html:not(#pf) .dataTables_wrapper .dataTables_length .nice-select::after {
  content: "" !important;
  display: block !important;
  position: static !important;
  flex: 0 0 auto;
  width: 7px !important;
  height: 7px !important;
  margin: 0 0 0 .625rem !important;
  right: auto !important;
  top: auto !important;
  border: 0 !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  transform: translateY(-2px) rotate(45deg) !important;
  transform-origin: center !important;
  opacity: .7;
}

html:not(#pf) .dataTables_wrapper .dataTables_filter input {
  height: 40px !important;
  margin: 0 !important;
}

html:not(#pf) .dataTables_wrapper .dt-buttons .dt-button,
html:not(#pf) .dataTables_wrapper .dt-buttons .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1;
  border-radius: var(--pf-r-sm) !important;
}

/* paginazione: cerchi 34 px con il numero centrato */
html:not(#pf) .dataTables_wrapper .dataTables_paginate {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 !important;
  margin: 0 !important;
}

html:not(#pf) .dataTables_wrapper .dataTables_paginate>span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

html:not(#pf) .dataTables_wrapper .dataTables_paginate .paginate_button,
html:not(#pf) .dataTables_paginate .page-link,
html:not(#pf) .pagination .page-link,
html:not(#pf) .pagination li>a,
html:not(#pf) .pagination li>span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  border-radius: 50% !important;
  font-size: .8125rem;
  font-weight: 500;
  text-align: center;
  box-sizing: border-box;
}

html:not(#pf) .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html:not(#pf) .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
html:not(#pf) .pagination .active>.page-link,
html:not(#pf) .pagination li.active>a {
  background: var(--pf-action) !important;
  border-color: var(--pf-action) !important;
  color: #fff !important;
  box-shadow: none !important;
}

html:not(#pf) .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: .5;
  cursor: default;
}

html:not(#pf) .dataTables_wrapper .dataTables_info {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 !important;
  font-size: .8125rem;
  color: var(--pf-text-muted);
}

/* ---- Topbar gestionale · allineamento: ogni elemento centrato sulla stessa linea ---- */
html:not(#pf) #main-nav-for-chat .header_iner {
  display: flex !important;
  align-items: center !important;
  height: 60px;
  min-height: 60px;
}

html:not(#pf) #main-nav-for-chat .header_iner>*,
html:not(#pf) #main-nav-for-chat .header_right>*,
html:not(#pf) #main-nav-for-chat .header_middle,
html:not(#pf) #main-nav-for-chat .select_style {
  align-self: center !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

html:not(#pf) #main-nav-for-chat .header_right {
  display: flex !important;
  align-items: center !important;
  height: 100%;
  flex-wrap: nowrap;
}

html:not(#pf) #main-nav-for-chat .header_notification_warp {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  height: 100%;
}

html:not(#pf) #main-nav-for-chat .header_notification_warp>li {
  display: flex !important;
  align-items: center;
  height: 40px;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
}

html:not(#pf) #main-nav-for-chat .header_notification_warp>li>a,
html:not(#pf) #main-nav-for-chat .header_notification_warp>li>button {
  margin: 0 !important;
  line-height: 1;
}

html:not(#pf) #main-nav-for-chat .select_style {
  display: flex !important;
  align-items: center;
  height: 40px;
}

/* lingua: testo e freccia sulla stessa riga */
html:not(#pf) #main-nav-for-chat .header_right .nice-select {
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
  padding: 0 12px !important;
}

/* freccia della lingua: un chevron disegnato con due bordi, centrato sulla riga del testo (nessun margine negativo, nessun offset del vecchio plugin) */
html:not(#pf) #main-nav-for-chat .header_right .nice-select .current {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}

html:not(#pf) #main-nav-for-chat .header_right .nice-select::after {
  content: "" !important;
  display: block !important;
  position: static !important;
  flex: 0 0 auto;
  align-self: center;
  width: 7px !important;
  height: 7px !important;
  margin: 0 0 0 .5rem !important;
  right: auto !important;
  top: auto !important;
  border: 0 !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  transform: translateY(-2px) rotate(45deg) !important;
  transform-origin: center !important;
  opacity: .7;
  box-sizing: border-box;
}

html:not(#pf) #main-nav-for-chat .header_right .nice-select.open::after {
  transform: translateY(2px) rotate(-135deg) !important;
}

html:not(#pf) #main-nav-for-chat .profile_info {
  display: flex !important;
  align-items: center;
  height: 40px;
}

html:not(#pf) #main-nav-for-chat .collaspe_icon.open_miniSide {
  display: flex;
  align-items: center;
}

@media (max-width: 991.98px) {
  html:not(#pf) #main-nav-for-chat .header_iner {
    min-height: 56px;
  }

  html:not(#pf) #main-nav-for-chat :is(.pf-reload-btn, .visit_website_btn, .nav-layout-toggler, .theme-toggler a, .scroll_notification_list > a) {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}

/* Celle vuote delle tabelle: trattino leggero (classe messa da partials/_empty_cells) */
html:not(#pf) td.pf-empty-cell::before {
  content: "—";
  font-family: "Lexend", sans-serif !important;
  font-weight: 400 !important;
  font-style: normal;
  color: var(--pf-text-muted);
  opacity: .6;
}

/* Badge "morbidi" di Bootstrap (bg-* bg-opacity-10 text-*): sfondo tenue di stato e testo scuro leggibile.
   Concluso = rosso, Programmato = ambra, In corso = verde, protocollo/informazioni = blu. */
html:not(#pf) .badge.bg-opacity-10,
html:not(#pf) .badge[class*="bg-opacity"] {
  font-weight: 600;
}

html:not(#pf) .badge.bg-primary.bg-opacity-10 {
  background-color: var(--pf-action-soft) !important;
  color: var(--pf-link) !important;
  border-color: var(--pf-link) !important;
}

html:not(#pf) .badge.bg-success.bg-opacity-10 {
  background-color: var(--pf-ok-bg) !important;
  color: var(--pf-ok) !important;
  border-color: var(--pf-ok) !important;
}

html:not(#pf) .badge.bg-warning.bg-opacity-10 {
  background-color: var(--pf-warn-bg) !important;
  color: var(--pf-warn) !important;
  border-color: var(--pf-warn) !important;
}

html:not(#pf) .badge.bg-danger.bg-opacity-10 {
  background-color: var(--pf-err-bg) !important;
  color: var(--pf-err) !important;
  border-color: var(--pf-err) !important;
}

html:not(#pf) .badge.bg-info.bg-opacity-10 {
  background-color: var(--pf-info-bg) !important;
  color: var(--pf-info) !important;
  border-color: var(--pf-info) !important;
}

html:not(#pf) .badge.bg-secondary.bg-opacity-10,
html:not(#pf) .badge.bg-dark.bg-opacity-10 {
  background-color: var(--pf-idle-bg) !important;
  color: var(--pf-idle) !important;
  border-color: var(--pf-idle) !important;
}

html:not(#pf) .badge[class*="bg-opacity"] i {
  color: inherit !important;
}

/* Righe delle tabelle: fondo neutro, evidenza leggera per stato (barra a sinistra + tinta appena percettibile), passaggio del mouse grigio e non blu.
   Chiuso/inattivo = rosso, non completato a corso terminato = ambra, completato = verde. */
html:not(#pf) table.dataTable tbody tr:hover>td,
html:not(#pf) .table tbody tr:hover>td {
  background-color: var(--pf-surface-2) !important;
}

html:not(#pf) table.dataTable tbody tr.pf-row-closed>td,
html:not(#pf) table.dataTable tbody tr.pf-row-inactive>td {
  background-color: color-mix(in srgb, var(--pf-err) 5%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr.pf-row-fail>td {
  background-color: color-mix(in srgb, var(--pf-warn) 6%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr.pf-row-ok>td {
  background-color: color-mix(in srgb, var(--pf-ok) 5%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr.pf-row-closed:hover>td,
html:not(#pf) table.dataTable tbody tr.pf-row-inactive:hover>td {
  background-color: color-mix(in srgb, var(--pf-err) 10%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr.pf-row-fail:hover>td {
  background-color: color-mix(in srgb, var(--pf-warn) 11%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr.pf-row-ok:hover>td {
  background-color: color-mix(in srgb, var(--pf-ok) 10%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr.pf-row-closed>td:first-child,
html:not(#pf) table.dataTable tbody tr.pf-row-inactive>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-err);
}

html:not(#pf) table.dataTable tbody tr.pf-row-fail>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-warn);
}

html:not(#pf) table.dataTable tbody tr.pf-row-ok>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-ok);
}

/* Corsi conclusi (chiusi, inattivi, o completati a corso terminato): grigio neutro "archiviato", non rosso né verde.
   Resta l'ambra solo per "non completato a corso terminato". */
html:not(#pf) table.dataTable tbody tr:is(.pf-row-closed, .pf-row-inactive, .pf-row-ok)>td {
  background-color: color-mix(in srgb, var(--pf-idle) 9%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr:is(.pf-row-closed, .pf-row-inactive, .pf-row-ok):hover>td {
  background-color: color-mix(in srgb, var(--pf-idle) 16%, var(--pf-surface)) !important;
}

html:not(#pf) table.dataTable tbody tr:is(.pf-row-closed, .pf-row-inactive, .pf-row-ok)>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-idle);
}

/* Conclusi: sfondo grigio neutro, barra a sinistra rossa */
html:not(#pf) table.dataTable tbody tr:is(.pf-row-closed, .pf-row-inactive, .pf-row-ok)>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-err) !important;
}

html:not(#pf) table.dataTable tbody tr:is(.pf-row-closed, .pf-row-inactive, .pf-row-ok)>td {
  background-image: none !important;
}

/* Righe "concluse" anche nelle tabelle semplici (es. classi virtuali): stesso stile delle tabelle DataTables */
html:not(#pf) table tbody tr.pf-row-closed>td {
  background-color: color-mix(in srgb, var(--pf-idle) 9%, var(--pf-surface)) !important;
  color: var(--pf-text);
}

html:not(#pf) table tbody tr.pf-row-closed:hover>td {
  background-color: color-mix(in srgb, var(--pf-idle) 16%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-closed>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-err) !important;
}

/* Corsi attivi: tinta verde leggera e barra verde a sinistra */
html:not(#pf) table tbody tr.pf-row-active>td {
  background-color: color-mix(in srgb, var(--pf-ok) 6%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-active:hover>td {
  background-color: color-mix(in srgb, var(--pf-ok) 12%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-active>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-ok) !important;
}

/* Programmato / in partenza: tinta ambra leggera e barra ambra a sinistra */
html:not(#pf) table tbody tr.pf-row-scheduled>td {
  background-color: color-mix(in srgb, var(--pf-warn) 8%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-scheduled:hover>td {
  background-color: color-mix(in srgb, var(--pf-warn) 14%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-scheduled>td:first-child {
  box-shadow: inset 4px 0 0 var(--pf-warn) !important;
}

/* In partenza / programmato: giallo ben riconoscibile (il marrone del token "warn" sembrava neutro) */
html:not(#pf) table tbody tr.pf-row-scheduled>td {
  background-color: color-mix(in srgb, #F5B301 18%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-scheduled:hover>td {
  background-color: color-mix(in srgb, #F5B301 28%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-scheduled>td:first-child {
  box-shadow: inset 6px 0 0 #F5B301 !important;
}

/* Etichette (badge) dentro le tabelle: bordino sottile dello stesso colore del testo, così si staccano dallo sfondo della riga.
   Senza !important: i badge che hanno già un bordo proprio (inline o classe .border) lo mantengono. */
html:not(#pf) table .badge {
  border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
}

/* Etichetta versione nel piè di pagina: padding reale (px-2.5/py-1 non esistono), altezza fissa e allineata al testo */
html:not(#pf) footer span:has(> i.fa-code-branch),
html:not(#pf) p span:has(> i.fa-code-branch.me-1.text-primary) {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px !important;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1 !important;
  white-space: nowrap;
  border: 1px solid var(--pf-border-strong) !important;
  border-radius: 999px !important;
  background: var(--pf-surface) !important;
  color: var(--pf-text-muted) !important;
  box-sizing: border-box;
}

html:not(#pf) span:has(> i.fa-code-branch)>i {
  margin: 0 !important;
  line-height: 1;
}

/* ==========================================================================
   PULSANTE "AZIONE" delle tabelle e relativo menu: aspetto professionale
   ========================================================================== */
html:not(#pf) .CRM_dropdown.dropdown .dropdown-toggle,
html:not(#pf) .CRM_dropdown .btn.dropdown-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 14px !important;
  background: var(--pf-action-soft) !important;
  color: var(--pf-link) !important;
  border: 1px solid color-mix(in srgb, var(--pf-action) 28%, transparent) !important;
  border-radius: var(--pf-r-sm) !important;
  font-size: .8125rem !important;
  font-weight: 600 !important;
  letter-spacing: 0;
  text-transform: none !important;
  line-height: 1 !important;
  box-shadow: 0 1px 2px rgba(2, 25, 60, .06) !important;
  overflow: visible !important;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

html:not(#pf) .CRM_dropdown.dropdown .dropdown-toggle::after,
html:not(#pf) .CRM_dropdown .btn.dropdown-toggle::after {
  content: "" !important;
  display: inline-block !important;
  position: static !important;
  width: 7px !important;
  height: 7px !important;
  margin: 0 0 3px 2px !important;
  top: auto !important;
  left: auto !important;
  border: 0 !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  transform: rotate(45deg) !important;
  font-family: inherit !important;
  transition: transform .15s ease;
}

html:not(#pf) .CRM_dropdown.dropdown .dropdown-toggle:hover,
html:not(#pf) .CRM_dropdown.dropdown .dropdown-toggle:focus,
html:not(#pf) .CRM_dropdown.dropdown.show .dropdown-toggle,
html:not(#pf) .CRM_dropdown .btn.dropdown-toggle.show {
  background: var(--pf-action) !important;
  color: var(--pf-on-action) !important;
  border-color: var(--pf-action) !important;
  box-shadow: 0 2px 6px rgba(5, 99, 240, .30) !important;
}

html:not(#pf) .CRM_dropdown.dropdown.show .dropdown-toggle::after,
html:not(#pf) .CRM_dropdown .btn.dropdown-toggle.show::after {
  transform: rotate(-135deg) !important;
  margin: 3px 0 0 2px !important;
}

html:not(#pf) .CRM_dropdown .dropdown-menu {
  min-width: 220px;
  padding: 6px !important;
  border: 1px solid var(--pf-border) !important;
  border-radius: var(--pf-r-md) !important;
  background: var(--pf-surface) !important;
  box-shadow: var(--pf-shadow-lg) !important;
}

html:not(#pf) .CRM_dropdown .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px !important;
  border-radius: var(--pf-r-sm);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--pf-text) !important;
  white-space: normal;
}

html:not(#pf) .CRM_dropdown .dropdown-menu .dropdown-item:hover,
html:not(#pf) .CRM_dropdown .dropdown-menu .dropdown-item:focus {
  background: var(--pf-action-soft) !important;
  color: var(--pf-link) !important;
}

html:not(#pf) .CRM_dropdown .dropdown-menu .dropdown-item i {
  width: 16px;
  text-align: center;
  margin: 0 !important;
  flex: 0 0 16px;
}

html:not(#pf) .CRM_dropdown .dropdown-menu .dropdown-divider {
  margin: 4px 6px;
  border-color: var(--pf-border);
}

/* Campo di ricerca con icona a sinistra (input-group: icona + campo): un solo bordo attorno a entrambi, niente sovrapposizioni */
html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-control) {
  flex-wrap: nowrap !important;
  align-items: stretch;
  height: 40px;
  border: 1.5px solid var(--pf-border-strong);
  border-radius: var(--pf-r-sm);
  background: var(--pf-surface);
  overflow: hidden;
}

html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-control):focus-within {
  border-color: var(--pf-action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pf-action) 25%, transparent);
}

html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-control)>.input-group-text {
  display: flex;
  align-items: center;
  height: 100% !important;
  padding: 0 4px 0 12px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-control)>.form-control {
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  flex: 1 1 auto;
  width: 1% !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 12px 0 6px !important;
}

/* Monitoraggio accessi: disconnesso = rosso tenue con barra rossa; connesso (sessione attiva) = verde con barra verde */
html:not(#pf) table tbody tr.pf-row-offline>td {
  background-color: color-mix(in srgb, var(--pf-err) 6%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-offline:hover>td {
  background-color: color-mix(in srgb, var(--pf-err) 11%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-offline>td:first-child {
  box-shadow: inset 5px 0 0 var(--pf-err) !important;
}

html:not(#pf) table tbody tr.pf-row-active>td {
  background-color: color-mix(in srgb, var(--pf-ok) 10%, var(--pf-surface)) !important;
}

html:not(#pf) table tbody tr.pf-row-active>td:first-child {
  box-shadow: inset 5px 0 0 var(--pf-ok) !important;
}

/* Login · pannello destro: tre punti di forza (icona, titolo, descrizione) al posto delle parole singole */
@media (min-width: 992px) {
  html:not(#pf) .login_main_info .other_links {
    align-items: stretch !important;
    gap: 1rem !important;
  }

  html:not(#pf) .login_main_info .other_links span {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .25rem;
    padding: 0 .5rem !important;
    text-align: center;
    white-space: normal !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    border-left: 0 !important;
  }

  html:not(#pf) .login_main_info .other_links span i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: .25rem;
    border-radius: 50%;
    background: rgba(175, 206, 253, .16);
    color: var(--pf-blue-200);
    font-size: 1rem;
  }

  html:not(#pf) .login_main_info .other_links span b {
    font-size: .9375rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
  }

  html:not(#pf) .login_main_info .other_links span small {
    font-size: .8125rem;
    font-weight: 400;
    color: var(--pf-blue-200);
    line-height: 1.4;
  }
}

/* Classi di spaziatura "a mezzo passo" (px-2.5, mb-3.5, gap-1.5 ...) usate nelle viste ma mancanti in Bootstrap: senza, i badge e i riquadri restavano senza margini interni. */
.m-0\.5 {
  margin: .125rem !important;
}

.m-1\.5 {
  margin: .375rem !important;
}

.m-2\.5 {
  margin: .625rem !important;
}

.m-3\.5 {
  margin: .875rem !important;
}

.mt-0\.5 {
  margin-top: .125rem !important;
}

.mt-1\.5 {
  margin-top: .375rem !important;
}

.mt-2\.5 {
  margin-top: .625rem !important;
}

.mt-3\.5 {
  margin-top: .875rem !important;
}

.mb-0\.5 {
  margin-bottom: .125rem !important;
}

.mb-1\.5 {
  margin-bottom: .375rem !important;
}

.mb-2\.5 {
  margin-bottom: .625rem !important;
}

.mb-3\.5 {
  margin-bottom: .875rem !important;
}

.ms-0\.5 {
  margin-left: .125rem !important;
}

.ms-1\.5 {
  margin-left: .375rem !important;
}

.ms-2\.5 {
  margin-left: .625rem !important;
}

.ms-3\.5 {
  margin-left: .875rem !important;
}

.me-0\.5 {
  margin-right: .125rem !important;
}

.me-1\.5 {
  margin-right: .375rem !important;
}

.me-2\.5 {
  margin-right: .625rem !important;
}

.me-3\.5 {
  margin-right: .875rem !important;
}

.p-0\.5 {
  padding: .125rem !important;
}

.p-1\.5 {
  padding: .375rem !important;
}

.p-2\.5 {
  padding: .625rem !important;
}

.p-3\.5 {
  padding: .875rem !important;
}

.pt-0\.5 {
  padding-top: .125rem !important;
}

.pt-1\.5 {
  padding-top: .375rem !important;
}

.pt-2\.5 {
  padding-top: .625rem !important;
}

.pt-3\.5 {
  padding-top: .875rem !important;
}

.pb-0\.5 {
  padding-bottom: .125rem !important;
}

.pb-1\.5 {
  padding-bottom: .375rem !important;
}

.pb-2\.5 {
  padding-bottom: .625rem !important;
}

.pb-3\.5 {
  padding-bottom: .875rem !important;
}

.ps-0\.5 {
  padding-left: .125rem !important;
}

.ps-1\.5 {
  padding-left: .375rem !important;
}

.ps-2\.5 {
  padding-left: .625rem !important;
}

.ps-3\.5 {
  padding-left: .875rem !important;
}

.pe-0\.5 {
  padding-right: .125rem !important;
}

.pe-1\.5 {
  padding-right: .375rem !important;
}

.pe-2\.5 {
  padding-right: .625rem !important;
}

.pe-3\.5 {
  padding-right: .875rem !important;
}

.mx-0\.5 {
  margin-left: .125rem !important;
  margin-right: .125rem !important;
}

.mx-1\.5 {
  margin-left: .375rem !important;
  margin-right: .375rem !important;
}

.mx-2\.5 {
  margin-left: .625rem !important;
  margin-right: .625rem !important;
}

.mx-3\.5 {
  margin-left: .875rem !important;
  margin-right: .875rem !important;
}

.my-0\.5 {
  margin-top: .125rem !important;
  margin-bottom: .125rem !important;
}

.my-1\.5 {
  margin-top: .375rem !important;
  margin-bottom: .375rem !important;
}

.my-2\.5 {
  margin-top: .625rem !important;
  margin-bottom: .625rem !important;
}

.my-3\.5 {
  margin-top: .875rem !important;
  margin-bottom: .875rem !important;
}

.px-0\.5 {
  padding-left: .125rem !important;
  padding-right: .125rem !important;
}

.px-1\.5 {
  padding-left: .375rem !important;
  padding-right: .375rem !important;
}

.px-2\.5 {
  padding-left: .625rem !important;
  padding-right: .625rem !important;
}

.px-3\.5 {
  padding-left: .875rem !important;
  padding-right: .875rem !important;
}

.py-0\.5 {
  padding-top: .125rem !important;
  padding-bottom: .125rem !important;
}

.py-1\.5 {
  padding-top: .375rem !important;
  padding-bottom: .375rem !important;
}

.py-2\.5 {
  padding-top: .625rem !important;
  padding-bottom: .625rem !important;
}

.py-3\.5 {
  padding-top: .875rem !important;
  padding-bottom: .875rem !important;
}

.gap-0\.5 {
  gap: .125rem !important;
}

.gap-1\.5 {
  gap: .375rem !important;
}

.gap-2\.5 {
  gap: .625rem !important;
}

.gap-3\.5 {
  gap: .875rem !important;
}

html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-control)>.btn {
  height: 100% !important;
  border: 0 !important;
  border-left: 1px solid var(--pf-border) !important;
  border-radius: 0 !important;
}

/* Etichette con un numero in un <span> seguito dal testo ("13 corsi disponibili"): lo spazio tra numero e testo non si perde */
html:not(#pf) .badge:has(> span) {
  gap: .3em;
}

/* Gruppo icona + menu a tendina (es. Macro Codice): un solo bordo, nessuna sovrapposizione */
html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-select:last-child) {
  flex-wrap: nowrap !important;
  align-items: stretch;
  height: 44px;
  border: 1.5px solid var(--pf-border-strong);
  border-radius: var(--pf-r-sm);
  background: var(--pf-surface);
  overflow: hidden;
}

html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-select:last-child):focus-within {
  border-color: var(--pf-action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pf-action) 25%, transparent);
}

html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-select:last-child)>.input-group-text {
  display: flex;
  align-items: center;
  height: 100% !important;
  padding: 0 4px 0 12px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

html:not(#pf) .input-group:has(> .input-group-text:first-child + .form-select:last-child)>.form-select {
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  flex: 1 1 auto;
  width: 1% !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-left: 6px !important;
}

@media (max-width: 575.98px) {

  /* topbar: su telefono le azioni vanno su due righe invece di uscire dallo schermo; l'intestazione segue il flusso della pagina */
  html:not(#pf) #main-nav-for-chat .header_iner {
    position: relative !important;
    height: auto !important;
    min-height: 56px;
    flex-wrap: nowrap !important;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  html:not(#pf) #main-nav-for-chat .header_right {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 4px 6px;
  }

  html:not(#pf) #main-nav-for-chat .header_right .header_notification_warp {
    display: contents !important;
  }

  html:not(#pf) #main-content {
    padding-top: 8px !important;
  }
}

/* ==========================================================================
   Responsive: scroll orizzontale
   Nessun contenuto deve uscire dallo schermo: i blocchi vanno a capo o scorrono nel proprio contenitore.
   ========================================================================== */
/* tabelle: su schermi stretti intestazioni, celle e badge vanno a capo (su desktop "overflow-wrap" cambierebbe la ripartizione delle colonne anche quando la tabella entra) */
@media (max-width: 991.98px) {
  html:not(#pf) .QA_table table.table :is(th, td, .badge) { white-space: normal; overflow-wrap: anywhere; }
}
/* tabella dei collegamenti (Attività di accesso): con 10 colonne è più larga del riquadro fino a 1399 px */
@media (max-width: 1399.98px) {
  html:not(#pf) #student_login_table :is(th, td, .badge) { white-space: normal; overflow-wrap: anywhere; }
}
/* colonna di filtri con pulsante e menu a tendina (es. Discenti online): il menu va a capo se non entra, su tablet e telefono */
@media (max-width: 1399.98px) {
  html:not(#pf) #main-content .row > [class*="col"].d-flex:has(> .dropdown) { flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
  /* versione nel piè di pagina: va a capo (la regola base ha padding e nowrap con !important/valori fissi) */
  html:not(#pf) footer span:has(> i.fa-code-branch), html:not(#pf) p span:has(> i.fa-code-branch.me-1.text-primary) { white-space: normal; height: auto; min-height: 28px; max-width: 100%; text-align: left; padding-block: 4px !important; /* !important: il padding della regola base è !important */ }
  /* ricerca delle tabelle dati: mai più larga del contenitore */
  html:not(#pf) .dataTables_wrapper .dataTables_filter, html:not(#pf) .dataTables_wrapper .dataTables_filter label { max-width: 100%; }
  html:not(#pf) .dataTables_wrapper .dataTables_filter input { max-width: 100%; min-width: 0; box-sizing: border-box; }
}
@media (max-width: 359.98px) {
  /* telefoni molto stretti: il campo di ricerca (min-width 250 px impostato da script) va sotto l'etichetta e la scheda cede il suo padding */
  html:not(#pf) .dataTables_wrapper { padding-inline: 0; }
  html:not(#pf) .dataTables_wrapper .dataTables_filter label { flex-wrap: wrap; }
}
/* righe di pulsanti su telefono e tablet: vanno a capo invece di uscire (barra in alto, finestre e voci di elenco sono escluse) */
@media (max-width: 1199.98px) {
  html:not(#pf) #main-content .d-flex:has(> :is(.btn, .primary-btn, button, .dropdown)):not(li, .header_iner, .modal-header, .modal-footer) { flex-wrap: wrap; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  /* topbar su tablet: stessa soluzione del telefono (il blocco "max-width: 575.98px" sopra), le azioni vanno a capo invece di uscire */
  html:not(#pf) #main-nav-for-chat .header_iner { position: relative !important; left: 0 !important; width: 100% !important; height: auto !important; min-height: 56px; flex-wrap: nowrap !important; padding-top: 6px; padding-bottom: 6px; }
  html:not(#pf) #main-nav-for-chat .header_right { flex: 1 1 0; min-width: 0; flex-wrap: wrap !important; justify-content: flex-end !important; gap: 4px 6px; }
  html:not(#pf) #main-nav-for-chat .header_right .header_notification_warp { display: contents !important; }
  html:not(#pf) #main-content { padding-top: 8px !important; }
}
@media (max-width: 991.98px) {
  /* le tabelle scorrono nel loro contenitore (la regola in linea della pagina lo teneva visibile per non tagliare i menu "Azione") */
  html:not(#pf) .QA_table .table-responsive { overflow-x: auto !important; /* !important: la regola in linea di alcune pagine usa !important */ }
}
@media (max-width: 575.98px) {
  /* telefono: testi lunghi e righe flessibili non spingono il contenuto fuori dalla scheda */
  html:not(#pf) #main-content { overflow-wrap: anywhere; }
  html:not(#pf) #main-content :is(.d-flex, .row, .btn-group, .input-group) > * { min-width: 0; }
  html:not(#pf) #main-content :is(.text-nowrap, .badge, label) { white-space: normal; }
  html:not(#pf) #main-content .d-flex.justify-content-between:not(.flex-nowrap) { flex-wrap: wrap; }
  html:not(#pf) .dataTables_wrapper .dataTables_paginate { max-width: 100%; flex-wrap: wrap; justify-content: center; }
  html:not(#pf) .dataTables_wrapper .dataTables_paginate .paginate_button { min-width: 0; }
  /* originale (nascosto) dei menu a tendina: mai oltre il contenitore */
  html:not(#pf) .pfss select, html:not(#pf) .rf-ms, html:not(#pf) .fad-head > *, html:not(#pf) .fad-actions > * { max-width: 100%; }
  /* intestazione della lezione a schermo intero: il padding del contenitore è più stretto del margine negativo della riga */
  html:not(#pf) .header_area > .container-fluid > .row { margin-inline: 0; }
  html:not(#pf) .pfss > select { min-width: 0 !important; /* !important: il min-width di 250 px è in linea sull'elemento */ }
  html:not(#pf) #main-content :is(.d-flex, .row) > * { max-width: 100%; }
  html:not(#pf) #main-content :is(.btn, .primary-btn) { white-space: normal; max-width: 100%; }
  html:not(#pf) #main-content .text-nowrap { white-space: normal !important; /* !important: .text-nowrap di Bootstrap è un'utilità con !important */ }
}
@media (min-width: 992px) and (max-width: 1279.98px) {
  /* topbar delle pagine di monitoraggio (hanno il pannello "mon-side" nella barra): le azioni vanno a capo invece di uscire dallo schermo */
  html:not(#pf) #main-nav-for-chat .header_iner:has(.mon-side) { position: relative !important; left: 0 !important; width: 100% !important; /* !important: larghezza e posizione della barra fissa sono calcolate sul layout fisso */ height: auto !important; min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
  html:not(#pf) #main-nav-for-chat .header_right:has(> .mon-side) { flex: 1 1 0; min-width: 0; flex-wrap: wrap !important; justify-content: flex-end !important; gap: 4px 6px; }
  html:not(#pf) #main-nav-for-chat .header_right:has(> .mon-side) .header_notification_warp { display: contents !important; }
  html:not(#pf) #main-content:has(.header_right > .mon-side) { padding-top: 8px !important; }
}
@media (min-width: 992px) and (max-width: 1099.98px) {
  /* schede riepilogo (4 per riga, es. Monitoraggio FAD): l'icona va sotto il testo invece di uscire dalla scheda */
  html:not(#pf) .single-summery { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 1199.98px) {
  /* player FAD sincrona (join-session): l'intestazione a 65 px fissi con tutto su una riga va a capo */
  html:not(#pf) .fad-header { height: auto; min-height: 65px; flex-wrap: wrap; gap: 8px 12px; padding-inline: 12px; }
  html:not(#pf) .fad-header > .d-flex { flex-wrap: wrap; gap: 6px 8px; min-width: 0; max-width: 100%; }
  html:not(#pf) .fad-header > .d-flex > * { margin-right: 0 !important; /* !important: me-2/me-3 sono utilità con !important; il gap li sostituisce */ }
}

/* ruolo sotto il nome nella sidebar del gestionale: etichetta a pillola, discreta */
html:not(#pf) #sidebar .sidebar-user h4 {
  margin: 0 0 6px;
  line-height: 1.25;
}

html:not(#pf) #sidebar .sidebar-user .sb-role {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 3px 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--pf-r-pill, 9999px);
  background: rgba(255, 255, 255, .1);
  color: var(--pf-nav-text, #fff);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html:not(#pf) #sidebar.mini_sidebar .sidebar-user .sb-role {
  display: none;
}

/* FASE 13 · testo minimo 12 px (token --pf-fs-caption). max() non rimpicciolisce mai: porta a 12 px solo ciò che è sotto. */
html:not(#pf) :is(small, .small, .font-12, .text-muted.small, sup, sub) { font-size: max(var(--pf-fs-caption), .875em) !important; }
html:not(#pf) :is(code, kbd, samp) { font-size: max(var(--pf-fs-caption), .875em) !important; }
html:not(#pf) th { font-size: max(var(--pf-fs-caption), 1em) !important; }
html:not(#pf) .badge { font-size: max(var(--pf-fs-caption), .75em) !important; }
html:not(#pf) :is(.image_size, .btn-sm, .btn-xs) { font-size: max(var(--pf-fs-caption), .875em) !important; }
/* !important: i vecchi stili e gli attributi style="" fissano 9–11,5 px */
html:not(#pf) :is([style*="font-size:9px"], [style*="font-size: 9px"], [style*="font-size:10px"], [style*="font-size: 10px"], [style*="font-size:10.5px"], [style*="font-size: 10.5px"], [style*="font-size:11px"], [style*="font-size: 11px"], [style*="font-size:11.5px"], [style*="font-size: 11.5px"], [style*="font-size:.7rem"], [style*="font-size: .7rem"], [style*="font-size:0.7rem"], [style*="font-size: 0.7rem"], [style*="font-size:.65rem"], [style*="font-size: .65rem"], [style*="font-size:0.7em"], [style*="font-size: 0.7em"]) { font-size: var(--pf-fs-caption) !important; }
html:not(#pf) :is(.kick, .sp-eyebrow, .pf-profile-kicker, .pv-toc h6) { font-size: max(var(--pf-fs-caption), 1em) !important; }

/* ==========================================================================
   FASE 13 · UN COMPONENTE PER TIPO (pulsante, badge, campo, cella di tabella)
   Allinea le varianti che divergevano nelle pagine (raggi 4/8/10/12 px, altezze 34–46 px, padding 13/14 px).
   !important: i vecchi stili e quelli di singole viste fissano altezze e raggi propri.
   ========================================================================== */
html:not(#pf) :is(.btn:not(.btn-sm):not(.btn-lg):not(.btn-xs):not(.btn-icon):not([class*="rounded-"]), .primary-btn:not([class*="rounded-"]), .theme_btn:not([class*="rounded-"])) {
  min-height: 40px !important;
  border-radius: var(--pf-r-sm) !important;
}
html:not(#pf) :is(.btn-sm, .btn-xs):not([class*="rounded-"]) { border-radius: var(--pf-r-sm) !important; }
html:not(#pf) .badge { border-radius: var(--pf-r-pill) !important; }
html:not(#pf) :is(input.form-control, select.form-control, .form-select, input.primary_input_field, select.primary_input_field):not([type="search"]):not([class*="rounded-"]):not([multiple]) {
  min-height: var(--pf-touch) !important;
  border-radius: var(--pf-r-sm) !important;
}
html:not(#pf) table tbody td:not(.p-0):not([class*="p-0"]) { padding-top: var(--pf-space-3) !important; padding-bottom: var(--pf-space-3) !important; }
html:not(#pf) table thead th:not(.p-0) { padding-top: var(--pf-space-3) !important; padding-bottom: var(--pf-space-3) !important; }
