/* =====================================================================
 * _redesign-impostazioni.css — Design system Impostazioni (ottanio v2)
 * Allinea la UI del portale `gestione` al mockup
 *   "DeskControl Impostazioni (standalone)".
 *
 * BRAND-AWARE: usa SOLO i token --ott-* di variables.css.
 *   --ott-base = var(--brand-base)  (CTA / attivo / accent — per-tenant)
 *   --ott-deep = var(--brand-deep-bg)
 *   --ott-soft = derivato da --brand-base
 * Nessun colore teal/blu hardcoded: la palette segue il branding del tenant.
 *
 * SCOPE: tutto sotto `body.portal-gestione` (impostato quando il portale
 * Impostazioni e' attivo) → non tocca mappa/perizie/repository.
 *
 * Caricato per ULTIMO nel <head> per vincere sul CSS legacy. Gli !important
 * sono mirati SOLO a proprieta' visive (colore/bg/bordo/raggio/font) per
 * battere gli stili inline dei popup; MAI su display/layout funzionale
 * (toggli show/hide, grid/flex strutturali gestiti dal JS).
 * ===================================================================== */

/* ---- container + titolo ------------------------------------------- */
body.portal-gestione .gestione-content {
  background: var(--ott-50);
}
body.portal-gestione .gestione-shell > h2 {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: var(--fs-22);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 14px;
}

/* ---- TAB PRIMARIE: gestione-group-btn → underline (.tabs1) -------- */
body.portal-gestione .gestione-menu-groups {
  gap: 0 !important;
  border-bottom: 1px solid var(--ott-200) !important;
  margin-bottom: 0 !important;
}
body.portal-gestione .gestione-group-btn {
  padding: 14px 18px 13px !important;
  font-family: var(--ff-body);
  font-size: var(--fs-13-5) !important;
  font-weight: 600 !important;
  color: var(--ott-500) !important;
  background: none !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione .gestione-group-btn:hover {
  color: var(--ink) !important;
}
body.portal-gestione .gestione-group-btn.active {
  color: var(--ott-base) !important;
  border-bottom-color: var(--ott-base) !important;
}

/* ---- TAB SECONDARIE: gestione-nav-btn → pill (.tabs2) ------------- */
body.portal-gestione .gestione-nav {
  gap: 6px;
  padding: 12px 0 14px;
  margin: 0 0 4px;
}
body.portal-gestione .gestione-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  font-size: var(--fs-12-5);
  font-weight: 600;
  color: var(--ott-500);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--rd-r-7);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione .gestione-nav-btn:hover {
  background: #fff;
  color: var(--ink);
}
body.portal-gestione .gestione-nav-btn.active {
  background: var(--ott-base);
  color: #fff;
  border-color: var(--ott-base);
}
/* contatore opzionale su pill (se presente .gestione-nav-count) */
body.portal-gestione .gestione-nav-count {
  font-family: var(--ff-mono);
  font-size: var(--fs-11);
  background: var(--ott-100);
  color: var(--ott-base);
  padding: 1px 6px;
  border-radius: var(--rd-r-pill);
}
body.portal-gestione .gestione-nav-btn.active .gestione-nav-count {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
}

/* ---- POPUP → card frame ------------------------------------------ */
body.portal-gestione .management-popup.gestione-inline-panel {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-12) !important;
  box-shadow: var(--rd-shadow-md) !important;
  background: #fff !important;
  padding: 0 !important;
  overflow: hidden;
}
body.portal-gestione .gestione-inline-panel .management-popup-header {
  padding: 13px 18px !important;
  border-bottom: 1px solid var(--ott-100) !important;
  background: var(--ott-50) !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione .gestione-inline-panel .management-popup-title,
body.portal-gestione .gestione-inline-panel .management-sheet-title {
  font-family: var(--ff-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-13) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight);
  color: var(--ott-700) !important;
}
/* il body del popup (tab-panel o .section diretta) recupera il padding
 * che il frame ha azzerato */
body.portal-gestione .gestione-inline-panel > .section,
body.portal-gestione .gestione-inline-panel .management-tab-panel.active,
body.portal-gestione .gestione-inline-panel .management-tabs {
  padding-left: 18px;
  padding-right: 18px;
}
body.portal-gestione .gestione-inline-panel > .section:first-of-type {
  padding-top: 16px;
}
body.portal-gestione .gestione-inline-panel > .section:last-child {
  padding-bottom: 18px;
}

/* ---- management-tabs (dentro popup) → segmented pill -------------- */
body.portal-gestione .gestione-inline-panel .management-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ott-100);
  flex-wrap: wrap;
}
body.portal-gestione .gestione-inline-panel .management-tab {
  padding: 7px 13px !important;
  font-size: var(--fs-12-5) !important;
  font-weight: 600 !important;
  color: var(--ott-500) !important;
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-7) !important;
  transition: background var(--t-fast), color var(--t-fast);
}
body.portal-gestione .gestione-inline-panel .management-tab:hover {
  color: var(--ink) !important;
  background: #fff !important;
}
body.portal-gestione .gestione-inline-panel .management-tab.active {
  background: var(--ott-base) !important;
  color: #fff !important;
  border-color: var(--ott-base) !important;
}

/* ---- .section → card interna ------------------------------------- */
body.portal-gestione .gestione-inline-panel .section {
  border: 1px solid var(--ott-200) !important;
  background: #fff !important;
  border-radius: var(--rd-r-8) !important;
  padding: 16px !important;
  margin-bottom: 14px !important;
}
/* .section che fa da corpo diretto del popup: niente doppio bordo */
body.portal-gestione .gestione-inline-panel > .section:only-of-type {
  border: 0 !important;
  border-radius: 0 !important;
}

/* ---- FORM: label / input / select / textarea --------------------- */
body.portal-gestione .gestione-inline-panel label {
  font-family: var(--ff-body);
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--ott-500);
  letter-spacing: 0.04em;
}
body.portal-gestione .gestione-inline-panel input[type="text"],
body.portal-gestione .gestione-inline-panel input[type="email"],
body.portal-gestione .gestione-inline-panel input[type="password"],
body.portal-gestione .gestione-inline-panel input[type="number"],
body.portal-gestione .gestione-inline-panel input[type="search"],
body.portal-gestione .gestione-inline-panel input[type="url"],
body.portal-gestione .gestione-inline-panel input[type="tel"],
body.portal-gestione .gestione-inline-panel input[type="date"],
body.portal-gestione .gestione-inline-panel select,
body.portal-gestione .gestione-inline-panel textarea,
body.portal-gestione .gestione-inline-panel .management-search {
  height: 36px;
  padding: 0 12px !important;
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  color: var(--ink) !important;
  outline: none;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
body.portal-gestione .gestione-inline-panel textarea {
  height: auto;
  min-height: 72px;
  padding: 9px 12px !important;
  line-height: 1.5;
  resize: vertical;
}
body.portal-gestione .gestione-inline-panel input::placeholder,
body.portal-gestione .gestione-inline-panel textarea::placeholder {
  color: var(--ott-300);
}
body.portal-gestione .gestione-inline-panel input:hover,
body.portal-gestione .gestione-inline-panel select:hover,
body.portal-gestione .gestione-inline-panel textarea:hover {
  background: #fff !important;
}
body.portal-gestione .gestione-inline-panel input:focus,
body.portal-gestione .gestione-inline-panel select:focus,
body.portal-gestione .gestione-inline-panel textarea:focus {
  border-color: var(--ott-base) !important;
  background: #fff !important;
  box-shadow: var(--rd-focus-ring);
}
body.portal-gestione .gestione-inline-panel select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px !important;
}
body.portal-gestione .gestione-inline-panel select[multiple] {
  height: auto;
  background-image: none;
  padding: 6px !important;
}

/* ---- BOTTONI ----------------------------------------------------- */
body.portal-gestione .gestione-inline-panel .btn,
body.portal-gestione .gestione-inline-panel button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body);
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  border: 1px solid transparent !important;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
/* primario = brand */
body.portal-gestione .gestione-inline-panel .btn.primary,
body.portal-gestione .gestione-inline-panel .btn-primary,
body.portal-gestione .gestione-inline-panel .imp-btn--primary {
  background: var(--ott-base) !important;
  color: #fff !important;
  border-color: var(--ott-base) !important;
}
body.portal-gestione .gestione-inline-panel .btn.primary:hover,
body.portal-gestione .gestione-inline-panel .btn-primary:hover,
body.portal-gestione .gestione-inline-panel .imp-btn--primary:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}
/* secondario/ghost */
body.portal-gestione .gestione-inline-panel .btn.sec,
body.portal-gestione .gestione-inline-panel .btn.ghost,
body.portal-gestione .gestione-inline-panel .imp-btn--ghost {
  background: #fff !important;
  color: var(--ink) !important;
  border-color: var(--ott-200) !important;
}
body.portal-gestione .gestione-inline-panel .btn.sec:hover,
body.portal-gestione .gestione-inline-panel .btn.ghost:hover,
body.portal-gestione .gestione-inline-panel .imp-btn--ghost:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}
/* distruttivo */
body.portal-gestione .gestione-inline-panel .btn.danger,
body.portal-gestione .gestione-inline-panel .imp-btn--danger {
  background: #fff !important;
  color: var(--ott-red) !important;
  border-color: color-mix(in srgb, var(--ott-red) 35%, white) !important;
}
body.portal-gestione .gestione-inline-panel .btn.danger:hover,
body.portal-gestione .gestione-inline-panel .imp-btn--danger:hover {
  background: color-mix(in srgb, var(--ott-red) 8%, white) !important;
}

/* ---- TABELLE: simple-table --------------------------------------- */
body.portal-gestione .gestione-inline-panel .simple-table {
  border: 1px solid var(--ott-200);
  border-radius: var(--rd-r-8);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  font-size: var(--fs-12-5);
}
body.portal-gestione .gestione-inline-panel .simple-table th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione .gestione-inline-panel .simple-table td {
  border-bottom: 1px solid var(--ott-100) !important;
  color: var(--ink);
}
body.portal-gestione .gestione-inline-panel .simple-table tr:last-child td {
  border-bottom: 0 !important;
}
body.portal-gestione .gestione-inline-panel .simple-table tbody tr:hover td {
  background: var(--ott-50);
}

/* ---- HINT / FOOTER ----------------------------------------------- */
body.portal-gestione .gestione-inline-panel .gestione-panel-hint {
  font-size: var(--fs-12);
  color: var(--ott-500);
  line-height: 1.5;
}
body.portal-gestione .gestione-inline-panel .gestione-panel-hint strong {
  color: var(--ott-700);
}
body.portal-gestione .gestione-inline-panel .gestione-panel-footer {
  border-top: 1px solid var(--ott-100);
}

/* =====================================================================
 * UTILITY CLASSES (prefisso .imp-) — usate dagli edit per-sezione per
 * convertire markup inline-styled in componenti puliti del mockup.
 * Tutte scoped a body.portal-gestione.
 * ===================================================================== */
body.portal-gestione .imp-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
body.portal-gestione .imp-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
body.portal-gestione .imp-field > label,
body.portal-gestione .imp-field__lbl {
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--ott-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
body.portal-gestione .imp-field__lbl .req {
  color: var(--ott-red);
  font-weight: 700;
}
body.portal-gestione .imp-field__lbl .opt {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ott-300);
  text-transform: none;
  letter-spacing: 0;
}
body.portal-gestione .imp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
body.portal-gestione .imp-sechead {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}
body.portal-gestione .imp-sechead h3,
body.portal-gestione .imp-sechead .imp-title {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: var(--fs-15);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione .imp-sechead .imp-dot {
  width: 6px;
  height: 18px;
  background: var(--ott-base);
  border-radius: 2px;
  flex-shrink: 0;
}
/* pill stato/ruolo */
body.portal-gestione .imp-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-10-5);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--rd-r-pill);
}
body.portal-gestione .imp-pill--ok {
  background: color-mix(in srgb, var(--ott-green) 14%, white);
  color: color-mix(in srgb, var(--ott-green) 70%, black);
}
body.portal-gestione .imp-pill--warn {
  background: var(--ott-warn-bg, color-mix(in srgb, var(--ott-warn) 16%, white));
  color: color-mix(in srgb, var(--ott-warn) 75%, black);
}
body.portal-gestione .imp-pill--brand {
  background: color-mix(in srgb, var(--ott-base) 10%, white);
  color: var(--ott-base);
}
/* dropzone import massivo */
body.portal-gestione .imp-dropzone {
  border: 1.5px dashed var(--ott-300);
  border-radius: var(--rd-r-9);
  background: var(--ott-50);
  padding: 22px;
  text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast);
}
body.portal-gestione .imp-dropzone:hover {
  border-color: var(--ott-base);
  background: #fff;
}
/* badge "import massivo" / tag tenui */
body.portal-gestione .imp-tag {
  font-size: var(--fs-10-5);
  font-weight: 600;
  color: var(--ott-500);
  background: var(--ott-100);
  padding: 2px 8px;
  border-radius: var(--rd-r-pill);
}


/* =====================================================================
 * OVERRIDE PER-SEZIONE — generati dal workflow redesign-impostazioni
 * (un agente per sezione), verificati token-compliance + fedelta mockup.
 * Tutti scoped a body.portal-gestione #<popupId>, token-only, brand-aware.
 * Estendono la fondazione sopra: aggiungono solo i bespoke non coperti.
 * ===================================================================== */
/* ==================== Utenti (#usersPopup) — overrides-added ==================== */
/* ============================================================
 * OVERRIDE SEZIONE "Utenti" — body.portal-gestione #usersPopup
 * Token-only. La fondazione (.gestione-inline-panel) copre gia':
 * frame popup, header/title, management-tabs, .section, label,
 * input/select/textarea, .btn/.btn.primary/.sec/.danger,
 * .simple-table, .management-search, hint.
 * Qui SOLO cio' che resta fuori per questo popup.
 * ============================================================ */

/* 1. <small> hint con #6b7280 hardcoded inline + hint vari ---- */
body.portal-gestione #usersPopup small,
body.portal-gestione #usersPopup #userCostPerHourHint,
body.portal-gestione #usersPopup #userFormHint,
body.portal-gestione #usersPopup #userBatchHint {
  color: var(--ott-500) !important;
  font-size: var(--fs-11-5) !important;
}

/* 2. titoli .section h2 ('Utenti batch', 'Utenti registrati') --
 *    la fondazione stila popup-title / .imp-sechead h3, non h2 raw */
body.portal-gestione #usersPopup .section h2 {
  font-family: var(--ff-display) !important;
  font-weight: 800 !important;
  font-size: var(--fs-15) !important;
  color: var(--ott-700) !important;
  letter-spacing: -0.01em;
  margin: 0 0 12px !important;
}

/* 3. toggle collassabile 'Utenti batch' — triangolo neutro/attivo */
body.portal-gestione #usersPopup .section-triangle {
  border-left-color: var(--ott-500) !important;
}
body.portal-gestione #usersPopup .section-title-row:hover .section-triangle,
body.portal-gestione #usersPopup .collapsible-section:not(.collapsed) .section-triangle {
  border-left-color: var(--ott-base) !important;
}

/* 4. .btn-compact (Modifica/Cancella/template) — versione bassa
 *    coerente coi .btn della fondazione, solo dimensioni */
body.portal-gestione #usersPopup .btn.btn-compact {
  height: 30px;
  padding: 0 12px !important;
  font-size: var(--fs-12-5) !important;
}

/* 5. input[type=file] (batch xlsx) — non matchato dalla lista
 *    input-type della fondazione: stesso look field a token */
body.portal-gestione #usersPopup input[type="file"] {
  font-size: var(--fs-12-5) !important;
  color: var(--ott-500) !important;
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  padding: 7px 10px !important;
}
body.portal-gestione #usersPopup input[type="file"]:hover {
  background: #fff !important;
  border-color: var(--ott-300) !important;
}
/* ==================== Clienti (#clientsPopup) — overrides-added ==================== */
/* ===== Impostazioni · Clienti — override scoped (token-only) =====
 * #clientsPopup riceve .gestione-inline-panel via JS (deskcontrol-portal.js:1388/1419)
 * → frame/header/tabs/section/btn/simple-table gia' coperti dalla fondazione.
 * Qui si riallineano SOLO le classi bespoke client-* (client-form.css) e gli
 * hex inline del markup, che la fondazione non tocca. */

/* --- fieldset anagrafici: token legacy --brand-* -> ottanio --- */
body.portal-gestione #clientsPopup .client-fs {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  background: var(--ott-50) !important;
}
body.portal-gestione #clientsPopup .client-fs-legend {
  font-family: var(--ff-display);
  color: var(--ott-700) !important;
  letter-spacing: var(--ls-caps-tight);
}
body.portal-gestione #clientsPopup .client-fs label {
  color: var(--ott-500) !important;
  letter-spacing: var(--ls-caps-wide);
}

/* --- input/select/textarea bespoke: ribattono i campi della fondazione
 *     (6px/radius6/#fff) -> riallineo a h36/ott-50/ott-200/rd-r-8 --- */
body.portal-gestione #clientsPopup .client-fs input[type="text"],
body.portal-gestione #clientsPopup .client-fs input[type="tel"],
body.portal-gestione #clientsPopup .client-fs input[type="email"],
body.portal-gestione #clientsPopup .client-fs input[type="url"],
body.portal-gestione #clientsPopup .client-fs input[type="date"],
body.portal-gestione #clientsPopup .client-fs select {
  height: 36px;
  padding: 0 12px !important;
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  font-size: var(--fs-13) !important;
  color: var(--ink) !important;
}
body.portal-gestione #clientsPopup .client-fs textarea {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  font-size: var(--fs-13) !important;
  color: var(--ink) !important;
}
body.portal-gestione #clientsPopup .client-fs input:hover,
body.portal-gestione #clientsPopup .client-fs select:hover,
body.portal-gestione #clientsPopup .client-fs textarea:hover {
  background: #fff !important;
}
body.portal-gestione #clientsPopup .client-fs input:focus,
body.portal-gestione #clientsPopup .client-fs select:focus,
body.portal-gestione #clientsPopup .client-fs textarea:focus {
  border-color: var(--ott-base) !important;
  background: #fff !important;
  box-shadow: var(--rd-focus-ring) !important;
}

/* --- hint inline tipizzati --- */
body.portal-gestione #clientsPopup .client-field-hint { color: var(--ott-500); }
body.portal-gestione #clientsPopup .client-field-hint.error { color: var(--ott-error) !important; }
body.portal-gestione #clientsPopup .client-field-hint.ok { color: var(--ott-green) !important; }

/* --- avatar preview / lista indirizzi --- */
body.portal-gestione #clientsPopup .client-avatar-preview {
  background: var(--ott-100) !important;
  border: 1px solid var(--ott-200) !important;
}
body.portal-gestione #clientsPopup .client-avatar-preview span { color: var(--ott-500) !important; }
body.portal-gestione #clientsPopup .client-address-empty { color: var(--ott-500) !important; }
body.portal-gestione #clientsPopup .client-address-row {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #clientsPopup .client-address-row-title { color: var(--ott-700) !important; }

/* --- griglia card clienti (master view) --- */
body.portal-gestione #clientsPopup .client-card {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-9) !important;
  box-shadow: var(--rd-shadow-sm);
  transition: box-shadow var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
body.portal-gestione #clientsPopup .client-card:hover {
  box-shadow: var(--rd-shadow-md) !important;
  border-color: var(--ott-base) !important;
}
body.portal-gestione #clientsPopup .client-card-avatar {
  background: var(--ott-100) !important;
  border: 1px solid var(--ott-200) !important;
  color: var(--ott-500) !important;
}
body.portal-gestione #clientsPopup .client-card-name { color: var(--ink) !important; }
body.portal-gestione #clientsPopup .client-card-sub { color: var(--ott-500) !important; }

/* badge stato su card -> pill tenue */
body.portal-gestione #clientsPopup .client-card-badge {
  background: var(--ott-100) !important;
  color: var(--ott-500) !important;
  border-radius: var(--rd-r-pill) !important;
  letter-spacing: var(--ls-caps-wide);
}
body.portal-gestione #clientsPopup .client-card-badge.inactive {
  background: color-mix(in srgb, var(--ott-red) 12%, white) !important;
  color: var(--ott-red) !important;
}

/* --- small/code inline del markup (hex hardcoded) --- */
body.portal-gestione #clientsPopup small[style] { color: var(--ott-500) !important; }
body.portal-gestione #clientsPopup .client-avatar-preview span[style] { color: var(--ott-500) !important; }
body.portal-gestione #clientsPopup label > span[style] { color: var(--ott-300) !important; }
body.portal-gestione #clientsPopup small code,
body.portal-gestione #clientsPopup .client-field-hint code {
  font-family: var(--ff-mono);
  font-size: var(--fs-11);
  background: var(--ott-100);
  color: var(--ott-base);
  padding: 1px 5px;
  border-radius: var(--rd-r-5);
}

/* --- CTA "bare" (.btn senza .sec/.ghost/.danger) = primario brand,
 *     allineato al pulsante CTA del mockup --- */
body.portal-gestione #clientsPopup .btn:not(.sec):not(.ghost):not(.danger):not(.primary) {
  background: var(--ott-base) !important;
  color: #fff !important;
  border-color: var(--ott-base) !important;
}
body.portal-gestione #clientsPopup .btn:not(.sec):not(.ghost):not(.danger):not(.primary):hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}
/* ==================== Tecnici (#peritiPopup) — overrides-added ==================== */
/* ===== Tecnici — #peritiPopup: override token-only scoped =====
 * Allinea i componenti bespoke che la fondazione non copre.
 * Tutto sotto body.portal-gestione #peritiPopup, solo token ottanio. */

/* --- multi-check pills (titoli studio / ordine-albo / tecnico interno) --- */
body.portal-gestione #peritiPopup .check-pill {
  font-size: var(--fs-13) !important;
  color: var(--ink) !important;
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-pill) !important;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
body.portal-gestione #peritiPopup .check-pill:hover {
  background: #fff !important;
  border-color: var(--ott-300) !important;
}
body.portal-gestione #peritiPopup .check-pill:has(input:checked) {
  background: color-mix(in srgb, var(--ott-base) 10%, white) !important;
  border-color: var(--ott-base) !important;
  color: var(--ott-base) !important;
}
body.portal-gestione #peritiPopup .check-pill input {
  accent-color: var(--ott-base);
}

/* --- province tags (peritoProvinceTags) → badge tenue mockup --- */
body.portal-gestione #peritiPopup .tag-pill {
  font-size: var(--fs-11-5) !important;
  color: var(--ott-500) !important;
  background: var(--ott-100) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-pill) !important;
}
body.portal-gestione #peritiPopup .tag-pill button {
  color: var(--ott-500) !important;
}
body.portal-gestione #peritiPopup .tag-pill button:hover {
  color: var(--ott-red) !important;
}

/* --- heading di sezione interna ("Periti batch", "Elenco tecnici") --- */
body.portal-gestione #peritiPopup .section h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--ff-display) !important;
  font-weight: 800 !important;
  font-size: var(--fs-15) !important;
  color: var(--ink) !important;
}
body.portal-gestione #peritiPopup .section h2::before {
  content: "";
  width: 6px;
  height: 18px;
  background: var(--ott-base);
  border-radius: 2px;
  flex-shrink: 0;
}

/* --- triangolo collapsible "Periti batch" --- */
body.portal-gestione #peritiPopup .section-triangle {
  border-left-color: var(--ott-500) !important;
}

/* --- voto medio read-only: bg grigio inline → token --- */
body.portal-gestione #peritiPopup #peritoVoto {
  background: var(--ott-50) !important;
  color: var(--ink) !important;
}

/* --- helper / note --- */
body.portal-gestione #peritiPopup .section small,
body.portal-gestione #peritiPopup .rd-help {
  color: var(--ott-500) !important;
}
body.portal-gestione #peritiPopup .required-note {
  font-size: var(--fs-11) !important;
  font-weight: 600;
  color: var(--ott-red) !important;
}
/* ==================== Gruppi (#gruppiPopup) — overrides-added ==================== */
/* ===== Impostazioni · Gruppi — override ottanio (token-only) =====
 * Scope: body.portal-gestione #gruppiPopup. Il popup riceve a runtime
 * la classe .gestione-inline-panel (deskcontrol-portal.js:1419) quindi la
 * fondazione copre gia' tab/section/input/label/.btn/.simple-table.
 * Qui si correggono SOLO i pezzi bespoke non coperti: la card gruppo,
 * le righe header-gruppo della matrice servizi, il bottone Elimina inline
 * e i testi secondari resi via token legacy (--text-muted/--text-secondary).
 * !important mirato a battere CSS legacy + stili inline del JS. */

/* card gruppo: bordo/raggio/bg legacy -> ottanio */
body.portal-gestione #gruppiPopup .gruppi-card {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  background: #fff !important;
}

/* righe "header gruppo" dentro la matrice servizi/permessi:
   colore legacy --text-muted -> --ott-500, con banda tenue --ott-50 */
body.portal-gestione #gruppiPopup .simple-table .tbl-group-hdr td {
  color: var(--ott-500) !important;
  background: var(--ott-50) !important;
  letter-spacing: var(--ls-caps-wide, 0.04em);
}

/* bottone "Elimina" inline: rosso legacy -> --ott-red */
body.portal-gestione #gruppiPopup .btn-inline-danger {
  color: var(--ott-red) !important;
}

/* testi secondari resi via token brand legacy nel JS:
   empty-state, badge (default), conteggio membri, label MFA -> grigio ottanio.
   Gli stili sono inline sugli elementi dinamici, quindi serve !important. */
body.portal-gestione #gruppiPopup #gruppiListContainer > p,
body.portal-gestione #gruppiPopup .gruppi-card-header span,
body.portal-gestione #gruppiPopup .gruppi-card label {
  color: var(--ott-500) !important;
}
/* ==================== Tipologie perizia (#tipologiePerziaPopup) — overrides-added ==================== */
/* === Tipologie perizia — override scoped token-only ===
 * Popup montato come #tipologiePerziaPopup (.management-popup.gestione-inline-panel)
 * in js/tipologie-admin.js. La fondazione copre frame/header/.section/.simple-table/
 * input/.btn. Qui si neutralizzano SOLO gli hardcode inline dei bottoni bespoke
 * (non-.btn) e delle celle/span colorati inline della tabella. !important per
 * battere lo style inline del markup JS. */

/* hint descrittivo <p> inline (color:#64748b;font-size:13px) */
body.portal-gestione #tipologiePerziaPopup .section > p {
  color: var(--ott-500) !important;
  font-size: var(--fs-13) !important;
}

/* toolbar bottoni bespoke (no classe .btn) — h36 + radius/font allineati */
body.portal-gestione #tipologiePerziaPopup #tipologieAddBtn,
body.portal-gestione #tipologiePerziaPopup #tipologieReloadBtn,
body.portal-gestione #tipologiePerziaPopup #tipologieLegacyBtn {
  height: 36px;
  padding: 0 14px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  border-radius: var(--rd-r-8) !important;
  border: 1px solid transparent !important;
}
/* "+ Nuova tipologia" = CTA primaria brand (era #890103 logo-red) */
body.portal-gestione #tipologiePerziaPopup #tipologieAddBtn {
  background: var(--ott-base) !important;
  color: #fff !important;
  border-color: var(--ott-base) !important;
}
body.portal-gestione #tipologiePerziaPopup #tipologieAddBtn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}
/* "Ricarica" = ghost (era #f1f5f9 / #cbd5e1) */
body.portal-gestione #tipologiePerziaPopup #tipologieReloadBtn {
  background: #fff !important;
  color: var(--ink) !important;
  border-color: var(--ott-200) !important;
}
body.portal-gestione #tipologiePerziaPopup #tipologieReloadBtn:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}
/* "Migra legacy" = ghost warn-tinted (era #fef3c7 / #fcd34d / #92400e) */
body.portal-gestione #tipologiePerziaPopup #tipologieLegacyBtn {
  background: color-mix(in srgb, var(--ott-warn) 12%, white) !important;
  color: color-mix(in srgb, var(--ott-warn) 78%, black) !important;
  border-color: color-mix(in srgb, var(--ott-warn) 38%, white) !important;
}
body.portal-gestione #tipologiePerziaPopup #tipologieLegacyBtn:hover {
  background: color-mix(in srgb, var(--ott-warn) 20%, white) !important;
}

/* celle riassunto cartelle (color:#64748b;font-size:11px inline) */
body.portal-gestione #tipologiePerziaPopup .simple-table td[style*="font-size:11px"] {
  color: var(--ott-500) !important;
  font-size: var(--fs-11) !important;
}
/* span stato attiva/disattiva (color:#16a34a / #dc2626 inline) */
body.portal-gestione #tipologiePerziaPopup .simple-table td span[style*="#16a34a"] {
  color: var(--ott-green) !important;
}
body.portal-gestione #tipologiePerziaPopup .simple-table td span[style*="#dc2626"] {
  color: var(--ott-red) !important;
}
/* bottone Elimina riga: .btn.sec con inline bg:#fee2e2;color:#991b1b → danger tokenizzato */
body.portal-gestione #tipologiePerziaPopup .simple-table .btn.sec[data-action="delete"] {
  background: color-mix(in srgb, var(--ott-red) 8%, white) !important;
  color: var(--ott-red) !important;
  border-color: color-mix(in srgb, var(--ott-red) 30%, white) !important;
}
/* righe placeholder/loading/errore (colspan) — colori inline #64748b / #dc2626 */
body.portal-gestione #tipologiePerziaPopup .simple-table td[colspan][style*="#64748b"] {
  color: var(--ott-500) !important;
}
body.portal-gestione #tipologiePerziaPopup .simple-table td[colspan][style*="#dc2626"] {
  color: var(--ott-red) !important;
}
/* ==================== Inviti (#invitiPopup) — overrides-added ==================== */
/* ===== Inviti (#invitiPopup) — override scoped, token-only =====
 * Il popup riceve gestione-inline-panel a runtime: form/header/.section
 * gia' coperti dalla fondazione. Qui solo gli elementi bespoke e gli hex inline. */

/* Bottoni invito: .mon-filter-btn non e' .btn e la regola legacy e' scoped a
 * .monitoring-filters → qui senza stile. Resi primari brand (h36, mockup). */
body.portal-gestione #invitiPopup .mon-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: var(--ott-base) !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #invitiPopup .mon-filter-btn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}
body.portal-gestione #invitiPopup .mon-filter-btn:focus-visible {
  outline: none;
  box-shadow: var(--rd-focus-ring);
}

/* Messaggi esito (#090 inline) → verde semantico */
body.portal-gestione #invitiPopup #inviteSendMsg,
body.portal-gestione #invitiPopup #inviteBulkMsg {
  font-size: var(--fs-12) !important;
  font-weight: 600;
  color: var(--ott-green) !important;
}

/* Summary "Invito multiplo" (#666 inline) → testo secondario */
body.portal-gestione #invitiPopup details > summary {
  font-size: var(--fs-12) !important;
  font-weight: 600;
  color: var(--ott-500) !important;
}

/* Tabella inviti: .monitoring-log-table/.audit-table-wrap allineati a .simple-table */
body.portal-gestione #invitiPopup .audit-table-wrap {
  border: 1px solid var(--ott-200);
  border-radius: var(--rd-r-8);
  overflow: hidden;
}
body.portal-gestione #invitiPopup .monitoring-log-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-12-5) !important;
}
body.portal-gestione #invitiPopup .monitoring-log-table th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-family: var(--ff-body);
  font-weight: 600 !important;
  font-size: var(--fs-11) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #invitiPopup .monitoring-log-table td {
  color: var(--ink) !important;
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #invitiPopup .monitoring-log-table tbody tr:last-child td {
  border-bottom: 0 !important;
}
body.portal-gestione #invitiPopup .monitoring-log-table tbody tr:hover td {
  background: var(--ott-50) !important;
}
/* esito riga (se valorizzati dal renderer JS) su token semantici */
body.portal-gestione #invitiPopup .monitoring-log-table .status-ok {
  color: var(--ott-green) !important;
}
body.portal-gestione #invitiPopup .monitoring-log-table .status-err {
  color: var(--ott-red) !important;
}
/* ==================== Permessi (#permessiPopup) — overrides-added ==================== */
/* === Permessi (#permessiPopup) — override scoped token-only === */

/* Righe header di gruppo (.tbl-group-hdr): nel legacy il colore e' mappato a
 * var(--text-muted, #888) e border-bottom:none (senza !important). La fondazione
 * .simple-table td applica border-bottom 1px --ott-100 !important, aggiungendo una
 * riga indesiderata sotto le label di gruppo. Le allineo al divider "th-like" del
 * mockup: bg tenue --ott-50, label --ott-500 uppercase, divisore --ott-100. */
body.portal-gestione #permessiPopup .permessi-matrix .tbl-group-hdr td {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-family: var(--ff-body) !important;
  font-weight: 600 !important;
  font-size: var(--fs-11) !important;
  letter-spacing: var(--ls-caps-wide, 0.1em) !important;
  border-bottom: 1px solid var(--ott-100) !important;
}

/* Le righe header di gruppo non sono interattive: neutralizzo l'hover --ott-50
 * che la fondazione applica via .simple-table tbody tr:hover td. */
body.portal-gestione #permessiPopup .permessi-matrix tbody tr.tbl-group-hdr:hover td {
  background: var(--ott-50) !important;
}
/* ==================== Ruoli (#ruoliPopup) — overrides-added ==================== */
/* ====================================================================
 * Override sezione "Ruoli & Permessi" — #ruoliPopup
 * Scoped body.portal-gestione #ruoliPopup, token-only.
 * Il popup riceve .gestione-inline-panel a runtime (deskcontrol-portal.js
 * mappings, key "ruoli") quindi form/label/input ereditano la fondazione.
 * Qui copro SOLO cio' che la fondazione NON tocca:
 *  - .mon-filter-btn bespoke (non .btn; il selettore legacy
 *    `.monitoring-filters .mon-filter-btn` non li raggiunge -> resterebbero
 *    bottoni di default browser) -> primario ottanio brand-aware
 *  - .monitoring-log-table bespoke (non .simple-table; legacy usa token
 *    --surface-*/--border non ottanio) -> th/td/hover/raggio ottanio
 *  - span messaggi con color:#090 hardcoded -> --ott-green
 *  - #rolePermMatrix border-top #eee hardcoded -> --ott-100
 * ==================================================================== */

/* --- bottoni bespoke .mon-filter-btn -> primario brand --- */
body.portal-gestione #ruoliPopup .mon-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: var(--ott-base) !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #ruoliPopup .mon-filter-btn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* --- messaggi esito: #090 hardcoded -> --ott-green --- */
body.portal-gestione #ruoliPopup #roleCreateMsg,
body.portal-gestione #ruoliPopup #rolePermSaveMsg {
  font-family: var(--ff-body);
  font-size: var(--fs-12) !important;
  font-weight: 600;
  color: var(--ott-green) !important;
}

/* --- tabella ruoli bespoke .monitoring-log-table -> ottanio --- */
body.portal-gestione #ruoliPopup .monitoring-log-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--ott-200);
  border-radius: var(--rd-r-8);
  overflow: hidden;
  font-family: var(--ff-body);
  font-size: var(--fs-12-5);
}
body.portal-gestione #ruoliPopup .monitoring-log-table th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-weight: 600;
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #ruoliPopup .monitoring-log-table td {
  color: var(--ink);
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #ruoliPopup .monitoring-log-table tbody tr:last-child td {
  border-bottom: 0 !important;
}
body.portal-gestione #ruoliPopup .monitoring-log-table tbody tr:hover td {
  background: var(--ott-50) !important;
}

/* --- matrice permessi: separatore #eee hardcoded -> --ott-100 --- */
body.portal-gestione #ruoliPopup #rolePermMatrix {
  border-top: 1px solid var(--ott-100) !important;
}
/* ==================== Produzione (#produzionePopup) — overrides-added ==================== */
/* === Produzione (#produzionePopup) — allineamento ottanio, token-only, scoped === */

/* Toggle switch: OFF grigio ottanio, ON brand, knob bianco (batte cap-insight.css / cross-file) */
body.portal-gestione #produzionePopup .toggle-switch .toggle-slider {
  background: var(--ott-300) !important;
  border-radius: var(--rd-r-pill) !important;
}
body.portal-gestione #produzionePopup .toggle-switch .toggle-slider:before {
  background: #fff !important;
  border-radius: var(--rd-r-pill) !important;
}
body.portal-gestione #produzionePopup .toggle-switch input:checked + .toggle-slider {
  background: var(--ott-base) !important;
}

/* Intestazioni di gruppo tabella: neutro tenue + label secondaria uppercase */
body.portal-gestione #produzionePopup .produzione-table .tbl-group-hdr {
  background: var(--ott-50) !important;
  border-radius: var(--rd-r-6) !important;
}
body.portal-gestione #produzionePopup .produzione-table .tbl-group-hdr td {
  color: var(--ott-500) !important;
}

/* Separatori riga: bordo standard ottanio */
body.portal-gestione #produzionePopup .produzione-table tbody tr {
  border-bottom: 1px solid var(--ott-200) !important;
}

/* Etichetta funzione: testo principale ink */
body.portal-gestione #produzionePopup .produzione-table tbody tr td:first-child {
  color: var(--ink) !important;
}
/* ==================== API Keys (#apikeysPopup) — overrides-added ==================== */
/* === API Keys (#apikeysPopup) — override scoped token-only ===
 * La fondazione (gestione-inline-panel, aggiunto via JS) copre gia':
 * header/title, .section card, label/input[text|number]/select/textarea, focus.
 * Qui si allinea SOLO cio' che e' bespoke: .mon-filter-btn, .monitoring-log-table,
 * summary grigio, e il modale one-time (arancio hardcoded + code key). */

/* bottoni bespoke .mon-filter-btn -> btn primario brand (mockup h36/--rd-r-8) */
body.portal-gestione #apikeysPopup .mon-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #apikeysPopup .mon-filter-btn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* tabella keys -> look .simple-table (th ott-50/ott-500 caps, td ott-100) */
body.portal-gestione #apikeysPopup .monitoring-log-table {
  font-size: var(--fs-12-5) !important;
}
body.portal-gestione #apikeysPopup .monitoring-log-table th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-family: var(--ff-body) !important;
  font-weight: 600 !important;
  font-size: var(--fs-11) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #apikeysPopup .monitoring-log-table td {
  border-bottom: 1px solid var(--ott-100) !important;
  color: var(--ink) !important;
}
body.portal-gestione #apikeysPopup .monitoring-log-table tr:hover td {
  background: var(--ott-50) !important;
}

/* summary "Scopes" grigio hardcoded #666 -> ott-500 */
body.portal-gestione #apikeysPopup details > summary {
  color: var(--ott-500) !important;
  font-size: var(--fs-12) !important;
  font-weight: 600;
}

/* modale one-time key: arancio hardcoded -> token attenzione (--ott-warn) */
body.portal-gestione #apikeysPopup #akOneTimeModal {
  background: color-mix(in srgb, var(--ott-warn) 10%, white) !important;
  border: 1px solid color-mix(in srgb, var(--ott-warn) 45%, white) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #apikeysPopup #akOneTimeModal > div:first-child {
  color: color-mix(in srgb, var(--ott-warn) 80%, black) !important;
}
/* code della key one-time -> mono + bordo ott-200 */
body.portal-gestione #apikeysPopup #akOneTimeKey {
  font-family: var(--ff-mono) !important;
  font-size: var(--fs-12-5) !important;
  background: #fff !important;
  color: var(--ink) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-6) !important;
}
/* ==================== Abbonamento (#abbonamentoPopup) — overrides-added ==================== */
/* === Abbonamento — override scoped (token-only) ===
 * Il popup riceve .gestione-inline-panel a runtime (deskcontrol-portal.js:1419),
 * quindi frame/header/.section/input/select/.btn/.simple-table sono gia'
 * coperti dalla fondazione. Qui solo cio' che la fondazione NON tocca:
 * badge piano bespoke, testi grigi inline, bottoni .mon-filter-btn legacy,
 * tabella .monitoring-log-table legacy, divisori/messaggi. */

/* Badge piano: pill mockup. NON forzo il background (lo setta il JS per
 * plan_code via _PLAN_COLORS / fallback #666 funzionale). */
body.portal-gestione #abbonamentoPopup #subPlanBadge {
  font-family: var(--ff-body) !important;
  font-size: var(--fs-12-5) !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  border-radius: var(--rd-r-pill) !important;
  letter-spacing: 0.02em;
}

/* Testi stato / periodo piano */
body.portal-gestione #abbonamentoPopup #subPlanStatus {
  color: var(--ott-500) !important;
  font-size: var(--fs-13) !important;
}
body.portal-gestione #abbonamentoPopup #subPlanPeriod {
  color: var(--ott-500) !important;
  font-size: var(--fs-12) !important;
}

/* Bottoni .mon-filter-btn (Storico utilizzo / Applica): blu legacy
 * var(--interactive) -> brand primario del mockup. */
body.portal-gestione #abbonamentoPopup .mon-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-12-5) !important;
  font-weight: 600 !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #abbonamentoPopup .mon-filter-btn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* Tabella storico .monitoring-log-table -> stile tabella mockup */
body.portal-gestione #abbonamentoPopup .monitoring-log-table {
  font-family: var(--ff-body);
  font-size: var(--fs-12-5);
}
body.portal-gestione #abbonamentoPopup .monitoring-log-table th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-weight: 600 !important;
  font-size: var(--fs-11) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #abbonamentoPopup .monitoring-log-table td {
  color: var(--ink) !important;
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #abbonamentoPopup .monitoring-log-table tbody tr:hover td {
  background: var(--ott-50) !important;
}

/* Divisore sezione admin */
body.portal-gestione #abbonamentoPopup #subAdminSection {
  border-top: 1px solid var(--ott-100) !important;
}

/* Messaggio esito cambio piano (verde) */
body.portal-gestione #abbonamentoPopup #subChangePlanMsg {
  color: var(--ott-green) !important;
  font-size: var(--fs-12) !important;
}
/* ==================== Audit & Sessioni (#auditPopup) — overrides-added ==================== */
/* === Audit & Sessioni (#auditPopup) — override ottanio token-only ===
 * Il popup riceve .gestione-inline-panel a runtime (deskcontrol-portal.js:1419)
 * quindi frame/header/tabs/.section/input/select/date sono GIA' coperti dalla
 * fondazione. NON coperti: la tabella bespoke .monitoring-log-table, il bottone
 * .mon-filter-btn, la paginazione .monitoring-pagination e la toolbar — usano i
 * token LEGACY (--interactive/--surface/--border/--text-*). Qui rimappati a ott-*. */

/* toolbar filtri: layout/spaziatura coerenti col mockup (cosmetico) */
body.portal-gestione #auditPopup .audit-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* bottone filtro bespoke -> primario brand (mockup btn primario) */
body.portal-gestione #auditPopup .mon-filter-btn {
  height: 32px;
  padding: 0 14px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-12-5) !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: var(--ott-base) !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #auditPopup .mon-filter-btn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* wrap tabella: bordo/raggio ottanio attorno alla tabella scrollabile */
body.portal-gestione #auditPopup .audit-table-wrap {
  border: 1px solid var(--ott-200);
  border-radius: var(--rd-r-8);
  overflow: hidden;
}

/* tabella audit bespoke -> stile tabella mockup (th ott-50/ott-500 uppercase 11px,
 * td border-bottom ott-100, hover ott-50). Rimappa i token legacy a ott-*. */
body.portal-gestione #auditPopup .monitoring-log-table {
  font-family: var(--ff-body);
  font-size: var(--fs-12-5);
}
body.portal-gestione #auditPopup .monitoring-log-table th {
  padding: 9px 10px !important;
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-weight: 600 !important;
  font-size: var(--fs-11) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #auditPopup .monitoring-log-table td {
  padding: 8px 10px !important;
  color: var(--ink) !important;
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #auditPopup .monitoring-log-table tbody tr:last-child td {
  border-bottom: 0 !important;
}
body.portal-gestione #auditPopup .monitoring-log-table tr:hover td {
  background: var(--ott-50) !important;
}
/* esiti login/audit: verde/rosso semantici ottanio */
body.portal-gestione #auditPopup .monitoring-log-table .status-ok {
  color: var(--ott-green) !important;
}
body.portal-gestione #auditPopup .monitoring-log-table .status-err {
  color: var(--ott-red) !important;
  font-weight: 600 !important;
}

/* paginazione: testo secondario + bottoni ghost ottanio */
body.portal-gestione #auditPopup .monitoring-pagination {
  color: var(--ott-500) !important;
  font-size: var(--fs-12) !important;
  margin-top: 12px;
}
body.portal-gestione #auditPopup .monitoring-pagination button {
  padding: 4px 12px !important;
  font-size: var(--fs-12) !important;
  color: var(--ink) !important;
  background: #fff !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-7) !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #auditPopup .monitoring-pagination button:hover:not(:disabled) {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}
body.portal-gestione #auditPopup .monitoring-pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}
/* ==================== Rate limit (#configRateLimitPopup) — overrides-added ==================== */
/* ===== Rate limit & Monitoraggio — override scoped token-only =====
 * La fondazione (_redesign-impostazioni.css) copre tabs/.btn/input/select/
 * label/.simple-table via .gestione-inline-panel (aggiunto a runtime al popup,
 * deskcontrol-portal.js:1419). Qui si allineano SOLO i div bespoke
 * inline-styled (card bucket, box test, tessere stat, testi muti, code/pre,
 * hr) che la fondazione non raggiunge. Token-only, !important per battere
 * gli style inline. */

/* --- testi descrittivi muti (#555 / #666 / #888) --- */
body.portal-gestione #configRateLimitPopup p,
body.portal-gestione #configRateLimitPopup p small,
body.portal-gestione #configRateLimitPopup [style*="color:#555"],
body.portal-gestione #configRateLimitPopup [style*="color:#666"],
body.portal-gestione #configRateLimitPopup [style*="color:#888"] {
  color: var(--ott-500) !important;
}
body.portal-gestione #configRateLimitPopup p {
  font-size: var(--fs-13) !important;
  line-height: 1.5;
}

/* --- card "bucket" (border #e5e7eb / bg #f9fafb) → card mockup --- */
body.portal-gestione #configRateLimitPopup [style*="border:1px solid #e5e7eb"][style*="background:#f9fafb"] {
  border: 1px solid var(--ott-200) !important;
  background: #fff !important;
  border-radius: var(--rd-r-8) !important;
}
/* titolo bucket (codice tecnico) → mono per leggibilità identificatore */
body.portal-gestione #configRateLimitPopup [style*="background:#f9fafb"] > [style*="font-weight:600"] {
  font-family: var(--ff-mono) !important;
  color: var(--ott-700) !important;
}

/* --- card "predisposto" dashed (#cbd5e1 / bg #fffbeb) → warn tenue --- */
body.portal-gestione #configRateLimitPopup [style*="border:1px dashed #cbd5e1"] {
  border: 1px dashed var(--ott-300) !important;
  background: color-mix(in srgb, var(--ott-warn) 8%, white) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #configRateLimitPopup [style*="border:1px dashed #cbd5e1"] [style*="color:#888"] {
  color: var(--ott-warn) !important;
}

/* --- box "Test rapido" (bg #eff6ff / border #bfdbfe) → accent brand tenue --- */
body.portal-gestione #configRateLimitPopup [style*="background:#eff6ff"] {
  background: color-mix(in srgb, var(--ott-base) 6%, white) !important;
  border: 1px solid color-mix(in srgb, var(--ott-base) 25%, white) !important;
  border-radius: var(--rd-r-8) !important;
}

/* --- code + pre (output header rate limit) → mono + bordi token --- */
body.portal-gestione #configRateLimitPopup code,
body.portal-gestione #configRateLimitPopup pre {
  font-family: var(--ff-mono) !important;
  color: var(--ink) !important;
}
body.portal-gestione #configRateLimitPopup pre {
  background: #fff !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-7) !important;
}

/* --- hr divisore --- */
body.portal-gestione #configRateLimitPopup hr {
  border: 0 !important;
  border-top: 1px solid var(--ott-100) !important;
}

/* --- ALERT: box "Soglie hardcoded" (bg #f9fafb senza bordo) --- */
body.portal-gestione #configRateLimitPopup [data-rl-panel="alert"] [style*="background:#f9fafb"] {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  color: var(--ott-500) !important;
}
body.portal-gestione #configRateLimitPopup [data-rl-panel="alert"] [style*="background:#f9fafb"] strong {
  color: var(--ott-700) !important;
}

/* --- MONITORAGGIO: tessere statistiche --- */
body.portal-gestione #configRateLimitPopup #rlMonStats > div {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #configRateLimitPopup #rlMonStats [style*="background:#f3f4f6"] {
  background: var(--ott-50) !important;
}
/* numerone stat → display font + mono per le cifre tecniche */
body.portal-gestione #configRateLimitPopup #rlMonStats [style*="font-size:22px"] {
  font-family: var(--ff-mono) !important;
  font-size: var(--fs-22) !important;
  color: var(--ink) !important;
}
body.portal-gestione #configRateLimitPopup #rlMonStats [style*="color:#666"] {
  color: var(--ott-500) !important;
}
/* tessera "flaggati" → rosso semantico tenue */
body.portal-gestione #configRateLimitPopup #rlMonStats [style*="background:#fef2f2"] {
  background: color-mix(in srgb, var(--ott-error) 7%, white) !important;
}
body.portal-gestione #configRateLimitPopup #rlMonStatFlagged {
  color: var(--ott-error) !important;
}
/* ==================== Sicurezza sessione (#configSicurezzaPopup) — overrides-added ==================== */
/* Sicurezza sessione — override scoped token-only.
   La fondazione copre input/select/.section/label/.btn perche' il popup
   riceve .gestione-inline-panel via JS (deskcontrol-portal.js:1419).
   Restano fuori: titolo <h2> raw, testi #555/#888, bottone bespoke
   .mon-filter-btn (non .btn), messaggio stato. */

/* titolo: <h2> raw nell'header → display ottanio uppercase come gli altri popup */
body.portal-gestione #configSicurezzaPopup .management-popup-header h2 {
  font-family: var(--ff-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-13) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight);
  color: var(--ott-700) !important;
  margin: 0 !important;
}

/* testo descrittivo (#555) e nota range (#888) → secondario */
body.portal-gestione #configSicurezzaPopup .section > p {
  font-size: var(--fs-13) !important;
  color: var(--ott-500) !important;
}
body.portal-gestione #configSicurezzaPopup .section > p small {
  color: var(--ott-500) !important;
}

/* bottone "Salva" = .mon-filter-btn (bespoke monitoring, fuori fondazione)
   → allineato al primario ottanio. Scope stretto a questo popup per non
   toccare l'uso .mon-filter-btn nel monitoraggio. */
body.portal-gestione #configSicurezzaPopup .mon-filter-btn#sessSaveBtn {
  height: 36px;
  padding: 0 16px !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #configSicurezzaPopup .mon-filter-btn#sessSaveBtn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* messaggio di esito salvataggio → tono secondario */
body.portal-gestione #configSicurezzaPopup #sessSaveMsg {
  font-size: var(--fs-12) !important;
  color: var(--ott-500) !important;
}
/* ==================== Cestino (#configCestinoPopup) — overrides-added ==================== */
/* ===== Cestino — override scoped token-only (battono inline) ===== */

/* Header descrizione */
body.portal-gestione #configCestinoPopup .management-popup-header p{
  color:var(--ott-500) !important;
  font-size:var(--fs-12) !important;
}

/* Card config (Modalita' retention + Svuota per cliente) */
body.portal-gestione #configCestinoPopup .management-popup-body > div{
  background:#fff !important;
  border:1px solid var(--ott-200) !important;
  border-radius:var(--rd-r-8) !important;
}
/* la prima card usa sfondo tenue */
body.portal-gestione #configCestinoPopup .management-popup-body > div:first-child{
  background:var(--ott-50) !important;
}

/* Titoli sezione */
body.portal-gestione #configCestinoPopup h3{
  font-family:var(--ff-display) !important;
  font-size:var(--fs-14) !important;
  color:var(--ott-700) !important;
}

/* Testo secondario / helper */
body.portal-gestione #configCestinoPopup label > div > div:not([style*="font-weight"]),
body.portal-gestione #configCestinoPopup p{
  color:var(--ott-500) !important;
}
body.portal-gestione #configCestinoPopup [style*="color:#94a3b8"],
body.portal-gestione #configCestinoPopup [style*="color: #94a3b8"]{
  color:var(--ott-300) !important;
}
body.portal-gestione #configCestinoPopup [style*="color:#64748b"],
body.portal-gestione #configCestinoPopup [style*="color: #64748b"]{
  color:var(--ott-500) !important;
}

/* Radio brand-aware */
body.portal-gestione #configCestinoPopup input[type="radio"]{
  accent-color:var(--ott-base);
}

/* Input number giorni di grazia → stile input standard */
body.portal-gestione #configCestinoPopup #cestinoGraceDays{
  height:auto;
  padding:6px 10px !important;
  background:#fff !important;
  border:1px solid var(--ott-200) !important;
  border-radius:var(--rd-r-6) !important;
  font-family:var(--ff-body) !important;
  font-size:var(--fs-13) !important;
  color:var(--ink) !important;
}
body.portal-gestione #configCestinoPopup #cestinoGraceDays:focus{
  outline:none !important;
  border-color:var(--ott-base) !important;
  box-shadow:var(--rd-focus-ring) !important;
}

/* Bottone Salva (azione critica retention) → token red, non hardcode */
body.portal-gestione #configCestinoPopup #cestinoSaveBtn{
  background:var(--ott-red) !important;
  color:#fff !important;
  border:none !important;
  border-radius:var(--rd-r-6) !important;
  font-family:var(--ff-body) !important;
  font-size:var(--fs-13) !important;
  font-weight:600 !important;
}
body.portal-gestione #configCestinoPopup #cestinoSaveBtn:hover{
  background:color-mix(in srgb, var(--ott-red) 88%, black) !important;
}

/* Tabella statistiche */
body.portal-gestione #configCestinoPopup #cestinoStatsTable thead tr{
  background:var(--ott-50) !important;
  border-bottom:1px solid var(--ott-200) !important;
}
body.portal-gestione #configCestinoPopup #cestinoStatsTable thead th{
  color:var(--ott-500) !important;
  font-size:var(--fs-11) !important;
  font-weight:600 !important;
  text-transform:uppercase !important;
  letter-spacing:.04em !important;
}
body.portal-gestione #configCestinoPopup #cestinoStatsTable tbody td{
  border-bottom:1px solid var(--ott-100) !important;
}
body.portal-gestione #configCestinoPopup #cestinoStatsTable tbody tr:hover td{
  background:var(--ott-50) !important;
}
/* ==================== Worker (#configWorkerPopup) — overrides-added ==================== */
/* === Sezione Worker — override scoped token-only (configWorkerPopup) ===
 * La fondazione (.gestione-inline-panel) copre input/select e .btn base, ma
 * questo popup usa <h2>/<h3> plain, una card inline non-.section, un bottone
 * .btn SENZA .primary con brand hardcoded e un callout warn hardcoded. */

/* header: <h2> plain -> tipografia titolo display + hint a token */
body.portal-gestione #configWorkerPopup .management-popup-header h2 {
  font-family: var(--ff-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-15) !important;
  color: var(--ott-700) !important;
  margin: 0 !important;
}
body.portal-gestione #configWorkerPopup .management-popup-header p {
  color: var(--ott-500) !important;
  font-size: var(--fs-12) !important;
}

/* card config (div inline, non .section): bg/bordo/raggio a token */
body.portal-gestione #configWorkerPopup .management-popup-body > div {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}

/* titolo interno <h3> -> display 800 */
body.portal-gestione #configWorkerPopup h3 {
  font-family: var(--ff-display) !important;
  font-weight: 800 !important;
  font-size: var(--fs-14) !important;
  color: var(--ink) !important;
}

/* helper text '(1-50)' grigio tecnico -> token secondario */
body.portal-gestione #configWorkerPopup span[style*="#94a3b8"] {
  color: var(--ott-500) !important;
}

/* bottone Salva: .btn senza .primary, brand hardcoded -> CTA token */
body.portal-gestione #configWorkerPopup #workerSaveBtn {
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #configWorkerPopup #workerSaveBtn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* callout stress-test: warn hardcoded -> semantica --ott-warn */
body.portal-gestione #configWorkerPopup div[style*="#fffbeb"] {
  background: color-mix(in srgb, var(--ott-warn) 12%, white) !important;
  border: 1px solid color-mix(in srgb, var(--ott-warn) 45%, white) !important;
  border-radius: var(--rd-r-7) !important;
  color: color-mix(in srgb, var(--ott-warn) 78%, black) !important;
}
/* ==================== Preferenze (#preferenzePopup) — overrides-added ==================== */
/* === Preferenze (#preferenzePopup) — popup .gestione-compact NON .gestione-inline-panel:
   la fondazione _redesign-impostazioni.css e' scoped a .gestione-inline-panel e NON copre
   questo popup. Override scoped diretto, token-only. === */

/* header + titolo (allinea al frame mockup, qui nessuna copertura foundation) */
body.portal-gestione #preferenzePopup .management-popup-header {
  border-bottom: 1px solid var(--ott-100) !important;
  padding-bottom: 10px !important;
  margin-bottom: 0 !important;
}
body.portal-gestione #preferenzePopup .management-popup-title {
  font-family: var(--ff-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-13) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight);
  color: var(--ott-700) !important;
}
body.portal-gestione #preferenzePopup .management-popup-close {
  color: var(--ott-500) !important;
}

/* section → card mockup */
body.portal-gestione #preferenzePopup .section {
  background: #fff !important;
  padding: 16px !important;
}

/* label form (battere font-size:11px inline; uppercase mockup) */
body.portal-gestione #preferenzePopup label {
  font-family: var(--ff-body) !important;
  font-size: var(--fs-11) !important;
  font-weight: 600 !important;
  color: var(--ott-500) !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

/* select → input mockup h36 (battere padding:4px 8px inline; width:100% funzionale resta) */
body.portal-gestione #preferenzePopup select {
  height: 36px;
  padding: 0 30px 0 12px !important;
  background-color: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  color: var(--ink) !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: background-color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
body.portal-gestione #preferenzePopup select:hover {
  background-color: #fff !important;
}
body.portal-gestione #preferenzePopup select:focus {
  border-color: var(--ott-base) !important;
  background-color: #fff !important;
  box-shadow: var(--rd-focus-ring);
}

/* bottone salva bespoke (.mon-filter-btn) → primario brand mockup */
body.portal-gestione #preferenzePopup #prefSaveBtn.mon-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #preferenzePopup #prefSaveBtn.mon-filter-btn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* messaggio salvataggio (battere color:#090 inline) */
body.portal-gestione #preferenzePopup #prefSaveMsg {
  font-size: var(--fs-12) !important;
  color: var(--ott-green) !important;
  font-weight: 600;
}
/* ==================== Octopus (#configOctopusPopup) — overrides-added ==================== */
/* === Octopus (#configOctopusPopup) — override token-only, scoped === */

/* small helper + hint span sotto i campi → testo secondario ottanio */
body.portal-gestione #configOctopusPopup small,
body.portal-gestione #configOctopusPopup #docConfigSaveHint,
body.portal-gestione #configOctopusPopup #defaultCredsSaveHint,
body.portal-gestione #configOctopusPopup #captchaConfigHint,
body.portal-gestione #configOctopusPopup #workerModeHint,
body.portal-gestione #configOctopusPopup #dashRefreshHint,
body.portal-gestione #configOctopusPopup #octStrategieFormHint,
body.portal-gestione #configOctopusPopup label > div[style*="color:#6b7280"] {
  color: var(--ott-500) !important;
}

/* h3 sottotitolo sezione → display + titolo minore ottanio */
body.portal-gestione #configOctopusPopup .section > h3 {
  font-family: var(--ff-display);
  font-size: var(--fs-13) !important;
  font-weight: 700 !important;
  color: var(--ott-700) !important;
}

/* divisori sezione: la fondazione gia' carda ogni .section,
   il border-top inline (var(--border)) crea un doppio bordo → annulla */
body.portal-gestione #configOctopusPopup .section[style*="border-top"] {
  border-top: 1px solid var(--ott-200) !important;
}

/* box form strategia annidato → superficie tenue ottanio */
body.portal-gestione #configOctopusPopup #octStrategieForm {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}

/* placeholder lista strategie "Caricamento..." */
body.portal-gestione #configOctopusPopup #octStrategiesList > span {
  color: var(--ott-500) !important;
}

/* divisore interno wrapper retry transitori */
body.portal-gestione #configOctopusPopup div[style*="border-top:1px solid #e5e7eb"],
body.portal-gestione #configOctopusPopup div[style*="border-top: 1px solid #e5e7eb"] {
  border-top-color: var(--ott-200) !important;
}

/* bottone "Rimuovi" CAPTCHA: distruttivo solido bespoke → token rosso */
body.portal-gestione #configOctopusPopup #btnRemoveCaptchaKey {
  background: var(--ott-red) !important;
  color: #fff !important;
  border: 1px solid var(--ott-red) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #configOctopusPopup #btnRemoveCaptchaKey:hover {
  background: color-mix(in srgb, var(--ott-red) 85%, black) !important;
}

/* radio modalita worker + checkbox attivita strategia → accent brand */
body.portal-gestione #configOctopusPopup input[type="radio"],
body.portal-gestione #configOctopusPopup input[type="checkbox"] {
  accent-color: var(--ott-base);
}
/* ==================== Lynx (#configLynxPopup) — overrides-added ==================== */
/* ============================================================
 * Lynx — configLynxPopup — override scoped token-only (ottanio)
 * Fondazione gia' copre: frame popup, header/title, .section card,
 * label/input/select/textarea generici, .btn/.btn.sec, hint.
 * Qui si allineano SOLO gli elementi bespoke inline-styled del blocco.
 * ============================================================ */

/* --- testo grigio inline (<small>, <p>, <label> con color hardcoded) --- */
body.portal-gestione #configLynxPopup small,
body.portal-gestione #configLynxPopup p,
body.portal-gestione #configLynxPopup label {
  color: var(--ott-500) !important;
}

/* --- mini-bottoni "Leggi da DB" (ghost) / "Salva tutto" (primary) ---
 * non sono .btn → la fondazione non li tocca; mappo gli hex inline. */
body.portal-gestione #configLynxPopup button[onclick="loadLynxConfig()"] {
  background: #fff !important;
  color: var(--ink) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-7) !important;
}
body.portal-gestione #configLynxPopup button[onclick="loadLynxConfig()"]:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}
body.portal-gestione #configLynxPopup button[onclick="saveLynxConfig()"] {
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-7) !important;
}
body.portal-gestione #configLynxPopup button[onclick="saveLynxConfig()"]:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* --- tab prompt custom .lynx-prompt-tab (underline) ---
 * switchLynxPromptTab (octopus.js) imposta color/border-bottom INLINE
 * (active=var(--interactive), inattivo=#6b7280) → serve !important per
 * forzare la palette ottanio. Il contenitore divisorio e' #e5e7eb inline. */
body.portal-gestione #configLynxPopup .lynx-prompt-tab {
  color: var(--ott-500) !important;
  border-bottom-color: transparent !important;
}
body.portal-gestione #configLynxPopup .lynx-prompt-tab:hover {
  color: var(--ink) !important;
}
body.portal-gestione #configLynxPopup .lynx-prompt-tab.lynx-prompt-tab-active,
body.portal-gestione #configLynxPopup .lynx-prompt-tab[style*="--interactive"] {
  color: var(--ott-base) !important;
  border-bottom-color: var(--ott-base) !important;
}

/* --- badge "MSG" (#dbeafe / #1d4ed8 → brand tenue) --- */
body.portal-gestione #configLynxPopup label > span[style*="dbeafe"] {
  background: color-mix(in srgb, var(--ott-base) 10%, white) !important;
  color: var(--ott-base) !important;
  border-radius: var(--rd-r-pill) !important;
}

/* --- card OpenAI (#e5e7eb / #f0f9ff bg) e card Costi (#fffbeb bg) --- */
body.portal-gestione #configLynxPopup div[style*="f0f9ff"] {
  border: 1px solid var(--ott-200) !important;
  background: color-mix(in srgb, var(--ott-base) 5%, white) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #configLynxPopup div[style*="fffbeb"] {
  border: 1px solid var(--ott-200) !important;
  background: var(--ott-warn-bg, color-mix(in srgb, var(--ott-warn) 8%, white)) !important;
  border-radius: var(--rd-r-8) !important;
}
/* titolo card OpenAI (#1e40af) e Costi (#92400e) → token */
body.portal-gestione #configLynxPopup span[style*="1e40af"] {
  color: var(--ott-base) !important;
}
body.portal-gestione #configLynxPopup span[style*="92400e"] {
  color: color-mix(in srgb, var(--ott-warn) 80%, black) !important;
}

/* --- badge stato OpenAI (#fee2e2 / #dc2626 → errore tenue) --- */
body.portal-gestione #configLynxPopup #octOpenAIBadge {
  background: color-mix(in srgb, var(--ott-error) 12%, white) !important;
  color: var(--ott-error) !important;
  border-radius: var(--rd-r-pill) !important;
}

/* --- bottone "Rimuovi" (.btn ma override inline #fee2e2/#dc2626) → danger --- */
body.portal-gestione #configLynxPopup #btnRemoveOpenAI {
  background: #fff !important;
  color: var(--ott-red) !important;
  border: 1px solid color-mix(in srgb, var(--ott-red) 35%, white) !important;
}
body.portal-gestione #configLynxPopup #btnRemoveOpenAI:hover {
  background: color-mix(in srgb, var(--ott-red) 8%, white) !important;
}
/* ==================== Monitoraggio (#monitoraggioPopup) — overrides-added ==================== */
/* === Monitoraggio (#monitoraggioPopup) — allineamento ottanio ===
 * I componenti monitoring-* sono bespoke (monitoring.css, token legacy
 * --surface-alt/--border/--text-* di hue diversa dalla scala ottanio e
 * dimensioni piccole 12px/4px). La fondazione (.gestione-inline-panel)
 * non li raggiunge (no .btn/.simple-table). Override token-only scoped
 * all'id; #id + classe/elemento batte monitoring.css per specificita',
 * !important mirato a battere il 2px th e i token legacy.
 */

/* range pills: inattivo su ott-50/ott-500 (mockup pill), attivo gia' ott-base via --interactive */
body.portal-gestione #monitoraggioPopup .monitoring-range-pills button {
  background: var(--ott-50);
  border-color: var(--ott-200);
  color: var(--ott-500);
  font-size: var(--fs-13);
  border-radius: var(--rd-r-pill);
}
body.portal-gestione #monitoraggioPopup .monitoring-range-pills button.active {
  background: var(--ott-base);
  border-color: var(--ott-base);
  color: #fff;
}

/* KPI cards: card mockup (bordo ott-200, radius rd-r-8, bg bianco) */
body.portal-gestione #monitoraggioPopup .monitoring-kpi-card {
  background: #fff;
  border-color: var(--ott-200);
  border-radius: var(--rd-r-8);
}
body.portal-gestione #monitoraggioPopup .monitoring-kpi-card .kpi-value {
  font-family: var(--ff-display);
  color: var(--ink);
}
body.portal-gestione #monitoraggioPopup .monitoring-kpi-card .kpi-label {
  color: var(--ott-500);
}
body.portal-gestione #monitoraggioPopup .monitoring-kpi-card .kpi-sub {
  color: var(--ott-error);
}

/* chart box: card ottanio */
body.portal-gestione #monitoraggioPopup .monitoring-chart-box {
  border-color: var(--ott-200);
  border-radius: var(--rd-r-8);
}
body.portal-gestione #monitoraggioPopup .monitoring-chart-box h4 {
  color: var(--ott-700);
}

/* sottotitolo sezione "Log richieste": label tenue uppercase */
body.portal-gestione #monitoraggioPopup .monitoring-section-title {
  font-size: var(--fs-11);
  font-weight: 600;
  letter-spacing: var(--ls-caps-wide);
  text-transform: uppercase;
  color: var(--ott-500);
}

/* filtri: input/select formato mockup (h36, 13px, ott-50, rd-r-8, focus brand) */
body.portal-gestione #monitoraggioPopup .monitoring-filters input,
body.portal-gestione #monitoraggioPopup .monitoring-filters select {
  height: 36px;
  padding: 0 12px;
  font-size: var(--fs-13);
  background: var(--ott-50);
  border-color: var(--ott-200);
  border-radius: var(--rd-r-8);
  color: var(--ink);
}
body.portal-gestione #monitoraggioPopup .monitoring-filters input:focus,
body.portal-gestione #monitoraggioPopup .monitoring-filters select:focus {
  border-color: var(--ott-base);
  background: #fff;
  box-shadow: var(--rd-focus-ring);
  outline: none;
}
body.portal-gestione #monitoraggioPopup .monitoring-filters input::placeholder {
  color: var(--ott-300);
}

/* bottone "Filtra" (bespoke .mon-filter-btn): btn primario ottanio */
body.portal-gestione #monitoraggioPopup .mon-filter-btn {
  height: 36px;
  padding: 0 16px;
  font-size: var(--fs-13);
  font-weight: 600;
  background: var(--ott-base);
  border: 1px solid var(--ott-base);
  border-radius: var(--rd-r-8);
  color: #fff;
}
body.portal-gestione #monitoraggioPopup .mon-filter-btn:hover {
  background: var(--ott-soft);
  border-color: var(--ott-soft);
}

/* log table: th ott-50 uppercase 11px + bordo 1px; td/hover/status tokenizzati */
body.portal-gestione #monitoraggioPopup .monitoring-log-wrap {
  border-color: var(--ott-200);
  border-radius: var(--rd-r-8);
}
body.portal-gestione #monitoraggioPopup .monitoring-log-table th {
  background: var(--ott-50);
  color: var(--ott-500);
  font-size: var(--fs-11);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #monitoraggioPopup .monitoring-log-table td {
  border-bottom-color: var(--ott-100);
  color: var(--ink);
}
body.portal-gestione #monitoraggioPopup .monitoring-log-table tr:hover td {
  background: var(--ott-50);
}
body.portal-gestione #monitoraggioPopup .monitoring-log-table .status-err {
  color: var(--ott-error);
}
body.portal-gestione #monitoraggioPopup .monitoring-log-table .status-ok {
  color: var(--ott-green);
}

/* pagination: bordo/radius ottanio */
body.portal-gestione #monitoraggioPopup .monitoring-pagination {
  color: var(--ott-500);
}
body.portal-gestione #monitoraggioPopup .monitoring-pagination button {
  border-color: var(--ott-200);
  border-radius: var(--rd-r-7);
  background: #fff;
  color: var(--ink);
}
body.portal-gestione #monitoraggioPopup .monitoring-pagination button:hover:not(:disabled) {
  background: var(--ott-50);
}
/* ==================== Defaults Catasto (#defaultsCatastoPopup) — overrides-added ==================== */
/* === Defaults Catasto — override token-only (scoped) ===
 * La fondazione copre il frame, input/select/textarea, .btn, label generica.
 * Qui si allineano SOLO i componenti bespoke definiti nello <style> inline
 * (lines 6443-6470) e gli hex inline non coperti. Token-only.
 * Checkbox/range gia' brand-aware via variables.css (accent-color globale). */

/* -- header sottotitolo + p hint inline (#6b7280) -- */
body.portal-gestione #defaultsCatastoPopup .management-popup-header p,
body.portal-gestione #defaultsCatastoPopup .dc-tab-panel > p {
  color: var(--ott-500) !important;
}

/* -- label inline (#374151) -> label form token -- */
body.portal-gestione #defaultsCatastoPopup label[style] {
  color: var(--ott-500) !important;
}

/* -- separatori <hr> inline (#e5e7eb) -- */
body.portal-gestione #defaultsCatastoPopup hr[style] {
  border-top-color: var(--ott-200) !important;
}

/* -- titoli sezione <h3>/<h4> inline (#374151) -- */
body.portal-gestione #defaultsCatastoPopup h3[style],
body.portal-gestione #defaultsCatastoPopup h4[style] {
  color: var(--ink) !important;
}

/* -- TAB NAV bespoke .dc-tabs-nav -> underline brand-aware -- */
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav {
  border-bottom-color: var(--ott-200);
}
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav button {
  font-family: var(--ff-body);
  color: var(--ott-500);
}
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav button:hover {
  color: var(--ink);
}
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav button.active {
  color: var(--ott-base);
  border-bottom-color: var(--ott-base);
}

/* -- DATASET CARD bespoke -- */
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card {
  border-color: var(--ott-200);
  border-radius: var(--rd-r-8);
  background: var(--ott-50);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card h4 {
  font-family: var(--ff-display);
  color: var(--ink);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card label {
  color: var(--ott-500);
}
/* hint interno alla card (#6b7280) */
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card p {
  color: var(--ott-500) !important;
}

/* -- bottone upload bespoke (.btn-upload, non .btn) -> CTA brand -- */
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .btn-upload {
  background: var(--ott-base);
  border-radius: var(--rd-r-8);
  font-family: var(--ff-body);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .btn-upload:hover {
  background: var(--ott-soft);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .btn-upload:disabled {
  background: var(--ott-300);
}

/* -- status messaggi -- */
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .status.ok {
  color: var(--ott-green);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .status.err {
  color: var(--ott-error);
}

/* -- wrapper storico (border inline #e5e7eb) -- */
body.portal-gestione #defaultsCatastoPopup .dc-tab-panel > div[style*="overflow"] {
  border-color: var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}

/* -- TABELLA storico bespoke .dc-history-table -- */
body.portal-gestione #defaultsCatastoPopup .dc-history-table th {
  background: var(--ott-50);
  color: var(--ott-500);
  font-family: var(--ff-body);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table th,
body.portal-gestione #defaultsCatastoPopup .dc-history-table td {
  border-bottom-color: var(--ott-100);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table tbody tr:hover td {
  background: var(--ott-50);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table td[style*="9ca3af"],
body.portal-gestione #defaultsCatastoPopup .dc-history-table td[colspan] {
  color: var(--ott-300) !important;
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table tr.status-failed td {
  color: var(--ott-error);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table tr.status-running td {
  color: var(--ott-warn);
}

/* -- badge dataset: tints -> color-mix token-only -- */
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-badge {
  border-radius: var(--rd-r-5);
  font-family: var(--ff-mono);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-OMI,
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-OMI_KML {
  background: color-mix(in srgb, var(--ott-base) 12%, white);
  color: var(--ott-base);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-NTN_COM {
  background: color-mix(in srgb, var(--ott-green) 14%, white);
  color: color-mix(in srgb, var(--ott-green) 70%, black);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-NTN_CAP {
  background: color-mix(in srgb, var(--ott-warn) 16%, white);
  color: color-mix(in srgb, var(--ott-warn) 75%, black);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-NTN {
  background: var(--ott-100);
  color: var(--ott-500);
}
/* ==================== Branding (#brandingPopup) — overrides-added ==================== */
/* ====== Impostazioni → Branding portali (override scoped ottanio) ======
 * Il popup riceve .gestione-inline-panel a runtime (deskcontrol-portal.js:1419),
 * quindi frame/header/.section/label/input[url|text] sono GIA' allineati dalla
 * fondazione. Qui si battono SOLO i componenti bespoke non coperti:
 * tab/save .mon-filter-btn, color-picker border #ccc, hex input mono,
 * messaggi save #090, bordo tab-strip. Token-only.
 * ===================================================================== */

/* --- Tab switcher MapControl / DeskControl (role=tab .mon-filter-btn) --- */
body.portal-gestione #brandingPopup [role="tablist"] {
  gap: 6px !important;
}
body.portal-gestione #brandingPopup [role="tab"].mon-filter-btn {
  padding: 7px 13px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-12-5) !important;
  font-weight: 600 !important;
  color: var(--ott-500) !important;
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-7) !important;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #brandingPopup [role="tab"].mon-filter-btn:hover {
  color: var(--ink) !important;
  background: #fff !important;
}
body.portal-gestione #brandingPopup [role="tab"].mon-filter-btn.active {
  color: #fff !important;
  background: var(--ott-base) !important;
  border-color: var(--ott-base) !important;
}
/* bordo strip tab: allinea il fallback #e2e8f0 al token bordo standard */
body.portal-gestione #brandingPopup > .section:first-of-type {
  border-bottom-color: var(--ott-200) !important;
}

/* --- Pulsanti "Salva ..." (mon-filter-btn usato come CTA primaria) --- */
body.portal-gestione #brandingPopup #brandMcSaveBtn,
body.portal-gestione #brandingPopup #brandDcSaveBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: var(--ott-base) !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #brandingPopup #brandMcSaveBtn:hover,
body.portal-gestione #brandingPopup #brandDcSaveBtn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}
/* messaggio esito salvataggio: #090 hardcoded → token positivo */
body.portal-gestione #brandingPopup #brandMcSaveMsg,
body.portal-gestione #brandingPopup #brandDcSaveMsg {
  color: var(--ott-green) !important;
}

/* --- Color picker: border #ccc hardcoded → token bordo standard --- */
body.portal-gestione #brandingPopup input[type="color"] {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-6) !important;
}

/* --- HEX text input: ripristina mono (la fondazione forza --ff-body sui
 *     text input; per i codici colore il mockup vuole --ff-mono) --- */
body.portal-gestione #brandingPopup input[type="text"][id$="Hex"] {
  font-family: var(--ff-mono) !important;
}

/* --- Summary <details> MapProxy: allinea testo al token secondario --- */
body.portal-gestione #brandingPopup details > summary {
  color: var(--ott-500) !important;
}
/* ==================== Email (#configEmailPopup) — overrides-added ==================== */
/* === Sezione Email (#configEmailPopup) — override scoped, token-only ===
 * Il popup riceve .gestione-inline-panel a runtime: input/select/header/tabs
 * sono gia' coperti dalla fondazione. Qui solo cio' che gli inline rompono:
 * h3 (rosso), p hint, label inline, e i 3 bottoni bespoke (non .btn). */

/* titoli di sezione: da #890103 inline -> titolo ottanio + barretta accent */
body.portal-gestione #configEmailPopup .management-popup-body h3 {
  font-family: var(--ff-display) !important;
  font-weight: 800 !important;
  font-size: var(--fs-15) !important;
  color: var(--ott-700) !important;
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione #configEmailPopup .management-popup-body h3::before {
  content: "";
  width: 6px;
  height: 18px;
  background: var(--ott-base);
  border-radius: 2px;
  flex-shrink: 0;
}

/* descrizione/hint: #6b7280 -> --ott-500 */
body.portal-gestione #configEmailPopup .management-popup-body > div > p {
  font-size: var(--fs-11-5) !important;
  color: var(--ott-500) !important;
  line-height: 1.5;
}
body.portal-gestione #configEmailPopup .management-popup-body p strong {
  color: var(--ott-700);
  font-weight: 700;
}

/* label inline (#374151,12px) -> label ottanio uppercase --ott-500 */
body.portal-gestione #configEmailPopup .management-popup-body label {
  font-family: var(--ff-body) !important;
  font-size: var(--fs-11) !important;
  font-weight: 600 !important;
  color: var(--ott-500) !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* bottoni bespoke (non .btn): test #2196F3 + save #890103 -> CTA --ott-base */
body.portal-gestione #configEmailPopup #btnEmailTest,
body.portal-gestione #configEmailPopup #btnEmailSave,
body.portal-gestione #configEmailPopup #btnEmailAlertSave {
  height: 36px;
  padding: 0 16px !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #configEmailPopup #btnEmailTest:hover,
body.portal-gestione #configEmailPopup #btnEmailSave:hover,
body.portal-gestione #configEmailPopup #btnEmailAlertSave:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}
/* ==================== Assistente AI (#configChatPopup) — overrides-added ==================== */
/* === Assistente AI — #configChatPopup ===
   Popup classato .management-popup .gestione-compact (NON .gestione-inline-panel):
   la fondazione form/btn/table (scoped a .gestione-inline-panel) qui NON si applica.
   Override token-only scoped al popup. */

/* header/title — la fondazione copre solo .gestione-inline-panel */
body.portal-gestione #configChatPopup .management-popup-header {
  background: var(--ott-50) !important;
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #configChatPopup .management-popup-title {
  font-family: var(--ff-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-13) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight);
  color: var(--ott-700) !important;
}

/* label (inline #374151 12px) → label form mockup */
body.portal-gestione #configChatPopup label {
  font-family: var(--ff-body) !important;
  font-size: var(--fs-11) !important;
  font-weight: 600 !important;
  color: var(--ott-500) !important;
  letter-spacing: 0.04em;
}

/* select / textarea / date input (inline #d1d5db border, raggio 6px) */
body.portal-gestione #configChatPopup select,
body.portal-gestione #configChatPopup textarea,
body.portal-gestione #configChatPopup input[type="date"] {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body) !important;
  color: var(--ink) !important;
  outline: none;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
body.portal-gestione #configChatPopup select:hover,
body.portal-gestione #configChatPopup textarea:hover,
body.portal-gestione #configChatPopup input[type="date"]:hover {
  background: #fff !important;
}
body.portal-gestione #configChatPopup select:focus,
body.portal-gestione #configChatPopup textarea:focus,
body.portal-gestione #configChatPopup input[type="date"]:focus {
  border-color: var(--ott-base) !important;
  background: #fff !important;
  box-shadow: var(--rd-focus-ring) !important;
}
/* system prompt = codice → mono */
body.portal-gestione #configChatPopup textarea#chatConfigPrompt {
  font-family: var(--ff-mono) !important;
}
body.portal-gestione #configChatPopup textarea::placeholder,
body.portal-gestione #configChatPopup input::placeholder {
  color: var(--ott-300) !important;
}

/* hint sotto il system prompt (inline #6b7280) */
body.portal-gestione #configChatPopup small {
  color: var(--ott-500) !important;
}

/* bottoni: Ripristina default (inline #6b7280 bg) → ghost */
body.portal-gestione #configChatPopup #chatConfigResetBtn {
  background: #fff !important;
  color: var(--ink) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #configChatPopup #chatConfigResetBtn:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}
/* Salva + Aggiorna consumi (inline #890103 bg) → primario brand */
body.portal-gestione #configChatPopup #chatConfigSaveBtn,
body.portal-gestione #configChatPopup #chatCostRefreshBtn {
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
}
body.portal-gestione #configChatPopup #chatConfigSaveBtn:hover,
body.portal-gestione #configChatPopup #chatCostRefreshBtn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* divisore sezione Consumi (inline border-top #e5e7eb) */
body.portal-gestione #configChatPopup #chatConfigSaveBtn ~ * [style*="border-top"],
body.portal-gestione #configChatPopup [style*="border-top:1px solid #e5e7eb"] {
  border-top-color: var(--ott-100) !important;
}

/* titolo "Consumi Assistente AI" (inline #374151) */
body.portal-gestione #configChatPopup #chatCostSummary {
  align-items: stretch;
}

/* stat cards consumi (inline bg #f9fafb / border #e5e7eb) */
body.portal-gestione #configChatPopup #chatCostSummary > div {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}
/* etichetta card (inline #9ca3af uppercase) */
body.portal-gestione #configChatPopup #chatCostSummary > div > div:first-child {
  color: var(--ott-500) !important;
  font-weight: 600;
  letter-spacing: var(--ls-caps-wide);
}
/* numero card (inline #374151 18px) → mono, ink scuro */
body.portal-gestione #configChatPopup #chatCostTotalCalls,
body.portal-gestione #configChatPopup #chatCostTotalTokens,
body.portal-gestione #configChatPopup #chatCostAvgDuration {
  font-family: var(--ff-mono) !important;
  color: var(--ott-700) !important;
}
/* costo (inline #16a34a) → verde semantico */
body.portal-gestione #configChatPopup #chatCostTotalUsd {
  font-family: var(--ff-mono) !important;
  color: var(--ott-green) !important;
}

/* tabella consumi: thead border 2px #e5e7eb + th #6b7280 */
body.portal-gestione #configChatPopup #chatCostTable thead tr {
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #configChatPopup #chatCostTable th {
  color: var(--ott-500) !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-11) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
}
body.portal-gestione #configChatPopup #chatCostTable td {
  border-bottom: 1px solid var(--ott-100) !important;
  font-family: var(--ff-mono);
  color: var(--ink);
}
body.portal-gestione #configChatPopup #chatCostTable tbody tr:hover td {
  background: var(--ott-50);
}
/* ==================== Prompt descrizioni (#configPromptPopup) — overrides-added ==================== */
/* === configPromptPopup — Prompt descrizioni (override token-only) ===
   La fondazione copre input/select/textarea/label/.btn/.section/hint.
   Qui solo i bespoke con stile inline non agganciati ai pattern fondazione:
   box modello AI, tab a id, divider, bottone "Nuovo", monospace textarea. */

/* box "Modello AI descrizioni" (div inline-styled) */
body.portal-gestione #configPromptPopup > .section > div[style*="background:#f8fafc"] {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
}

/* messaggi/hint secondari inline (#6b7280 / #9ca3af) */
body.portal-gestione #configPromptPopup #promptDescModelMsg,
body.portal-gestione #configPromptPopup #promptSaveMsg {
  color: var(--ott-500) !important;
}
body.portal-gestione #configPromptPopup span[style*="#9ca3af"],
body.portal-gestione #configPromptPopup div[style*="#9ca3af"],
body.portal-gestione #configPromptPopup p[style*="#9ca3af"] {
  color: var(--ott-500) !important;
}

/* tab bespoke Zona/Edificio (id, non .management-tab) */
body.portal-gestione #configPromptPopup > .section > div[style*="border-bottom:2px solid #e5e7eb"] {
  border-bottom: 2px solid var(--ott-200) !important;
}
body.portal-gestione #configPromptPopup #promptTabZona,
body.portal-gestione #configPromptPopup #promptTabEdificio {
  font-family: var(--ff-body);
  color: var(--ott-500) !important;
  border-bottom-color: transparent !important;
}
/* tab attivo = bordo+testo brand (inline lo segna su Zona di default,
   il JS sposta lo stile; copro lo stato attivo via attributo inline blu) */
body.portal-gestione #configPromptPopup #promptTabZona[style*="#2563eb"],
body.portal-gestione #configPromptPopup #promptTabEdificio[style*="#2563eb"] {
  color: var(--ott-base) !important;
  border-bottom-color: var(--ott-base) !important;
}

/* divider sopra il form di edit */
body.portal-gestione #configPromptPopup > .section > div[style*="border-top:1px solid #e5e7eb"] {
  border-top: 1px solid var(--ott-100) !important;
}

/* bottone "Nuovo" bespoke → ghost */
body.portal-gestione #configPromptPopup #btnPromptNew {
  background: #fff !important;
  border: 1px solid var(--ott-200) !important;
  color: var(--ink) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body);
}
body.portal-gestione #configPromptPopup #btnPromptNew:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}

/* textarea prompt: monospace → token mono */
body.portal-gestione #configPromptPopup #promptEditBody {
  font-family: var(--ff-mono) !important;
}
/* ==================== Export demo (#exportDemoPopup) — overrides-added ==================== */
/* Export demo (descrizioni AI) — override scoped token-only.
   La fondazione (_redesign-impostazioni.css) gia' copre frame popup,
   header/title, .section, input/select[multiple], .btn.sec, hint.
   Qui solo cio' che resta hardcoded inline nel markup. */

/* testi secondari grigi (#6b7280) -> --ott-500 */
body.portal-gestione #exportDemoPopup .section small,
body.portal-gestione #exportDemoPopup #exportDemoMsg {
  color: var(--ott-500) !important;
}

/* nota asincrona faint (#9ca3af) -> --ott-300 */
body.portal-gestione #exportDemoPopup .section > p[style*="#9ca3af"] {
  color: var(--ott-300) !important;
}

/* divider barra azioni (#e5e7eb) -> --ott-100 (coerente footer fondazione) */
body.portal-gestione #exportDemoPopup .section > div[style*="border-top"] {
  border-top-color: var(--ott-100) !important;
}

/* checkbox zona/edificio: accent brand-aware */
body.portal-gestione #exportDemoPopup input[type="checkbox"] {
  accent-color: var(--ott-base);
}

/* label form -> spec mockup (11px UPPERCASE, --ott-500). Le label inline
   hanno font-size:12px che vince sulla fondazione; riallineo. Le label
   con checkbox restano flow inline (font-weight 600 invariato). */
body.portal-gestione #exportDemoPopup .section > div > label,
body.portal-gestione #exportDemoPopup .section > div > div > label {
  font-family: var(--ff-body) !important;
  font-size: var(--fs-11) !important;
  font-weight: 600 !important;
  color: var(--ott-500) !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
}
/* ==================== VM (#configVmPopup) — overrides-added ==================== */
/* ============================================================
 * VM — #configVmPopup (override scoped, token-only)
 * Markup generato in deskcontrol-portal.js (_ensureVmPopup +
 * _vmCard/_vmCardWide/_loadVmMetrics) con stili inline hardcoded.
 * La fondazione copre solo header/title (classi management-*),
 * NON il body del popup (div inline, no .section/.btn/.simple-table).
 * NB: i colori-soglia (cpuColor/ramColor/sColor) sono calcolati in
 * JS e applicati inline sui valori → semantici (rosso/giallo/verde
 * = informazione), NON toccati qui (vedi structuralNotes).
 * ============================================================ */

/* --- bottone "Aggiorna": uniforma radius + hover al sistema --- */
body.portal-gestione #configVmPopup #btnVmRefresh {
  height: 36px;
  padding: 0 18px !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body);
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #configVmPopup #btnVmRefresh:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* --- card metriche (_vmCard / _vmCardWide): bordo + radius --- */
/* targeting solo i wrapper card del grid metriche (figli diretti
 * dei due grid in #vmMetricsContent) per non toccare i messaggi
 * di stato testuali */
body.portal-gestione #configVmPopup #vmMetricsContent > div > div {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-12) !important;
}
/* label card (font-size:11px;font-weight:600;#64748b;uppercase) */
body.portal-gestione #configVmPopup #vmMetricsContent > div > div > div:first-child {
  font-family: var(--ff-body);
  color: var(--ott-500) !important;
  letter-spacing: var(--ls-caps-wide, .04em);
}
/* valore metrica grande → font display (il colore-soglia inline resta) */
body.portal-gestione #configVmPopup #vmMetricsContent > div > div > div:nth-child(2) {
  font-family: var(--ff-display) !important;
}
/* detail card tenue (#94a3b8) → secondario tokenizzato */
body.portal-gestione #configVmPopup #vmMetricsContent > div > div > div:last-child {
  color: color-mix(in srgb, var(--ott-500) 72%, white) !important;
}

/* --- tabella "Container attivi" --- */
/* heading "CONTAINER ATTIVI" (#64748b uppercase) */
body.portal-gestione #configVmPopup #vmMetricsContent table {
  font-family: var(--ff-body);
}
body.portal-gestione #configVmPopup #vmMetricsContent thead tr {
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide, .04em);
}
body.portal-gestione #configVmPopup #vmMetricsContent tbody tr {
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent tbody tr:hover td {
  background: var(--ott-50);
}
body.portal-gestione #configVmPopup #vmMetricsContent td {
  color: var(--ink);
}
/* ==================== Boost (#configBoostPopup) — overrides-added ==================== */
/* === Boost (configBoostPopup) — override token-only, scoped === */

/* corpo popup: spacing coerente col mockup (titolo gia' coperto dalla fondazione) */
body.portal-gestione #configBoostPopup #boostConfigContent {
  padding: 18px !important;
}

/* loading / errore inline (#64748b / #dc2626) -> token semantici */
body.portal-gestione #configBoostPopup #boostConfigContent > div[style*="64748b"] {
  color: var(--ott-500) !important;
}
body.portal-gestione #configBoostPopup #boostConfigContent > div[style*="dc2626"] {
  color: var(--ott-error) !important;
}

/* label inline (#333 / #374151 toggle+max) -> --ink */
body.portal-gestione #configBoostPopup #boostConfigContent label[style*="333"],
body.portal-gestione #configBoostPopup #boostConfigContent label[style*="374151"] {
  color: var(--ink) !important;
  font-family: var(--ff-body) !important;
}

/* sezione "Worker con credenziali personali" (#64748b) -> label secondaria */
body.portal-gestione #configBoostPopup #boostConfigContent div[style*="text-transform:uppercase"][style*="64748b"] {
  color: var(--ott-500) !important;
}

/* hint tenui (#94a3b8) -> --ott-500 (testo secondario) */
body.portal-gestione #configBoostPopup #boostConfigContent span[style*="94a3b8"],
body.portal-gestione #configBoostPopup #boostConfigContent div[style*="94a3b8"] {
  color: var(--ott-500) !important;
}

/* input number bespoke (border #d1d5db inline) -> bordo standard ottanio */
body.portal-gestione #configBoostPopup #boostMaxWorkers {
  background: var(--ott-50) !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  color: var(--ink) !important;
  font-family: var(--ff-body) !important;
}
body.portal-gestione #configBoostPopup #boostMaxWorkers:hover {
  background: #fff !important;
}
body.portal-gestione #configBoostPopup #boostMaxWorkers:focus {
  border-color: var(--ott-base) !important;
  background: #fff !important;
  box-shadow: var(--rd-focus-ring) !important;
  outline: none !important;
}

/* checkbox -> accent brand-aware (#dc2626 inline -> --ott-base) */
body.portal-gestione #configBoostPopup #boostEnabled,
body.portal-gestione #configBoostPopup .boost-worker-chk {
  accent-color: var(--ott-base) !important;
}

/* tabella worker bespoke (NON .simple-table) -> allineo th/td al sistema */
body.portal-gestione #configBoostPopup #boostConfigContent table {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden;
}
body.portal-gestione #configBoostPopup #boostConfigContent table thead tr {
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #configBoostPopup #boostConfigContent table th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-family: var(--ff-body) !important;
  font-weight: 600 !important;
  font-size: var(--fs-11) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
}
body.portal-gestione #configBoostPopup #boostConfigContent table tbody tr {
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #configBoostPopup #boostConfigContent table tbody tr:last-child {
  border-bottom: 0 !important;
}
body.portal-gestione #configBoostPopup #boostConfigContent table td {
  color: var(--ink) !important;
}
body.portal-gestione #configBoostPopup #boostConfigContent table tbody tr:hover td {
  background: var(--ott-50) !important;
}
/* email worker in mono (codice/identificativo) */
body.portal-gestione #configBoostPopup #boostConfigContent table td[style*="font-weight:500"] {
  font-family: var(--ff-mono) !important;
  font-size: var(--fs-12) !important;
  color: var(--ink) !important;
}

/* bottone salva bespoke (#btnBoostSave) -> btn primario ottanio (h36 + radius + hover) */
body.portal-gestione #configBoostPopup #btnBoostSave {
  height: 36px;
  padding: 0 18px !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  font-family: var(--ff-body) !important;
  font-weight: 600 !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #configBoostPopup #btnBoostSave:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}


/* ==================== Tipologie perizia — overlay modali (#tipologieEditor / #tipologieLegacyModal) ====================
 * Montati su document.body (position:fixed) SENZA .gestione-inline-panel:
 * la fondazione non li raggiunge. Reskin dedicato via scope body.portal-gestione
 * (attivo quando il modale e' aperto dalle Impostazioni). Token-only; struttura
 * deterministica generata da tipologie-admin.js (id robusti + match inline mirati). */

/* toolbar #tipologiePerziaPopup (riceve la fondazione, ma 3 bottoni sono inline bespoke) */
body.portal-gestione #tipologieAddBtn {
  background: var(--ott-base) !important; color: #fff !important;
  border: 1px solid var(--ott-base) !important; border-radius: var(--rd-r-7) !important;
}
body.portal-gestione #tipologieReloadBtn {
  background: #fff !important; color: var(--ink) !important;
  border: 1px solid var(--ott-200) !important; border-radius: var(--rd-r-7) !important;
}
body.portal-gestione #tipologieLegacyBtn {
  background: var(--ott-warn-bg) !important;
  color: color-mix(in srgb, var(--ott-warn) 80%, black) !important;
  border: 1px solid color-mix(in srgb, var(--ott-warn) 45%, white) !important;
  border-radius: var(--rd-r-7) !important;
}

/* card interna dei due overlay */
body.portal-gestione #tipologieEditor > div,
body.portal-gestione #tipologieLegacyModal > div {
  border-radius: var(--rd-r-12) !important;
  box-shadow: var(--rd-shadow-lg);
}
body.portal-gestione #tipologieEditor > div > div,
body.portal-gestione #tipologieLegacyModal > div > div {
  border-color: var(--ott-200) !important;
}
body.portal-gestione #tipologieEditor > div > div[style*="f8fafc"],
body.portal-gestione #tipologieLegacyModal > div > div[style*="f8fafc"] {
  background: var(--ott-50) !important;
}
body.portal-gestione #tipologieEditor h3,
body.portal-gestione #tipologieLegacyModal h3 {
  font-family: var(--ff-display); font-weight: 700; color: var(--ott-700) !important;
}

/* campi form nei modali */
body.portal-gestione #tipologieEditor input,
body.portal-gestione #tipologieEditor select,
body.portal-gestione #tipologieEditor textarea,
body.portal-gestione #tipologieLegacyModal input,
body.portal-gestione #tipologieLegacyModal select {
  background: var(--ott-50) !important; border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-8) !important; color: var(--ink) !important;
  font-family: var(--ff-body) !important; font-size: var(--fs-13) !important;
}
body.portal-gestione #tipologieEditor input:focus,
body.portal-gestione #tipologieEditor select:focus,
body.portal-gestione #tipologieEditor textarea:focus,
body.portal-gestione #tipologieLegacyModal input:focus,
body.portal-gestione #tipologieLegacyModal select:focus {
  border-color: var(--ott-base) !important; background: #fff !important; box-shadow: var(--rd-focus-ring);
}

/* azioni */
body.portal-gestione #tplClose,
body.portal-gestione #legClose { color: var(--ott-500) !important; }
body.portal-gestione #tplSave,
body.portal-gestione #legApply {
  background: var(--ott-base) !important; color: #fff !important;
  border: 1px solid var(--ott-base) !important; border-radius: var(--rd-r-7) !important;
}
body.portal-gestione #tplSave[disabled],
body.portal-gestione #legApply[disabled] { opacity: .5; }
body.portal-gestione #tplCancel {
  background: #fff !important; color: var(--ink) !important;
  border: 1px solid var(--ott-200) !important; border-radius: var(--rd-r-7) !important;
}
body.portal-gestione #tipologieLegacyModal > div > div[style*="fef3c7"] {
  background: var(--ott-warn-bg) !important;
  color: color-mix(in srgb, var(--ott-warn) 80%, black) !important;
  border-color: color-mix(in srgb, var(--ott-warn) 45%, white) !important;
}
body.portal-gestione #tipologiePerziaPopup td button[data-action="delete"],
body.portal-gestione #tipologieLegacyModal td button[data-action="delete"] {
  background: var(--ott-error-bg) !important; color: var(--ott-error) !important;
}

/* =====================================================================
 * COMPONENTI SEZIONE-TIPO (layout 2 colonne form + anteprima live + recenti)
 * Riusabili da Utenti/Clienti/Tecnici. Scoped body.portal-gestione, token-only.
 * ===================================================================== */
body.portal-gestione .imp-section .management-popup-header { display: none; }
body.portal-gestione .imp-2col { display: grid; grid-template-columns: 1fr 1fr; min-height: 520px; }
body.portal-gestione .imp-col { padding: 22px 24px; }
body.portal-gestione .imp-col--left { border-right: 1px solid var(--ott-200); }
body.portal-gestione .imp-col--right { background: var(--ott-50); }
@media (max-width: 900px) {
  body.portal-gestione .imp-2col { grid-template-columns: 1fr; }
  body.portal-gestione .imp-col--left { border-right: 0; border-bottom: 1px solid var(--ott-200); }
}

/* section header: titolo + dot + segmented */
body.portal-gestione .imp-sechead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
body.portal-gestione .imp-sechead .imp-title { font-family: var(--ff-display); font-weight: 800; font-size: var(--fs-15); margin: 0; display: flex; align-items: center; gap: 9px; color: var(--ink); }
body.portal-gestione .imp-seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--ott-50); border: 1px solid var(--ott-200); border-radius: var(--rd-r-8); }
body.portal-gestione .imp-seg .management-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px !important; border: 0 !important; background: transparent !important; color: var(--ott-500) !important; border-radius: var(--rd-r-6) !important; font-size: var(--fs-12-5) !important; font-weight: 600 !important; }
body.portal-gestione .imp-seg .management-tab svg { width: 13px; height: 13px; }
body.portal-gestione .imp-seg .management-tab.active { background: #fff !important; color: var(--ott-base) !important; box-shadow: var(--rd-shadow-sm); }

/* form card con header-icona */
body.portal-gestione .imp-formcard { border: 1px solid var(--ott-200); border-radius: var(--rd-r-9); background: #fff; overflow: hidden; }
body.portal-gestione .imp-formcard__head { padding: 12px 16px; border-bottom: 1px solid var(--ott-100); display: flex; align-items: center; gap: 9px; background: var(--ott-50); }
body.portal-gestione .imp-formcard__ic { width: 26px; height: 26px; border-radius: var(--rd-r-6); background: #fff; border: 1px solid var(--ott-200); display: flex; align-items: center; justify-content: center; color: var(--ott-base); flex-shrink: 0; }
body.portal-gestione .imp-formcard__ic svg { width: 14px; height: 14px; }
body.portal-gestione .imp-formcard__head h4 { font-family: var(--ff-display); font-weight: 700; font-size: var(--fs-12-5); text-transform: uppercase; letter-spacing: var(--ls-caps-tight); color: var(--ott-700); margin: 0; }
body.portal-gestione .imp-formcard__head .management-sheet-actions { margin-left: auto; display: flex; gap: 6px; }
body.portal-gestione .imp-formcard__body { padding: 18px 16px; }
body.portal-gestione .imp-formcard__body .inp--mail { padding-left: 36px !important; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='4' width='20' height='16' rx='2'/><path d='m22 7-10 5L2 7'/></svg>") !important; background-repeat: no-repeat !important; background-position: left 12px center !important; }

/* footer form */
body.portal-gestione .imp-formfoot { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ott-100); flex-wrap: wrap; }
body.portal-gestione .imp-formfoot .btn svg { width: 14px; height: 14px; }
body.portal-gestione .imp-formfoot__sp { flex: 1; }
body.portal-gestione .imp-formfoot__hint { font-size: var(--fs-11); color: var(--ott-500); }
body.portal-gestione .imp-req { color: var(--ott-red); font-weight: 700; }

/* batch accordion */
body.portal-gestione .imp-batch.section { margin-top: 16px; border: 1px solid var(--ott-200) !important; border-radius: var(--rd-r-9) !important; overflow: hidden; padding: 0 !important; background: #fff !important; }
body.portal-gestione .imp-batch__head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; }
body.portal-gestione .imp-batch__ic { width: 26px; height: 26px; border-radius: var(--rd-r-6); background: var(--ott-50); border: 1px solid var(--ott-200); display: flex; align-items: center; justify-content: center; color: var(--ott-base); flex-shrink: 0; }
body.portal-gestione .imp-batch__ic svg { width: 14px; height: 14px; }
body.portal-gestione .imp-batch__head h2 { font-family: var(--ff-display) !important; font-weight: 700 !important; font-size: var(--fs-13) !important; margin: 0 !important; flex: 1; color: var(--ott-700) !important; }
body.portal-gestione .imp-batch .section-body { padding: 0 16px 16px; border-top: 1px solid var(--ott-100); }

/* preview card */
body.portal-gestione .imp-preview { border: 1px solid var(--ott-200); border-radius: var(--rd-r-9); background: #fff; overflow: hidden; margin-bottom: 18px; }
body.portal-gestione .imp-preview__head { padding: 11px 16px; border-bottom: 1px solid var(--ott-100); font-size: var(--fs-10-5); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-caps-wide); color: var(--ott-500); display: flex; align-items: center; justify-content: space-between; }
body.portal-gestione .imp-live { display: inline-flex; align-items: center; gap: 6px; color: var(--ott-base); }
body.portal-gestione .imp-live__d { width: 6px; height: 6px; border-radius: 50%; background: var(--ott-green); }
body.portal-gestione .imp-preview__body { padding: 18px 16px; display: flex; align-items: center; gap: 14px; }
body.portal-gestione .imp-avatar { width: 52px; height: 52px; border-radius: var(--rd-r-12); background: linear-gradient(135deg, var(--ott-soft), var(--ott-deep)); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--ff-display); font-weight: 800; font-size: 18px; flex-shrink: 0; }
body.portal-gestione .imp-pv__name { font-family: var(--ff-display); font-weight: 700; font-size: var(--fs-15); color: var(--ink); }
body.portal-gestione .imp-pv__mail { font-family: var(--ff-mono); font-size: var(--fs-12); color: var(--ott-500); margin-top: 2px; }
body.portal-gestione .imp-pv__meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
body.portal-gestione .imp-pill__d { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* recent list */
body.portal-gestione .imp-recent__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
body.portal-gestione .imp-recent__head h4 { font-family: var(--ff-display); font-weight: 700; font-size: var(--fs-13); margin: 0; color: var(--ink); }
body.portal-gestione .imp-recent__head a { font-size: var(--fs-11-5); font-weight: 600; color: var(--ott-base); text-decoration: none; }
body.portal-gestione .imp-recent__list { display: flex; flex-direction: column; gap: 8px; }
body.portal-gestione .imp-recent__empty { font-size: var(--fs-12); color: var(--ott-500); padding: 8px 2px; }
body.portal-gestione .imp-urow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--ott-200); border-radius: var(--rd-r-9); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
body.portal-gestione .imp-urow:hover { border-color: var(--ott-300); box-shadow: var(--rd-shadow-sm); }
body.portal-gestione .imp-urow__av { width: 34px; height: 34px; border-radius: var(--rd-r-8); display: flex; align-items: center; justify-content: center; font-family: var(--ff-display); font-weight: 700; font-size: var(--fs-13); color: #fff; flex-shrink: 0; }
body.portal-gestione .imp-urow__main { flex: 1; min-width: 0; }
body.portal-gestione .imp-urow__name { font-size: var(--fs-13); font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portal-gestione .imp-urow__mail { font-family: var(--ff-mono); font-size: var(--fs-11); color: var(--ott-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.portal-gestione .imp-statusdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
body.portal-gestione .imp-urow__act { display: flex; gap: 4px; }
body.portal-gestione .imp-iconbtn { width: 28px; height: 28px; border-radius: var(--rd-r-6); color: var(--ott-500); display: flex; align-items: center; justify-content: center; background: transparent; border: 0; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
body.portal-gestione .imp-iconbtn:hover { background: var(--ott-50); color: var(--ott-base); }
body.portal-gestione .imp-iconbtn svg { width: 14px; height: 14px; }

/* avatar palette per indice (token-based, brand-aware) */
body.portal-gestione .imp-av-0 { background: var(--ott-deep) !important; }
body.portal-gestione .imp-av-1 { background: var(--ott-soft) !important; }
body.portal-gestione .imp-av-2 { background: var(--ott-base) !important; }
body.portal-gestione .imp-av-3 { background: var(--ott-warn) !important; }
body.portal-gestione .imp-av-4 { background: var(--ott-green) !important; }
body.portal-gestione .imp-av-5 { background: var(--ott-500) !important; }


/* layout entità: popup più largo + variante wide (form grande + colonna anteprima) */
body.portal-gestione .imp-section.gestione-inline-panel { max-width: 1060px; }
body.portal-gestione .imp-2col--wide { grid-template-columns: 1.7fr 1fr; }
body.portal-gestione .imp-2col--wide .imp-col--left .perito-form-grid { gap: 0 18px; }


/* anteprima compatta (es. Clienti detail: header identità sopra il form) */
body.portal-gestione .imp-preview--compact { margin-bottom: 16px; }
body.portal-gestione .imp-preview--compact .imp-preview__body { padding: 14px 16px; }
body.portal-gestione .imp-preview--compact .imp-avatar { width: 44px; height: 44px; font-size: 15px; }


/* =====================================================================
 * ROUND 2 — header-icona + rifinitura per-sezione (config/sistema)
 * Generati dal workflow redesign-impostazioni-round2, verificati.
 * Scoped body.portal-gestione #<popupId>, token-only.
 * ===================================================================== */

/* ===== Gruppi (#gruppiPopup) ===== */
/* ===== Impostazioni · Gruppi (#gruppiPopup) — rifinitura "esempio" ottanio =====
 * Scope: body.portal-gestione #gruppiPopup. Token-only, NON ridefinisce la
 * fondazione (frame/header/tab/section/input/.btn/.simple-table) ne' il primo
 * override per-sezione (card/tbl-group-hdr/btn-inline-danger/testi secondari).
 * Aggiunge l'icona header + rifinisce i residui bespoke resi via JS con
 * token legacy o style inline (mapcontrol-core.js renderGruppi / matrici). */

/* --- Icona header (lucide "layers": gruppi & servizi a livelli) --- */
body.portal-gestione #gruppiPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='12 2 2 7 12 12 22 7 12 2'/><polyline points='2 17 12 22 22 17'/><polyline points='2 12 12 17 22 12'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='12 2 2 7 12 12 22 7 12 2'/><polyline points='2 17 12 22 22 17'/><polyline points='2 12 12 17 22 12'/></svg>") center / contain no-repeat;
}

/* empty-state ("Nessun gruppo trovato") reso inline con color:var(--text-muted) */
body.portal-gestione #gruppiPopup #gruppiListContainer > p {
  color: var(--ott-500) !important;
  font-size: var(--fs-13) !important;
}

/* card gruppo: ombra/spaziatura coerente con le card "esempio" */
body.portal-gestione #gruppiPopup .gruppi-card {
  box-shadow: var(--rd-shadow-sm);
  padding: 12px 14px !important;
  margin-bottom: 10px !important;
}

/* header card gruppo: nome in display, conteggio membri allineato a destra */
body.portal-gestione #gruppiPopup .gruppi-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.portal-gestione #gruppiPopup .gruppi-card-header strong {
  font-family: var(--ff-display);
  color: var(--ott-700);
}
body.portal-gestione #gruppiPopup .gruppi-card-header > span:last-of-type {
  margin-left: auto;
}

/* bottone "Elimina" inline (.btn-inline-danger): hover su bg semantico tenue */
body.portal-gestione #gruppiPopup .btn-inline-danger {
  border-radius: var(--rd-r-6) !important;
  padding: 2px 8px !important;
  font-size: var(--fs-12) !important;
  transition: background var(--t-fast), color var(--t-fast);
}
body.portal-gestione #gruppiPopup .btn-inline-danger:hover {
  background: var(--ott-red-bg) !important;
}

/* bottoni piccoli bespoke (.btn-sm: Gestisci membri / Salva servizi / Salva membri):
   uniforma altezza/raggio/font ai .btn della fondazione */
body.portal-gestione #gruppiPopup .btn.btn-sm {
  height: 30px;
  padding: 0 12px !important;
  font-size: var(--fs-12-5) !important;
  border-radius: var(--rd-r-7) !important;
}

/* select override servizi-utente (.usr-svc-override) reso inline con font-size:0.85em:
   allinea ai token form (la fondazione stila select ma questo e' bespoke inline) */
body.portal-gestione #gruppiPopup .usr-svc-override {
  font-size: var(--fs-12) !important;
  height: 28px;
  padding: 0 6px !important;
  border: 1px solid var(--ott-200);
  border-radius: var(--rd-r-6);
  color: var(--ott-700);
  background: #fff;
}
body.portal-gestione #gruppiPopup .usr-svc-override:focus {
  outline: none;
  border-color: var(--ott-base);
  box-shadow: var(--rd-focus-ring);
}

/* matrice servizi/permessi: celle "Attivo/Effettivo/Override" centrate + checkbox brand */
body.portal-gestione #gruppiPopup .grp-svc-matrix input[type="checkbox"] {
  accent-color: var(--ott-base);
}
body.portal-gestione #gruppiPopup .grp-mfa-check {
  accent-color: var(--ott-base);
}

/* pannello membri (lista scrollabile resa inline): cornice + scroll coerenti */
body.portal-gestione #gruppiPopup .gruppi-members > div {
  border: 1px solid var(--ott-200);
  border-radius: var(--rd-r-7);
  padding: 6px 8px;
  background: var(--ott-50);
}
body.portal-gestione #gruppiPopup .gruppi-members label {
  color: var(--ott-700) !important;
  font-size: var(--fs-13);
}
body.portal-gestione #gruppiPopup .gruppi-members input[type="checkbox"] {
  accent-color: var(--ott-base);
}

/* nota "ruolo esente" (testo italic reso inline con --text-muted) */
body.portal-gestione #gruppiPopup #userSvcMatrixContainer > p {
  color: var(--ott-500) !important;
  font-size: var(--fs-13) !important;
}
/* ===== Tipologie perizia (#tipologiePerziaPopup) ===== */
/* ==================== Tipologie perizia (#tipologiePerziaPopup) — header icon refine ==================== */
/* Rifinitura "esempio": icona nell'header-card (tag/list, brand-aware via mask).
 * I residui (bottoni toolbar bespoke, celle/span tabella colorati inline, hint <p>)
 * sono GIA' coperti dal blocco per-sezione esistente in questo file (#tipologiePerziaPopup,
 * sez. precedente) e dalla fondazione (.gestione-inline-panel): NON ridefiniti qui.
 * Manca solo l'icona header → unica aggiunta. Token-only, scoped. */

/* Header come riga flex per allineare icona + titolo (la fondazione setta solo
 * padding/bg/border del .management-popup-header, non il layout interno). */
body.portal-gestione #tipologiePerziaPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Glyph lucide "tag" (pertinente: tipologie/etichette di pratica).
 * stroke='black' = pieno opaco nella mask; il colore reale = --ott-base (brand-aware). */
body.portal-gestione #tipologiePerziaPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/><circle cx='7.5' cy='7.5' r='1.5'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/><circle cx='7.5' cy='7.5' r='1.5'/></svg>") center / contain no-repeat;
}
/* ===== Inviti (#invitiPopup) ===== */
/* ============================================================
 * Inviti (#invitiPopup) — rifinitura "esempio": icona header + residui
 * Scoped, token-only. NON ridefinisce la fondazione ne' il primo
 * override per-sezione (linee 866-951 _redesign-impostazioni.css).
 * ============================================================ */

/* --- ICONA HEADER (mail/send) -------------------------------------------
 * Glyph lucide-style "send" (aeroplanino) pertinente agli inviti utente.
 * background-color brand-aware, stroke 'black' = pieno opaco nel mask. */
body.portal-gestione #invitiPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione #invitiPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='22' y1='2' x2='11' y2='13'/><polygon points='22 2 15 22 11 13 2 9 22 2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='22' y1='2' x2='11' y2='13'/><polygon points='22 2 15 22 11 13 2 9 22 2'/></svg>") center / contain no-repeat;
}

/* --- BOTTONI AZIONE DI RIGA (Revoca / Copia link) -----------------------
 * Renderizzati a runtime nel renderer JS con .mon-filter-btn + inline
 * font-size:11px (loadInvitations()). La fondazione li rende primari full
 * height 36px: dentro una cella tabella sono sovradimensionati. Qui resi
 * compatti (h26, ghost), distinti per semantica via attributo data-*. */
body.portal-gestione #invitiPopup .monitoring-log-table .mon-filter-btn {
  height: 26px !important;
  padding: 0 10px !important;
  gap: 5px;
  font-size: var(--fs-11) !important;
  font-weight: 600 !important;
  border-radius: var(--rd-r-6) !important;
}
/* Copia link = azione neutra → ghost ottanio */
body.portal-gestione #invitiPopup .monitoring-log-table .mon-filter-btn[data-copy] {
  color: var(--ott-base) !important;
  background: var(--paper) !important;
  border: 1px solid var(--ott-300) !important;
}
body.portal-gestione #invitiPopup .monitoring-log-table .mon-filter-btn[data-copy]:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-base) !important;
}
/* Revoca = azione distruttiva → ghost rosso semantico */
body.portal-gestione #invitiPopup .monitoring-log-table .mon-filter-btn[data-revoke] {
  color: var(--ott-red) !important;
  background: var(--paper) !important;
  border: 1px solid var(--ott-300) !important;
}
body.portal-gestione #invitiPopup .monitoring-log-table .mon-filter-btn[data-revoke]:hover {
  background: var(--ott-red-bg) !important;
  border-color: var(--ott-red) !important;
}

/* --- CELLA STATO: hex inline → token semantici --------------------------
 * Il renderer JS scrive inline style="color:#090|#F57F17|#c62828" sul <td>
 * (NON applica .status-ok/.status-err, quindi quei selettori non scattano).
 * Mappo ogni hex sul token corrispondente via attribute-substring + pill. */
body.portal-gestione #invitiPopup .monitoring-log-table td[style*="#090"],
body.portal-gestione #invitiPopup .monitoring-log-table td[style*="#F57F17"],
body.portal-gestione #invitiPopup .monitoring-log-table td[style*="#c62828"] {
  font-weight: 600;
  text-transform: capitalize;
}
body.portal-gestione #invitiPopup .monitoring-log-table td[style*="#090"] {
  color: var(--ott-green) !important;   /* accepted */
}
body.portal-gestione #invitiPopup .monitoring-log-table td[style*="#F57F17"] {
  color: var(--ott-warn) !important;    /* pending */
}
body.portal-gestione #invitiPopup .monitoring-log-table td[style*="#c62828"] {
  color: var(--ott-red) !important;     /* revoked/expired */
}
/* ===== Permessi (#permessiPopup) ===== */
/* ==================== Permessi (#permessiPopup) — rifinitura "esempio" (icona header + residui), scoped token-only ==================== */

/* --- ICONA HEADER (shield + keyhole = permessi per ruolo), brand-aware via mask ---
 * La fondazione .gestione-inline-panel .management-popup-header non imposta display:flex,
 * quindi lo dichiaro qui per seatare l'icona inline a sinistra del titolo. Il pulsante
 * di chiusura e' nascosto a runtime (display:none), nessun conflitto di layout. */
body.portal-gestione #permessiPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione #permessiPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/><circle cx='12' cy='11' r='1.5'/><path d='M12 12.5V15'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/><circle cx='12' cy='11' r='1.5'/><path d='M12 12.5V15'/></svg>") center / contain no-repeat;
}

/* --- CHECKBOX MATRICE (.perm-check): native browser blu -> accent brand ottanio ---
 * Sono input nativi non toccati dalla fondazione: senza override il check resta blu
 * di default. accent-color li allinea al brand; centrati nelle celle role. */
body.portal-gestione #permessiPopup .permessi-matrix .perm-check {
  accent-color: var(--ott-base);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
  vertical-align: middle;
}
/* colonna Developer = permessi non modificabili (checked disabled): leggi "locked" */
body.portal-gestione #permessiPopup .permessi-matrix .perm-check:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* --- celle role centrate (matrice = griglia di stati on/off) --- */
body.portal-gestione #permessiPopup .permessi-matrix thead th:not(:first-child),
body.portal-gestione #permessiPopup .permessi-matrix tbody td:not(.tbl-group-hdr):not(:first-child) {
  text-align: center;
}
/* prima colonna (label sezione/funzione) = testo leggibile, peso lieve */
body.portal-gestione #permessiPopup .permessi-matrix tbody td:first-child {
  color: var(--ink);
  font-weight: 500;
}
/* ===== Ruoli (#ruoliPopup) ===== */
/* ==================== Ruoli (#ruoliPopup) — rifinitura "esempio" ====================
 * Additivo all'override per-sezione esistente (icona header + residui non coperti).
 * Scope body.portal-gestione #ruoliPopup, token-only, brand-aware.
 * NB: il markup statico NON ha .gestione-inline-panel (aggiunta a runtime),
 * quindi si scopa direttamente a #ruoliPopup come l'override esistente. */

/* --- ICONA HEADER (user-check, brand-aware via mask) --- */
body.portal-gestione #ruoliPopup .management-popup-header {
  justify-content: flex-start;
  gap: 8px;
}
body.portal-gestione #ruoliPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><polyline points='16 11 18 13 22 9'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/><circle cx='9' cy='7' r='4'/><polyline points='16 11 18 13 22 9'/></svg>") center / contain no-repeat;
}

/* --- bottoni-azione DENTRO la tabella ruoli: compattati (l'override base
 *     porta .mon-filter-btn a h36/padding16, troppo per le celle) --- */
body.portal-gestione #ruoliPopup .monitoring-log-table .mon-filter-btn {
  height: 28px;
  padding: 0 10px !important;
  font-size: var(--fs-11) !important;
}

/* --- "Elimina" ruolo custom (inline color:#c62828, schiacciato a #fff dal
 *     base .mon-filter-btn) -> danger ghost tokenizzato --- */
body.portal-gestione #ruoliPopup .monitoring-log-table .mon-filter-btn[data-del-role] {
  background: #fff !important;
  color: var(--ott-red) !important;
  border-color: color-mix(in srgb, var(--ott-red) 30%, white) !important;
}
body.portal-gestione #ruoliPopup .monitoring-log-table .mon-filter-btn[data-del-role]:hover {
  background: color-mix(in srgb, var(--ott-red) 8%, white) !important;
  border-color: color-mix(in srgb, var(--ott-red) 45%, white) !important;
}

/* --- badge "Tipo" ruolo: span con hex inline (#2196F3 Custom / #999 System)
 *     -> pill tenui token (brand per custom, neutro per system) --- */
body.portal-gestione #ruoliPopup .monitoring-log-table td span[style*="#2196F3"] {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-10-5) !important;
  font-weight: 600;
  color: var(--ott-base) !important;
  background: color-mix(in srgb, var(--ott-base) 10%, white) !important;
  padding: 2px 9px;
  border-radius: var(--rd-r-pill);
  letter-spacing: var(--ls-caps-wide);
  text-transform: uppercase;
}
body.portal-gestione #ruoliPopup .monitoring-log-table td span[style*="#999"] {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-10-5) !important;
  font-weight: 600;
  color: var(--ott-500) !important;
  background: var(--ott-100) !important;
  padding: 2px 9px;
  border-radius: var(--rd-r-pill);
  letter-spacing: var(--ls-caps-wide);
  text-transform: uppercase;
}

/* --- matrice permessi: intestazioni di categoria (div con border-bottom:#eee
 *     inline, iniettate da JS) -> divisore + label secondaria token --- */
body.portal-gestione #ruoliPopup #rolePermGrid > div[style*="grid-column"] {
  color: var(--ott-500) !important;
  font-size: var(--fs-11) !important;
  letter-spacing: var(--ls-caps-wide) !important;
  border-bottom: 1px solid var(--ott-100) !important;
}

/* --- checkbox permessi: accent del browser -> brand --- */
body.portal-gestione #ruoliPopup #rolePermGrid input[type="checkbox"] {
  accent-color: var(--ott-base);
}

/* --- titolo "Permessi: <ruolo>" sopra la matrice -> ink/display tenue --- */
body.portal-gestione #ruoliPopup #rolePermMatrix > div:first-child {
  color: var(--ink) !important;
}
body.portal-gestione #ruoliPopup #rolePermTitle {
  color: var(--ott-base) !important;
  font-weight: 700;
}
/* ===== Produzione (#produzionePopup) ===== */
/* ==================== Produzione (#produzionePopup) — icona header + layout ==================== */
/* La fondazione (_redesign-impostazioni.css) copre header card / titolo uppercase / .section /
 * .simple-table / .gestione-panel-hint / .gestione-panel-footer / .btn.
 * L'override per-sezione esistente (righe ~1057-1090) copre gia': toggle-switch OFF/ON/knob,
 * .tbl-group-hdr (bg ott-50 + label ott-500), bordi riga ott-200, etichetta funzione ink.
 * Qui si aggiunge SOLO l'icona header obbligatoria + il fix di allineamento icona/titolo. */

/* Header in modalita' inline-panel: justify space-between (perizie.css) spargerebbe
 * icona e titolo ai due estremi. Allineo a sinistra cosi' restano adiacenti (gap 8px gia' presente).
 * Il bottone di chiusura e' display:none in inline-panel → fuori flusso, nessun impatto. */
body.portal-gestione #produzionePopup .management-popup-header {
  justify-content: flex-start;
}

/* Icona header (sliders-horizontal, lucide-style) — glyph BRAND-AWARE via mask, colore da --ott-base */
body.portal-gestione #produzionePopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='21' y1='4' x2='14' y2='4'/><line x1='10' y1='4' x2='3' y2='4'/><line x1='21' y1='12' x2='12' y2='12'/><line x1='8' y1='12' x2='3' y2='12'/><line x1='21' y1='20' x2='16' y2='20'/><line x1='12' y1='20' x2='3' y2='20'/><line x1='14' y1='2' x2='14' y2='6'/><line x1='8' y1='10' x2='8' y2='14'/><line x1='16' y1='18' x2='16' y2='22'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='21' y1='4' x2='14' y2='4'/><line x1='10' y1='4' x2='3' y2='4'/><line x1='21' y1='12' x2='12' y2='12'/><line x1='8' y1='12' x2='3' y2='12'/><line x1='21' y1='20' x2='16' y2='20'/><line x1='12' y1='20' x2='3' y2='20'/><line x1='14' y1='2' x2='14' y2='6'/><line x1='8' y1='10' x2='8' y2='14'/><line x1='16' y1='18' x2='16' y2='22'/></svg>") center / contain no-repeat;
}
/* ===== API Keys (#apikeysPopup) ===== */
/* ==================== API Keys (#apikeysPopup) — rifinitura "esempio": icona header ==================== */
/* La fondazione + l'override per-sezione esistente (mon-filter-btn, monitoring-log-table,
 * summary, modale one-time, akOneTimeKey) sono GIA' presenti: NON ridefiniti qui.
 * Questo blocco aggiunge SOLO l'icona "key" nell'header (mandatoria) e rende l'header
 * un flex container affinche' il glyph ::before sia inline col titolo (la fondazione
 * imposta solo padding/border/bg, non display:flex/gap). */

body.portal-gestione #apikeysPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* glyph "key" lucide-style, brand-aware via mask (stroke 'black' = pieno; colore reale = --ott-base) */
body.portal-gestione #apikeysPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4'/></svg>") center / contain no-repeat;
}
/* ===== Abbonamento (#abbonamentoPopup) ===== */
/* ==================== Abbonamento (#abbonamentoPopup) — rifinitura "esempio" ====================
 * La fondazione copre frame/header/.section/input/select/.btn.
 * Un primo override per-sezione (badge piano, .mon-filter-btn, .monitoring-log-table,
 * divisore admin, msg cambio piano) e' gia' in _redesign-impostazioni.css:1176-1248 — NON ridefinito.
 * Qui SOLO: (1) icona header credit-card; (2) barre utilizzo #subUsageBars
 * (track + fill + testi), unico residuo inline-JS non ancora tokenizzato. */

/* (1) Icona header — credit-card (lucide-style), brand-aware via mask */
body.portal-gestione #abbonamentoPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='5' width='20' height='14' rx='2'/><line x1='2' y1='10' x2='22' y2='10'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='5' width='20' height='14' rx='2'/><line x1='2' y1='10' x2='22' y2='10'/></svg>") center / contain no-repeat;
}

/* (2) Barre utilizzo (#subUsageBars) — struttura creata inline dal JS
 * (deskcontrol-portal.js:3825-3832): ogni voce = div > [riga label, div track > div fill].
 * Track inline #eee, fill colori funzionali #4CAF50/#FF9800/#f44336, testi inline #666.
 * Mappo track e testi ai grigi token; i fill ai semantici (verde/warn/red) via override
 * dei tre hex inline con !important per battere lo style inline. */

/* riga label (nome risorsa + valore/max) */
body.portal-gestione #abbonamentoPopup #subUsageBars > div > div:first-child {
  color: var(--ott-500) !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-12) !important;
}
/* track barra: #eee inline -> grigio token */
body.portal-gestione #abbonamentoPopup #subUsageBars > div > div:last-child {
  background: var(--ott-100) !important;
  border-radius: var(--rd-r-5) !important;
}
/* fill barra: i tre stati funzionali -> semantici brand-coherent */
body.portal-gestione #abbonamentoPopup #subUsageBars > div > div:last-child > div {
  border-radius: var(--rd-r-5) !important;
}
body.portal-gestione #abbonamentoPopup #subUsageBars > div > div:last-child > div[style*="#4CAF50"] {
  background: var(--ott-green) !important;
}
body.portal-gestione #abbonamentoPopup #subUsageBars > div > div:last-child > div[style*="#FF9800"] {
  background: var(--ott-warn) !important;
}
body.portal-gestione #abbonamentoPopup #subUsageBars > div > div:last-child > div[style*="#f44336"] {
  background: var(--ott-red) !important;
}
/* ===== Audit & Sessioni (#auditPopup) ===== */
/* === Audit & Sessioni (#auditPopup) — rifinitura "esempio" ottanio ===
 * La fondazione copre frame/header/tabs/.section/input/select/date.
 * Un primo override per-sezione (questo file, ~1249) gia' rimappa
 * .audit-toolbar / .mon-filter-btn / .audit-table-wrap / .monitoring-log-table /
 * .monitoring-pagination. Qui si AGGIUNGE solo: (1) icona header (mancante),
 * (2) layout flex header per affiancare icona+titolo, (3) fix bottoni pagina
 * (in JS resi come .mon-filter-btn -> ereditano il fill primario: i numeri di
 * pagina diventano tutti "primari"; vanno ghost, attivo = primario),
 * (4) riga login fallito (#fff0f0 inline hardcoded) -> token semantico. */

/* (2) header come flex container per ospitare l'icona accanto al titolo */
body.portal-gestione #auditPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* (1) ICONA header — glyph lucide "activity" (linea pulse/heartbeat),
 * brand-aware via mask: colore reale da background-color = var(--ott-base) */
body.portal-gestione #auditPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-4l-3 9L9 3l-3 9H2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-4l-3 9L9 3l-3 9H2'/></svg>") center / contain no-repeat;
}

/* (3) bottoni paginazione (JS: .mon-filter-btn dentro .monitoring-pagination)
 * non devono ereditare il fill primario del filtro: ghost ottanio di default,
 * attivo = primario brand. Piu' specifico del rule .mon-filter-btn esistente. */
body.portal-gestione #auditPopup .monitoring-pagination .mon-filter-btn {
  height: auto;
  padding: 4px 11px !important;
  color: var(--ink) !important;
  background: #fff !important;
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-7) !important;
  font-weight: 600 !important;
}
body.portal-gestione #auditPopup .monitoring-pagination .mon-filter-btn:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}
body.portal-gestione #auditPopup .monitoring-pagination .mon-filter-btn.active {
  color: #fff !important;
  background: var(--ott-base) !important;
  border-color: var(--ott-base) !important;
}

/* (4) riga login FALLITO: in JS la cella esito riceve style="background:#fff0f0"
 * (rosa hardcoded). Rimappa al tint semantico errore + testo rosso semantico. */
body.portal-gestione #auditPopup .monitoring-log-table td[style*="background:#fff0f0"] {
  background: var(--ott-error-bg) !important;
  color: var(--ott-red) !important;
  font-weight: 600 !important;
}
/* ===== Rate limit (#configRateLimitPopup) ===== */
/* ==================== Rate limit (#configRateLimitPopup) — rifinitura "esempio" ==================== */
/* La fondazione (.gestione-inline-panel) copre tabs/.btn/input/select/label/
   .simple-table; il primo override per-sezione (1352-1455) copre card bucket,
   testi muti, box test, tessere stat, code/pre, hr, alert/soglie. Qui si
   aggiunge SOLO cio' che manca: l'icona header + il titolo <h2> raw (non e'
   .management-popup-title, quindi la tipografia ottanio non lo raggiunge). */

/* --- header: layout flex per ospitare l'icona accanto al titolo --- */
body.portal-gestione #configRateLimitPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* --- icona header: gauge (rate limit), glyph lucide-style brand-aware via mask --- */
body.portal-gestione #configRateLimitPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 14l4-4'/><path d='M3.34 19a10 10 0 1 1 17.32 0'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 14l4-4'/><path d='M3.34 19a10 10 0 1 1 17.32 0'/></svg>") center / contain no-repeat;
}

/* --- titolo: <h2> raw nell'header (non .management-popup-title) → display
       ottanio uppercase, coerente con Sicurezza/Worker --- */
body.portal-gestione #configRateLimitPopup .management-popup-header h2 {
  margin: 0 !important;
  font-family: var(--ff-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-13) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight);
  color: var(--ott-700) !important;
}
/* ===== Sicurezza sessione (#configSicurezzaPopup) ===== */
/* ============================================================
   Sicurezza sessione (#configSicurezzaPopup) — rifinitura ottanio
   Solo override scoped + token. Fondazione NON ridefinita.
   ============================================================ */

/* --- Icona header: shield (lucide) brand-aware via mask --- */
body.portal-gestione #configSicurezzaPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/></svg>") center / contain no-repeat;
}

/* --- Testi descrittivi: grigi hardcoded inline (#555/#888) -> token --- */
body.portal-gestione #configSicurezzaPopup .section > p {
  font-family: var(--ff-body);
  font-size: var(--fs-13) !important;
  line-height: 1.5;
  color: var(--ott-700) !important;
}
body.portal-gestione #configSicurezzaPopup .section > p small {
  color: var(--ott-500) !important;
}

/* --- Label inline -> caps ottanio coerente con la fondazione --- */
body.portal-gestione #configSicurezzaPopup .section label {
  font-family: var(--ff-body);
  font-size: var(--fs-11) !important;
  font-weight: 600;
  letter-spacing: var(--ls-caps-wide);
  text-transform: uppercase;
  color: var(--ott-700);
}

/* --- Bottone Salva bespoke (.mon-filter-btn, non .btn) -> primario brand
   (allineato al pattern #ruoliPopup/#apikeysPopup della fondazione) --- */
body.portal-gestione #configSicurezzaPopup .mon-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-13) !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: var(--ott-base) !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #configSicurezzaPopup .mon-filter-btn:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}
body.portal-gestione #configSicurezzaPopup .mon-filter-btn:focus-visible {
  outline: none;
  box-shadow: var(--rd-focus-ring);
}

/* NB: #sessSaveMsg NON viene toccato: il colore (verde successo / rosso errore)
   e' impostato a runtime via JS (style.color inline) ed e' un segnale semantico
   funzionale; un override !important lo annullerebbe. Lasciato invariato. */
/* ===== Cestino (#configCestinoPopup) ===== */
/* ==================== Cestino (#configCestinoPopup) — rifinitura "esempio" ==================== */
/* Additivo all'override gia' presente (_redesign-impostazioni.css:1508-1602).
 * Scope body.portal-gestione #configCestinoPopup, token-only, brand-aware.
 * Aggiunge: ICONA header (trash) + tipografia titolo <h2> raw (la fondazione
 * stila .management-popup-title, non l'<h2> di questo popup) + residui dinamici
 * (bottoni .btn-compact / "Svuota" con red hardcoded inline, riga totali, riga
 * errore #dc2626) non coperti dal blocco esistente. */

/* --- header: flex per ospitare icona + titolo --- */
body.portal-gestione #configCestinoPopup .management-popup-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
/* la descrizione <p> torna a riga piena sotto titolo+icona */
body.portal-gestione #configCestinoPopup .management-popup-header p {
  flex-basis: 100%;
  margin: 2px 0 0 !important;
}

/* --- ICONA header (trash, lucide-style) brand-aware via mask --- */
body.portal-gestione #configCestinoPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 5 6 21 6'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><path d='M10 11v6'/><path d='M14 11v6'/><path d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 6 5 6 21 6'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><path d='M10 11v6'/><path d='M14 11v6'/><path d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/></svg>") center / contain no-repeat;
}

/* --- titolo <h2> raw: la fondazione stila .management-popup-title, non l'h2.
 *     Tipografia titolo card coerente (uppercase, display, ott-700). --- */
body.portal-gestione #configCestinoPopup .management-popup-header h2 {
  margin: 0 !important;
  font-family: var(--ff-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-13) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight);
  color: var(--ott-700) !important;
}

/* --- "↻ Aggiorna" (.btn.sec.btn-compact): la fondazione copre .btn.sec ma
 *     non la variante compatta (scoped altrove a #usersPopup) --- */
body.portal-gestione #configCestinoPopup .btn.btn-compact {
  height: 30px;
  padding: 0 12px !important;
  font-size: var(--fs-12-5) !important;
}

/* --- "🗑 Svuota" (.btn.cestino-empty-btn): markup JS con background:#dc2626
 *     inline → token red. .btn base (h36) gia' dalla fondazione; qui solo
 *     colore + sizing compatto coerente alla riga tabella. --- */
body.portal-gestione #configCestinoPopup .cestino-empty-btn {
  height: 28px;
  padding: 0 12px !important;
  background: var(--ott-red) !important;
  color: #fff !important;
  border: 1px solid var(--ott-red) !important;
  border-radius: var(--rd-r-6) !important;
  font-size: var(--fs-12) !important;
  font-weight: 600 !important;
}
body.portal-gestione #configCestinoPopup .cestino-empty-btn:hover {
  background: color-mix(in srgb, var(--ott-red) 88%, black) !important;
  border-color: color-mix(in srgb, var(--ott-red) 88%, black) !important;
}

/* --- riga totali tfoot: background:#f8fafc inline → token tenue --- */
body.portal-gestione #configCestinoPopup #cestinoStatsTable tfoot tr {
  background: var(--ott-50) !important;
}
body.portal-gestione #configCestinoPopup #cestinoStatsTable tfoot td {
  color: var(--ott-700) !important;
  border-top: 1px solid var(--ott-200) !important;
}

/* --- riga errore caricamento stats: color:#dc2626 inline → token red
 *     (il blocco esistente copre #94a3b8/#64748b ma non #dc2626) --- */
body.portal-gestione #configCestinoPopup #cestinoStatsTable [style*="color:#dc2626"],
body.portal-gestione #configCestinoPopup #cestinoStatsTable [style*="color: #dc2626"] {
  color: var(--ott-red) !important;
}
/* ===== Worker (#configWorkerPopup) ===== */
/* ==================== Worker (#configWorkerPopup) — refinement "esempio" ====================
 * Estende l'override brand gia' presente (icona header MANCANTE + residui layout).
 * NON ridefinisce la fondazione ne' i colori gia' coperti (h2/card/h3/save/warn).
 * Scope: body.portal-gestione #configWorkerPopup, token-only, brand-aware. */

/* header card → riga flessibile per ospitare l'icona accanto al titolo;
 * <h2> resta inline, il <p> descrizione va a capo su riga piena sotto. */
body.portal-gestione #configWorkerPopup .management-popup-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 9px;
  row-gap: 4px;
}
/* ICONA header (lucide "cpu" — worker/processo background), brand-aware via mask */
body.portal-gestione #configWorkerPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='9' y='9' width='6' height='6'/><path d='M15 2v2'/><path d='M15 20v2'/><path d='M2 15h2'/><path d='M2 9h2'/><path d='M20 15h2'/><path d='M20 9h2'/><path d='M9 2v2'/><path d='M9 20v2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='9' y='9' width='6' height='6'/><path d='M15 2v2'/><path d='M15 20v2'/><path d='M2 15h2'/><path d='M2 9h2'/><path d='M20 15h2'/><path d='M20 9h2'/><path d='M9 2v2'/><path d='M9 20v2'/></svg>") center / contain no-repeat;
}
/* la descrizione (<p>) scende su riga piena sotto icona+titolo */
body.portal-gestione #configWorkerPopup .management-popup-header p {
  flex-basis: 100%;
}

/* residuo: messaggio esito salvataggio (#workerSaveHint, nessun colore base) → secondario */
body.portal-gestione #configWorkerPopup #workerSaveHint {
  font-size: var(--fs-12) !important;
  color: var(--ott-500) !important;
}
/* ===== Preferenze (#preferenzePopup) ===== */
/* ==================== Preferenze (#preferenzePopup) — esempio refinement ==================== */
/* Rifinitura "esempio": aggiunge SOLO l'icona header (sliders/preferenze utente).
 * Il resto (header/title/close/section/label/select/save-btn/save-msg) e' gia'
 * coperto dal primo override per-sezione (righe 1661-1757) e NON va ridefinito.
 * Questo popup usa .gestione-compact (NON .gestione-inline-panel) → la fondazione
 * non lo tocca, quindi tutto e' scoped diretto a #preferenzePopup, token-only. */

/* Icona accanto al titolo: ::before come primo flex-child dell'header.
 * Il close button e' position:absolute (fuori flow) → flex-start sicuro, allinea
 * icona+titolo a sinistra senza disturbare la X. Glyph lucide "sliders-horizontal",
 * brand-aware: il colore reale viene da background-color (var(--ott-base)), la mask
 * usa stroke='black' = pieno opaco. */
body.portal-gestione #preferenzePopup .management-popup-header {
  justify-content: flex-start;
}
body.portal-gestione #preferenzePopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='21' y1='4' x2='14' y2='4'/><line x1='10' y1='4' x2='3' y2='4'/><line x1='21' y1='12' x2='12' y2='12'/><line x1='8' y1='12' x2='3' y2='12'/><line x1='21' y1='20' x2='16' y2='20'/><line x1='12' y1='20' x2='3' y2='20'/><line x1='14' y1='2' x2='14' y2='6'/><line x1='8' y1='10' x2='8' y2='14'/><line x1='16' y1='18' x2='16' y2='22'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='21' y1='4' x2='14' y2='4'/><line x1='10' y1='4' x2='3' y2='4'/><line x1='21' y1='12' x2='12' y2='12'/><line x1='8' y1='12' x2='3' y2='12'/><line x1='21' y1='20' x2='16' y2='20'/><line x1='12' y1='20' x2='3' y2='20'/><line x1='14' y1='2' x2='14' y2='6'/><line x1='8' y1='10' x2='8' y2='14'/><line x1='16' y1='18' x2='16' y2='22'/></svg>") center / contain no-repeat;
}
/* ===== Octopus (#configOctopusPopup) ===== */
/* ============================================================
 * Octopus (#configOctopusPopup) — rifinitura "esempio" ottanio
 * Token-only, scoped. La fondazione + il primo override per-sezione
 * (_redesign-impostazioni.css:1758-1820) gia' coprono: frame popup,
 * header/title, .section card, input/select/label/.btn, hint testo,
 * h3 sottotitoli, divisori, form strategia, btnRemoveCaptcha, accent
 * radio/checkbox. Qui si AGGIUNGE solo: (1) icona header, (2) residui
 * non ancora coperti (badge saldo CAPTCHA shape, span hint grigi
 * bespoke non listati). NON ridefinire la fondazione.
 * ============================================================ */

/* (1) ICONA HEADER — glyph lucide "database" (scraping Sister / catasto),
 * brand-aware via mask + background-color. Il markup non si tocca:
 * l'icona e' un ::before sul .management-popup-header reso flex. */
body.portal-gestione #configOctopusPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione #configOctopusPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><ellipse cx='12' cy='5' rx='9' ry='3'/><path d='M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5'/><path d='M3 12c0 1.66 4.03 3 9 3s9-1.34 9-3'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><ellipse cx='12' cy='5' rx='9' ry='3'/><path d='M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5'/><path d='M3 12c0 1.66 4.03 3 9 3s9-1.34 9-3'/></svg>") center / contain no-repeat;
}

/* (2a) Badge "Saldo CAPTCHA" — shape pill ottanio. Il background/color di
 * stato (positivo/avviso) e' impostato inline da octopus.js:9514-9515 con
 * hex hardcoded e NON e' affidabilmente intercettabile via CSS (inline vince
 * sul colore di stato); qui si normalizza solo cio' che JS non scrive:
 * forma pillola, padding, peso. Vedi notes per il follow-up JS. */
body.portal-gestione #configOctopusPopup #captchaBalanceBadge {
  padding: 2px 9px !important;
  border-radius: var(--rd-r-pill) !important;
  font-family: var(--ff-body);
  font-weight: 600;
  letter-spacing: var(--ls-caps-tight);
}

/* (2b) Span hint bespoke con grigio hardcoded NON listati nel primo override
 * (es. la nota "Tentativi logout/login..." accanto a octTransientMaxRetries,
 * index.html:5189) → testo secondario ottanio. Gli inline color statici
 * sono battuti con !important; i color di STATO settati da JS (success/error)
 * restano gestiti da JS (vedi notes). */
body.portal-gestione #configOctopusPopup span[style*="color:#6b7280"],
body.portal-gestione #configOctopusPopup span[style*="color: #6b7280"] {
  color: var(--ott-500) !important;
}
/* ===== Lynx (#configLynxPopup) ===== */
/* ==================== Lynx (#configLynxPopup) — esempio refinement ==================== */
/* Aggiunge l'icona header (cpu = AI catasto) + rifinisce i residui NON gia'
 * coperti: input/select/textarea inline-styled dentro .section (la fondazione
 * stila SOLO .gestione-inline-panel, NON .section → questi residui restano)
 * + divisore strip tab + lista pricing dinamica. Token-only, !important per
 * battere gli style inline. NON ridefinisce mini-buttons/tab/badge/card OpenAI
 * (gia' coperti dal blocco per-sezione esistente). */

/* --- ICONA HEADER (cpu, brand-aware mask) --- */
body.portal-gestione #configLynxPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.portal-gestione #configLynxPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='9' y='9' width='6' height='6'/><path d='M9 1v3'/><path d='M15 1v3'/><path d='M9 20v3'/><path d='M15 20v3'/><path d='M20 9h3'/><path d='M20 14h3'/><path d='M1 9h3'/><path d='M1 14h3'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='9' y='9' width='6' height='6'/><path d='M9 1v3'/><path d='M15 1v3'/><path d='M9 20v3'/><path d='M15 20v3'/><path d='M20 9h3'/><path d='M20 14h3'/><path d='M1 9h3'/><path d='M1 14h3'/></svg>") center / contain no-repeat;
}

/* --- input/select/textarea inline-styled in .section (border #d1d5db / radius 4-6px)
 *     la fondazione li manca: scoped a .section per non toccare la card --- */
body.portal-gestione #configLynxPopup .section input[type="text"],
body.portal-gestione #configLynxPopup .section input[type="password"],
body.portal-gestione #configLynxPopup .section input[type="number"],
body.portal-gestione #configLynxPopup .section select,
body.portal-gestione #configLynxPopup .section textarea {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-7) !important;
  background: #fff !important;
  color: var(--ink) !important;
  font-family: var(--ff-body) !important;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
body.portal-gestione #configLynxPopup .section textarea {
  font-family: var(--ff-mono) !important;
}
body.portal-gestione #configLynxPopup .section input::placeholder,
body.portal-gestione #configLynxPopup .section textarea::placeholder {
  color: var(--ott-300) !important;
}
body.portal-gestione #configLynxPopup .section input[type="text"]:focus,
body.portal-gestione #configLynxPopup .section input[type="password"]:focus,
body.portal-gestione #configLynxPopup .section input[type="number"]:focus,
body.portal-gestione #configLynxPopup .section select:focus,
body.portal-gestione #configLynxPopup .section textarea:focus {
  border-color: var(--ott-base) !important;
  box-shadow: var(--rd-focus-ring) !important;
}

/* --- strip divisore tab prompt (border-bottom:2px solid #e5e7eb inline) --- */
body.portal-gestione #configLynxPopup div[style*="border-bottom:2px solid #e5e7eb"] {
  border-bottom-color: var(--ott-200) !important;
}

/* --- lista pricing render dinamico (#lynxPricingList): righe/divisori/valori
 *     defensivo, mappa neutri ai token senza assumere la struttura interna --- */
body.portal-gestione #configLynxPopup #lynxPricingList {
  color: var(--ott-500);
}
body.portal-gestione #configLynxPopup #lynxPricingList > * {
  border-color: var(--ott-200) !important;
}
/* ===== Monitoraggio (#monitoraggioPopup) ===== */
/* ==================== Monitoraggio (#monitoraggioPopup) — header icon (esempio) ==================== */
/* Icona "activity" (lucide) accanto al titolo, brand-aware via mask + background-color.
 * La fondazione .management-popup-header non imposta flex: lo definiamo qui (scoped)
 * per allineare glyph::before + .management-popup-title sulla stessa riga.
 * NON ridefinisce bg/border/padding header (gia' fondazione). I residui colore
 * (pills, KPI, chart, filtri, log table, pagination) sono gia' coperti dal blocco
 * brand 1918-2055 di questo file: nulla da riallineare. */
body.portal-gestione #monitoraggioPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione #monitoraggioPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-4l-3 9L9 3l-3 9H2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12h-4l-3 9L9 3l-3 9H2'/></svg>") center / contain no-repeat;
}
/* ===== Defaults Catasto (#defaultsCatastoPopup) ===== */
/* ============================================================
   Defaults Catasto — rifinitura ottanio (scoped, token-only)
   Popup #defaultsCatastoPopup. NON ridefinisce la fondazione.
   ============================================================ */

/* --- Icona header (lucide "map", brand-aware via mask) --- */
body.portal-gestione #defaultsCatastoPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
body.portal-gestione #defaultsCatastoPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6'/><line x1='8' y1='2' x2='8' y2='18'/><line x1='16' y1='6' x2='16' y2='22'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6'/><line x1='8' y1='2' x2='8' y2='18'/><line x1='16' y1='6' x2='16' y2='22'/></svg>") center / contain no-repeat;
}

/* Titolo: questa sezione usa <h2> (non .management-popup-title) -> allineo al look ottanio */
body.portal-gestione #defaultsCatastoPopup .management-popup-header h2 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: var(--fs-14, 14px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  color: var(--ott-700);
}
/* sottotitolo (inline color:#6b7280) -> neutro ottanio */
body.portal-gestione #defaultsCatastoPopup .management-popup-header p {
  width: 100%;
  color: var(--ott-500) !important;
}

/* --- Tab nav interna (.dc-tabs-nav, definita in <style> inline del popup) --- */
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav {
  border-bottom-color: var(--ott-200);
}
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav button {
  color: var(--ott-500);
  font-family: var(--ff-body);
  transition: color var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav button:hover {
  color: var(--ott-700);
}
/* active era #890103 (vecchio rosso brand) -> accento ottanio */
body.portal-gestione #defaultsCatastoPopup .dc-tabs-nav button.active {
  color: var(--ott-base);
  border-bottom-color: var(--ott-base);
}

/* --- Separatori <hr> inline (border-top #e5e7eb) --- */
body.portal-gestione #defaultsCatastoPopup hr {
  border-top-color: var(--ott-200) !important;
}

/* --- Titoli di gruppo <h3>/<h4> e label inline (#374151) --- */
body.portal-gestione #defaultsCatastoPopup h3,
body.portal-gestione #defaultsCatastoPopup .dc-tab-panel > h4 {
  color: var(--ott-700) !important;
}
body.portal-gestione #defaultsCatastoPopup label {
  color: var(--ott-700) !important;
}
/* hint/descrizioni inline (#6b7280) -> secondario */
body.portal-gestione #defaultsCatastoPopup label + div[style*="color"],
body.portal-gestione #defaultsCatastoPopup .dc-tab-panel > p {
  color: var(--ott-500) !important;
}

/* --- Card dataset (.dc-dataset-card) --- */
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card {
  border-color: var(--ott-200);
  border-radius: var(--rd-r-7);
  background: var(--ott-50);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card h4 {
  color: var(--ott-700);
  font-family: var(--ff-display);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card label {
  color: var(--ott-700) !important;
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card p {
  color: var(--ott-500) !important;
}

/* btn-upload era #890103 -> CTA ottanio */
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .btn-upload {
  background: var(--ott-base);
  border-radius: var(--rd-r-6);
  font-family: var(--ff-body);
  transition: background var(--t-fast);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .btn-upload:hover:not(:disabled) {
  background: var(--ott-soft);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .btn-upload:disabled {
  background: var(--ott-300);
  color: #fff;
}

/* status ok/err inline (#16a34a / #dc2626) -> semantici */
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .status.ok {
  color: var(--ott-green);
}
body.portal-gestione #defaultsCatastoPopup .dc-dataset-card .status.err {
  color: var(--ott-error);
}

/* --- Tabella storico upload (.dc-history-table) --- */
body.portal-gestione #defaultsCatastoPopup .dc-history-table th {
  background: var(--ott-50);
  color: var(--ott-500);
  font-family: var(--ff-display);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
  font-size: var(--fs-10-5, 10.5px);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table td {
  border-bottom-color: var(--ott-100);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table tr.status-failed td {
  color: var(--ott-error);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table tr.status-running td {
  color: var(--ott-warn);
}

/* dataset badge (chip colorati hardcoded) -> chip neutro/semantico ottanio */
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-badge {
  border-radius: var(--rd-r-5, 5px);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight, 0.02em);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-OMI,
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-OMI_KML {
  background: color-mix(in srgb, var(--ott-base) 14%, white);
  color: var(--ott-deep);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-NTN_COM {
  background: var(--ott-green-bg);
  color: var(--ott-green);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-NTN_CAP {
  background: var(--ott-warn-bg);
  color: var(--ott-warn);
}
body.portal-gestione #defaultsCatastoPopup .dc-history-table .dataset-NTN {
  background: var(--ott-100);
  color: var(--ott-700);
}

/* riga "nessun upload" (#9ca3af inline) -> neutro */
body.portal-gestione #defaultsCatastoPopup .dc-history-table tbody td[colspan] {
  color: var(--ott-500) !important;
}

/* --- Layer AdE: allineamento valore range (.dcOp*Val span) -> mono leggibile --- */
body.portal-gestione #defaultsCatastoPopup .dc-tab-panel span[id^="dcOp"][id$="Val"] {
  font-family: var(--ff-mono);
  color: var(--ott-700);
}
/* ===== Branding (#brandingPopup) ===== */
/* ============================================================
   BRANDING (#brandingPopup) — rifinitura ottanio scoped, token-only.
   Fondazione (_redesign-impostazioni.css) NON ridefinita: card frame,
   header bg/border, title, .section, input/select/textarea, label, .btn.
   Qui: icona header (droplet) + residui bespoke con hex inline.
   ============================================================ */

/* --- ICONA HEADER: droplet (branding/colore) brand-aware via mask --- */
body.portal-gestione #brandingPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}
body.portal-gestione #brandingPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z'/></svg>") center / contain no-repeat;
}

/* --- TAB SWITCHER MapControl/DeskControl (.mon-filter-btn bespoke) ---
   Sono i due tab di scelta portale: pill ottanio coerente con .management-tab. */
body.portal-gestione #brandingPopup #brandTabMc,
body.portal-gestione #brandingPopup #brandTabDc {
  border: 1px solid var(--ott-200) !important;
  background: var(--paper, #fff) !important;
  color: var(--ott-700) !important;
  border-radius: var(--rd-r-pill) !important;
  padding: 5px 14px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-12, 12px) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #brandingPopup #brandTabMc:hover,
body.portal-gestione #brandingPopup #brandTabDc:hover {
  background: var(--ott-50) !important;
  border-color: var(--ott-300) !important;
}
body.portal-gestione #brandingPopup #brandTabMc.active,
body.portal-gestione #brandingPopup #brandTabDc.active {
  background: var(--ott-base) !important;
  border-color: var(--ott-base) !important;
  color: #fff !important;
}
body.portal-gestione #brandingPopup #brandTabMc:focus-visible,
body.portal-gestione #brandingPopup #brandTabDc:focus-visible {
  outline: none;
  box-shadow: var(--rd-focus-ring);
}

/* --- SAVE BUTTONS (.mon-filter-btn) → CTA primaria ottanio --- */
body.portal-gestione #brandingPopup #brandMcSaveBtn,
body.portal-gestione #brandingPopup #brandDcSaveBtn {
  border: 1px solid var(--ott-base) !important;
  background: var(--ott-base) !important;
  color: #fff !important;
  border-radius: var(--rd-r-7) !important;
  padding: 7px 16px !important;
  font-family: var(--ff-body) !important;
  font-size: var(--fs-12-5, 12.5px) !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #brandingPopup #brandMcSaveBtn:hover,
body.portal-gestione #brandingPopup #brandDcSaveBtn:hover {
  background: var(--ott-deep) !important;
  border-color: var(--ott-deep) !important;
}
body.portal-gestione #brandingPopup #brandMcSaveBtn:focus-visible,
body.portal-gestione #brandingPopup #brandDcSaveBtn:focus-visible {
  outline: none;
  box-shadow: var(--rd-focus-ring);
}

/* --- SAVE MESSAGE: inline color:#090 hardcoded → semantico green --- */
body.portal-gestione #brandingPopup #brandMcSaveMsg,
body.portal-gestione #brandingPopup #brandDcSaveMsg {
  color: var(--ott-green) !important;
  font-weight: 600;
}

/* --- SECTION DIVIDER (tab bar) e label di sezione PALETTE ---
   Header sezione tab usa border-bottom var(--brand-border,#e2e8f0): riallineo
   al grigio ottanio per coerenza separatori. */
body.portal-gestione #brandingPopup > .section[style*="border-bottom"] {
  border-bottom-color: var(--ott-200) !important;
}
/* Titoletti "PALETTE (6 ruoli funzionali)": caps ottanio. */
body.portal-gestione #brandingPopup #brandPaneMc > div[style*="font-weight:600"],
body.portal-gestione #brandingPopup #brandPaneDc > div[style*="font-weight:600"] {
  color: var(--ott-700) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-tight);
  font-size: var(--fs-10-5, 10.5px) !important;
}

/* --- COLOR PICKER PAIRS: input[type=color] border #ccc hardcoded inline,
   input HEX font-mono → token grigio + radius coerente.
   Lo swatch del color picker resta il colore scelto (è il dato). --- */
body.portal-gestione #brandingPopup #brandPaneMc input[type="color"],
body.portal-gestione #brandingPopup #brandPaneDc input[type="color"] {
  border: 1px solid var(--ott-200) !important;
  border-radius: var(--rd-r-6, 6px) !important;
}
body.portal-gestione #brandingPopup #brandPaneMc input[type="text"][id$="Hex"],
body.portal-gestione #brandingPopup #brandPaneDc input[type="text"][id$="Hex"] {
  font-family: var(--ff-mono) !important;
}

/* --- <details> summary (MapProxy branding) brand-aware → grigio ottanio --- */
body.portal-gestione #brandingPopup #brandPaneMc > details > summary,
body.portal-gestione #brandingPopup #brandPaneDc > details > summary {
  color: var(--ott-700) !important;
  font-family: var(--ff-body);
}

/* --- MAPPROXY SLIDERS (DOM dinamico da deskcontrol-portal.js):
   nested <details> border #e2e8f0, pan/reset buttons border #cbd5e1 bg #f8fafc.
   Scope ai container #brand*MapproxyContainer per non toccare altro. --- */
body.portal-gestione #brandingPopup [id$="MapproxyContainer"] > details {
  border-color: var(--ott-200) !important;
  border-radius: var(--rd-r-6, 6px) !important;
}
body.portal-gestione #brandingPopup [id$="MapproxyContainer"] summary {
  color: var(--ott-700) !important;
}
body.portal-gestione #brandingPopup [id$="MapproxyContainer"] button[data-brand-mapproxy-pan],
body.portal-gestione #brandingPopup [id$="MapproxyContainer"] button.brand-mapproxy-reset {
  border: 1px solid var(--ott-200) !important;
  background: var(--ott-50) !important;
  color: var(--ott-700) !important;
  border-radius: var(--rd-r-5, 5px) !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #brandingPopup [id$="MapproxyContainer"] button[data-brand-mapproxy-pan]:hover,
body.portal-gestione #brandingPopup [id$="MapproxyContainer"] button.brand-mapproxy-reset:hover {
  background: var(--ott-100) !important;
  border-color: var(--ott-300) !important;
}
/* ===== Email (#configEmailPopup) ===== */
body.portal-gestione #configEmailPopup .management-popup-header::before {
  content: ""; flex-shrink: 0; width: 18px; height: 18px; background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='4' width='20' height='16' rx='2'/><path d='m22 7-10 5L2 7'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='4' width='20' height='16' rx='2'/><path d='m22 7-10 5L2 7'/></svg>") center / contain no-repeat;
}
/* ===== Assistente AI (#configChatPopup) ===== */
/* ==================== Assistente AI (#configChatPopup) — esempio refinement (icona header + residui) ==================== */

/* header: layout flex per ospitare l'icona ::before allineata al titolo.
   La fondazione (.gestione-inline-panel) NON si applica: popup .gestione-compact.
   bg/border già coperti dal blocco per-sezione esistente — qui solo il layout. */
body.portal-gestione #configChatPopup .management-popup-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* ICONA HEADER — glyph "bot" lucide-style, brand-aware via mask + background-color */
body.portal-gestione #configChatPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 8V4H8'/><rect width='16' height='12' x='4' y='8' rx='2'/><path d='M2 14h2'/><path d='M20 14h2'/><path d='M15 13v2'/><path d='M9 13v2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 8V4H8'/><rect width='16' height='12' x='4' y='8' rx='2'/><path d='M2 14h2'/><path d='M20 14h2'/><path d='M15 13v2'/><path d='M9 13v2'/></svg>") center / contain no-repeat;
}

/* RESIDUO: paragrafo introduttivo (.gestione-panel-hint inline) — NON coperto
   dalla fondazione (scoped a .gestione-inline-panel) né dal blocco per-sezione.
   Inline non imposta color → eredita; allineo al token hint ottanio. */
body.portal-gestione #configChatPopup .gestione-panel-hint {
  color: var(--ott-500) !important;
  font-size: var(--fs-12) !important;
  line-height: 1.5;
}

/* RESIDUO: titolo gruppo "Consumi Assistente AI" (inline #374151) — non coperto */
body.portal-gestione #configChatPopup #chatCostSummary ~ * span,
body.portal-gestione #configChatPopup [style*="border-top"] > div > span:first-child {
  color: var(--ott-700) !important;
  font-family: var(--ff-display) !important;
}

/* RESIDUO: separatore "—" tra i due date input consumi (inline #9ca3af) */
body.portal-gestione #configChatPopup #chatCostDateFrom + span {
  color: var(--ott-300) !important;
}
/* ===== Prompt descrizioni (#configPromptPopup) ===== */
/* ==================== Prompt descrizioni (#configPromptPopup) — icona header + rifinitura ==================== */
/* La fondazione copre frame/header bg/title/.section/input/select/textarea/.btn/hint.
   Un blocco override per-sezione gia' mappa i bespoke (box modello AI, tab Zona/Edificio,
   divider, bottone "Nuovo", monospace, testi secondari).
   Qui si aggiunge SOLO l'icona header (pattern "esempio") con un residuo di layout. */

/* Icona header (lucide file-text) — glyph brand-aware via mask, nessun markup nuovo.
   Il close button e' sibling della header (non figlio), quindi l'unico flex child
   e' il titolo: forzo flex-start + gap perche' lo space-between di base non separi
   icona e testo. */
body.portal-gestione #configPromptPopup .management-popup-header {
  justify-content: flex-start;
  gap: 9px;
}
body.portal-gestione #configPromptPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14 2 14 8 20 8'/><line x1='16' y1='13' x2='8' y2='13'/><line x1='16' y1='17' x2='8' y2='17'/><polyline points='10 9 9 9 8 9'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14 2 14 8 20 8'/><line x1='16' y1='13' x2='8' y2='13'/><line x1='16' y1='17' x2='8' y2='17'/><polyline points='10 9 9 9 8 9'/></svg>") center / contain no-repeat;
}
/* ===== Export demo (descrizioni AI) (#exportDemoPopup) ===== */
/* ==================== Export demo (#exportDemoPopup) — icona header "esempio" ====================
   La fondazione copre frame/header/title/.section/input/select/.btn/hint, e il
   blocco per-sezione esistente (_redesign-impostazioni.css:2556) gia' mappa greys,
   divider, checkbox accent e label. Qui aggiungo SOLO l'icona header (download),
   come da pattern "esempio" delle altre sezioni. Token-only, brand-aware via mask.
   Il .management-popup-header e' gia' flex/align-center/gap:8px (perizie.css:146),
   quindi il glyph si dispone inline a sinistra del titolo senza toccare il markup. */
body.portal-gestione #exportDemoPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/><polyline points='7 10 12 15 17 10'/><line x1='12' y1='15' x2='12' y2='3'/></svg>") center / contain no-repeat;
}
/* ===== VM (#configVmPopup) ===== */
/* ==================== VM (#configVmPopup) — overrides-added ==================== */
/* === Metriche VM (#configVmPopup) — override scoped, token-only ===
 * Il popup riceve .gestione-inline-panel a runtime (deskcontrol-portal.js:1419)
 * quindi frame/header/title sono gia' coperti dalla fondazione. Il CORPO del
 * popup e' pero' interamente bespoke (HTML inline costruito in _ensureVmPopup /
 * _loadVmMetrics / _vmCard / _vmCardWide): card metriche, bottone Aggiorna e
 * tabella container hanno hex hardcoded inline. Qui si riallinea SOLO quello.
 * !important mirato a battere lo style inline generato dal JS. */

/* 1. ICONA HEADER — glyph "server" (metriche VM), brand-aware via mask */
body.portal-gestione #configVmPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-right: 9px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='2' width='20' height='8' rx='2' ry='2'/><rect x='2' y='14' width='20' height='8' rx='2' ry='2'/><line x1='6' y1='6' x2='6.01' y2='6'/><line x1='6' y1='18' x2='6.01' y2='18'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='2' width='20' height='8' rx='2' ry='2'/><rect x='2' y='14' width='20' height='8' rx='2' ry='2'/><line x1='6' y1='6' x2='6.01' y2='6'/><line x1='6' y1='18' x2='6.01' y2='18'/></svg>") center / contain no-repeat;
}
/* l'header e' flex (markup .management-popup-header): assicura allineamento icona+titolo */
body.portal-gestione #configVmPopup .management-popup-header {
  display: flex;
  align-items: center;
}

/* 2. placeholder/errore "Caricamento..." (#64748b / #dc2626 inline) -> token */
body.portal-gestione #configVmPopup #vmMetricsContent > div[style*="#64748b"] {
  color: var(--ott-500) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="#dc2626"] {
  color: var(--ott-red) !important;
}

/* 3. bottone "Aggiorna": gia' brand (var(--brand-base)) ma radius/hover hardcoded
 *    -> allineo a CTA primaria della fondazione (h36, rd-r-8, hover ott-soft) */
body.portal-gestione #configVmPopup #btnVmRefresh {
  background: var(--ott-base) !important;
  color: #fff !important;
  border: 1px solid var(--ott-base) !important;
  border-radius: var(--rd-r-8) !important;
  font-size: var(--fs-13) !important;
  transition: background var(--t-fast), border-color var(--t-fast);
}
body.portal-gestione #configVmPopup #btnVmRefresh:hover {
  background: var(--ott-soft) !important;
  border-color: var(--ott-soft) !important;
}

/* 4. card metriche CPU/RAM/Disco/Uptime (_vmCard / _vmCardWide):
 *    border #e2e8f0 + radius 12px hardcoded -> token */
body.portal-gestione #configVmPopup #vmMetricsContent [style*="#e2e8f0"] {
  border-color: var(--ott-200) !important;
  border-radius: var(--rd-r-12) !important;
}
/* label card (font-size:11px; color:#64748b uppercase) -> secondario ottanio */
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="11px"][style*="#64748b"] {
  color: var(--ott-500) !important;
  letter-spacing: var(--ls-caps-wide) !important;
}
/* detail card (#94a3b8 inline) -> testo tenue ott-300 */
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="#94a3b8"] {
  color: var(--ott-300) !important;
}

/* 5. VALORI METRICHE — colori soglia hardcoded in JS mappati ai token semantici.
 *    verde #22c55e -> ott-green | ambra #f59e0b -> ott-warn | rosso #dc2626 -> ott-red.
 *    uptime indaco #6366f1 -> brand (dato chiave neutro). Il valore e' lo span
 *    font-size:32px font-weight:800 con color inline; targetizzo via substring. */
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="32px"][style*="#22c55e"] {
  color: var(--ott-green) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="32px"][style*="#f59e0b"] {
  color: var(--ott-warn) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="32px"][style*="#dc2626"] {
  color: var(--ott-red) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="32px"][style*="#6366f1"] {
  color: var(--ott-base) !important;
}

/* 6. TABELLA CONTAINER — look .simple-table (header ott-50/ott-500 caps, td ott-100) */
/* titolo "Container attivi" (uppercase #64748b inline) */
body.portal-gestione #configVmPopup #vmMetricsContent div[style*="uppercase"][style*="#64748b"] {
  color: var(--ott-500) !important;
  letter-spacing: var(--ls-caps-wide) !important;
}
/* riga intestazione tabella: border-bottom 2px #e2e8f0 -> divisore ott-200 */
body.portal-gestione #configVmPopup #vmMetricsContent table thead tr[style*="#e2e8f0"] {
  border-bottom: 1px solid var(--ott-200) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent table th {
  background: var(--ott-50) !important;
  color: var(--ott-500) !important;
  font-family: var(--ff-body) !important;
  font-weight: 600 !important;
  font-size: var(--fs-11) !important;
  text-transform: uppercase;
  letter-spacing: var(--ls-caps-wide);
}
/* righe corpo: border-bottom 1px #f1f5f9 -> ott-100 */
body.portal-gestione #configVmPopup #vmMetricsContent table tbody tr[style*="#f1f5f9"] {
  border-bottom: 1px solid var(--ott-100) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent table tbody td {
  color: var(--ink) !important;
}
/* stato container: Up (#22c55e) -> verde, down (#dc2626) -> rosso */
body.portal-gestione #configVmPopup #vmMetricsContent table tbody td[style*="#22c55e"] {
  color: var(--ott-green) !important;
}
body.portal-gestione #configVmPopup #vmMetricsContent table tbody td[style*="#dc2626"] {
  color: var(--ott-red) !important;
}
/* ===== Boost (#configBoostPopup) ===== */
/* ==================== Boost (#configBoostPopup) — rifinitura "esempio": icona header + residui ==================== */

/* Icona header (zap / boost parallelo) — lucide-style, brand-aware via mask.
   La fondazione rende .management-popup-header un flex row align-items:center gap:8px,
   quindi il ::before si posiziona inline prima del titolo. */
body.portal-gestione #configBoostPopup .management-popup-header::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/></svg>") center / contain no-repeat;
}

/* Residuo: label "Worker con credenziali personali" — inline ha letter-spacing:.5px e font piccolo
   bespoke. La fondazione/override-1 mappa solo il colore; normalizzo caps spacing + display font
   per allineare alle caps del sistema (come i th della tabella worker). */
body.portal-gestione #configBoostPopup #boostConfigContent div[style*="text-transform:uppercase"][style*="64748b"] {
  font-family: var(--ff-display) !important;
  letter-spacing: var(--ls-caps-wide) !important;
}

/* Residuo: messaggio di salvataggio (#boostSaveMsg) — colori applicati inline via JS a runtime
   (#6b7280 wip / #15803d ok / #dc2626 errore). Mappo agli stati semantici brand-aware. */
body.portal-gestione #configBoostPopup #boostSaveMsg[style*="6b7280"] {
  color: var(--ott-500) !important;
}
body.portal-gestione #configBoostPopup #boostSaveMsg[style*="15803d"] {
  color: var(--ott-green) !important;
}
body.portal-gestione #configBoostPopup #boostSaveMsg[style*="dc2626"] {
  color: var(--ott-error) !important;
}


/* ===== Contatore costi AI — Export demo (#exportDemoPopup) ===== */
body.portal-gestione #exportDemoPopup .imp-aiusage {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--ott-200);
  border-radius: var(--rd-r-pill);
  background: var(--ott-50);
  font-size: var(--fs-11-5);
  color: var(--ott-700);
  white-space: nowrap;
}
body.portal-gestione #exportDemoPopup .imp-aiusage__ic {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background-color: var(--ott-base);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8'/><path d='M12 6v2'/><path d='M12 16v2'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8'/><path d='M12 6v2'/><path d='M12 16v2'/></svg>") center / contain no-repeat;
}
body.portal-gestione #exportDemoPopup .imp-aiusage__val {
  font-family: var(--ff-mono);
  font-weight: 700;
  color: var(--ott-base);
}
body.portal-gestione #exportDemoPopup .imp-aiusage__sub {
  color: var(--ott-500);
}
