/* Tema grafico dell'applicazione Universal Bet.
   Si sovrappone allo stile dell'app (Ant Design) senza toccarne la logica.
   Per tornare allo stile originale basta togliere da index.html le righe che caricano tema.css e tema.js. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/vendor/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("/vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --brand-dark: #0b2c4d;
  --brand-primary: #e9af31;
  --bg-soft: #f1f4f9;
  --text-on-dark: #ffffff;
  --ub-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ub-ink: #0f1b2d; --ub-muted: #5d6c80; --ub-faint: #94a3b8;
  --ub-border: #e4e9f0; --ub-border-strong: #d2dae5; --ub-surface-2: #f6f8fb;
  --ub-navy: #0b2c4d; --ub-navy-2: #123a63; --ub-gold: #e9af31;
  --ub-ok: #12805c; --ub-ok-bg: #e5f6ef; --ub-err: #c0352b; --ub-err-bg: #fdecea; --ub-warn: #a15c00; --ub-warn-bg: #fff3dc; --ub-info: #2f6fb0; --ub-info-bg: #e8f1fb;
  --ub-ring: 0 0 0 3px rgba(47, 111, 176, .24);
  --ub-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 28px rgba(15, 27, 45, .07);
  --ub-shadow-lg: 0 18px 60px rgba(11, 28, 48, .22);
}

/* ---------- base ---------- */
html, body, button, input, select, textarea, optgroup,
body .ant-app, body [class^="ant-"], body [class*=" ant-"] { font-family: var(--ub-font) !important; }
body { background: var(--bg-soft) !important; color: var(--ub-ink); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "calt", "kern"; }
body ::selection { background: rgba(233, 175, 49, .32); }
body .ant-table-cell, body .ant-statistic-content, body .ant-input-number-input, body input[type="number"], body .ant-descriptions-item-content { font-variant-numeric: tabular-nums; }
body h1, body h2, body h3, body h4, body h5 { letter-spacing: -.012em; color: var(--ub-ink); }
body a { transition: color .15s; }
* { scrollbar-width: thin; scrollbar-color: #c3cddb transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #c3cddb; border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #a7b4c6; background-clip: content-box; border: 2px solid transparent; }

/* ---------- struttura: barra laterale, testata, contenuto ---------- */
body .ant-layout { background: transparent !important; }
body .ant-layout-sider { background: linear-gradient(180deg, #0a2440 0%, #0b2c4d 52%, #0a2742 100%) !important; box-shadow: 6px 0 30px rgba(11, 44, 77, .18); z-index: 20; }
body .ant-layout-sider .ant-layout-sider-children { display: flex; flex-direction: column; }
@media (min-width: 992px) {
  body .ant-layout-sider:not(.ant-layout-sider-collapsed) { flex: 0 0 232px !important; max-width: 232px !important; min-width: 232px !important; width: 232px !important; }
}
body .ant-menu-dark, body .ant-menu-dark .ant-menu-sub, body .ant-menu.ant-menu-dark { background: transparent !important; }
body .ant-menu-dark.ant-menu-root { padding: 14px 0 22px; border-inline-end: 0 !important; }
body .ant-menu-dark .ant-menu-item, body .ant-menu-dark .ant-menu-submenu-title {
  height: 40px !important; line-height: 40px !important; margin: 2px 10px !important; width: calc(100% - 20px) !important; border-radius: 11px !important;
  color: rgba(255, 255, 255, .72) !important; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s;
}
body .ant-menu-dark .ant-menu-item:hover, body .ant-menu-dark .ant-menu-submenu-title:hover { background: rgba(255, 255, 255, .08) !important; color: #fff !important; }
body .ant-menu-dark .ant-menu-item-selected, body .ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected {
  background: linear-gradient(90deg, rgba(233, 175, 49, .24), rgba(233, 175, 49, .08)) !important; color: #ffd57f !important; font-weight: 650; box-shadow: inset 3px 0 0 var(--ub-gold);
}
body .ant-menu-dark .ant-menu-submenu-selected > .ant-menu-submenu-title { color: #ffd57f !important; }
body .ant-menu-dark .ant-menu-submenu-open > .ant-menu-submenu-title { background: rgba(255, 255, 255, .06) !important; color: #fff !important; }
body .ant-menu-dark .ant-menu-sub.ant-menu-inline { background: transparent !important; padding: 2px 0 6px 12px; }
body .ant-menu-dark .ant-menu-sub .ant-menu-item { height: 34px !important; line-height: 34px !important; font-size: 13px; padding-left: 20px !important; margin: 1px 10px 1px 8px !important; }
body .ant-menu-dark .ant-menu-submenu-arrow { color: rgba(255, 255, 255, .5); }
body .ant-menu-dark.ant-menu-root > .ant-menu-submenu:not(.ant-menu-submenu ~ .ant-menu-submenu)::before { content: "Agenzie"; display: block; margin: 18px 22px 8px; font-size: 10.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .38); line-height: 1.2; }
body .ant-menu-dark.ant-menu-root > .ant-menu-submenu:not(.ant-menu-submenu ~ .ant-menu-submenu) { overflow: visible; }

body .ant-layout-header {
  height: 60px !important; line-height: 60px !important; padding: 0 22px !important; position: relative; z-index: 15;
  background: linear-gradient(115deg, #0b2c4d 0%, #123a63 52%, #0b2c4d 100%) !important; box-shadow: 0 6px 24px rgba(11, 44, 77, .20);
}
body .ant-layout-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--ub-gold) 0, var(--ub-gold) 96px, rgba(233, 175, 49, 0) 97px); }
body .ant-layout-header, body .ant-layout-header a, body .ant-layout-header .ant-typography { color: rgba(255, 255, 255, .92); }
body .ant-layout-header .ant-btn { height: 32px; padding: 0 14px; border-radius: 999px !important; font-size: 12.5px; font-weight: 600; box-shadow: none !important; }
body .ant-layout-header .ant-btn-primary { background: linear-gradient(180deg, #f4c75d, #e9af31) !important; color: #1b2433 !important; border: 0 !important; }
body .ant-layout-header .ant-btn-default { background: rgba(255, 255, 255, .12) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .24) !important; }
body .ant-layout-header .ant-btn-default:hover { background: rgba(255, 255, 255, .22) !important; }
body .ant-layout-header .ant-btn-link { color: rgba(255, 255, 255, .86) !important; font-size: 12.5px; padding: 0 10px; }
body .ant-layout-header .ant-btn-link:hover { color: #fff !important; }
body .ant-layout-header .ant-dropdown-trigger { font-weight: 600; letter-spacing: -.005em; white-space: nowrap; }
body .ant-layout-header .ant-typography { white-space: nowrap; }
body .ant-layout-header .ant-avatar { background: rgba(255, 255, 255, .14) !important; border: 1px solid rgba(255, 255, 255, .24); }

body .main-content { padding: 26px 30px 40px !important; background: transparent !important; }
body .content-card {
  background: #fff !important; border-radius: 20px !important; border: 1px solid var(--ub-border); box-shadow: var(--ub-shadow) !important; padding: 26px 28px !important;
}
body .main-content > .content-card { animation: ubRise .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes ubRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- pulsanti ---------- */
body .ant-btn { border-radius: 11px; font-weight: 600; letter-spacing: -.003em; box-shadow: none !important; transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s; }
body .ant-btn:not(.ant-btn-sm):not(.ant-btn-lg) { height: 36px; padding: 0 16px; font-size: 13.5px; }
body .ant-btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; gap: 5px; }
body .ant-table-cell .ant-btn-sm { height: 28px; padding: 0 9px; }
body .ant-table-cell .ant-space, body .ant-table-cell .ant-flex { gap: 6px !important; }
body .ant-btn-lg { height: 44px; border-radius: 13px; }
body .ant-btn:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(15, 27, 45, .10) !important; }
body .ant-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none !important; }
body .ant-btn:focus-visible { outline: none; box-shadow: var(--ub-ring) !important; }
body .ant-btn-default, body .ant-btn-default.ant-btn-variant-outlined { background: #fff; border-color: var(--ub-border-strong); color: var(--ub-ink); }
body .ant-btn-default:hover:not(:disabled) { border-color: #8da0b8; color: var(--ub-navy); background: #fff; }
body .ant-btn-primary:not(.ant-btn-dangerous) { background: var(--ub-navy); border-color: var(--ub-navy); color: #fff; }
body .ant-btn-primary:not(.ant-btn-dangerous):hover:not(:disabled) { background: var(--ub-navy-2) !important; border-color: var(--ub-navy-2) !important; color: #fff !important; }
body .ant-btn.ub-cta { background: linear-gradient(180deg, #f4c75d, #e9af31) !important; border-color: #d99c1a !important; color: #1b2433 !important; }
body .ant-btn.ub-cta:hover:not(:disabled) { background: linear-gradient(180deg, #f6cd6c, #ecb23a) !important; border-color: #c98f12 !important; color: #1b2433 !important; }
body .ant-btn.ub-danger, body .ant-btn-dangerous { background: #fff !important; border: 1px solid #efc3be !important; color: var(--ub-err) !important; }
body .ant-btn.ub-danger:hover:not(:disabled), body .ant-btn-dangerous:hover:not(:disabled) { background: var(--ub-err-bg) !important; border-color: #e4968f !important; color: #a52a21 !important; }
body .ant-btn-primary.ant-btn-dangerous { background: var(--ub-err) !important; border-color: var(--ub-err) !important; color: #fff !important; }
body .ant-btn-link { font-weight: 600; box-shadow: none !important; }
body .ant-btn:disabled, body .ant-btn-default:disabled { background: #f3f5f9 !important; border-color: var(--ub-border) !important; color: #a3afc0 !important; cursor: not-allowed; }
body .ant-btn .anticon { font-size: 14px; }
/* i pulsanti di creazione a tutta larghezza diventano compatti, allineati a sinistra */
body .content-card .ant-btn-block.ub-cta, body .content-card .ant-flex-vertical > .ant-btn.ub-cta { width: auto !important; align-self: flex-start; min-width: 190px; }
/* link nel contenuto: blu profondo leggibile, non oro su bianco */
body .content-card a:not(.ant-btn):not(.ant-pagination-item a), body .content-card .ant-typography a, body .content-card .ant-btn-link:not(.ub-danger) { color: #1f5ea8; }
body .content-card a:not(.ant-btn):hover { color: var(--ub-navy); text-decoration: underline; }
/* pulsanti con un colore scritto a mano nel codice (blu Ant Design): tornano nella palette */
body .ant-btn-primary[style*="background"]:not(.ub-cta):not(.ub-danger) { background: var(--ub-navy) !important; border-color: var(--ub-navy) !important; color: #fff !important; }
/* un pulsante dentro una colonna stretta va a capo invece di uscirne */
body .ant-row > .ant-col > .ant-btn { max-width: 100%; height: auto !important; min-height: 36px; padding: 7px 12px !important; line-height: 1.25; white-space: normal; }

/* ---------- campi, selezioni, date ---------- */
body .ant-input, body .ant-input-affix-wrapper, body .ant-input-number, body .ant-picker,
body .ant-select:not(.ant-select-customize-input) .ant-select-selector, body .ant-input-textarea textarea {
  border-radius: 11px !important; border-color: var(--ub-border-strong) !important; background: #fff; transition: border-color .15s, box-shadow .15s;
}
body .ant-input:not(.ant-input-affix-wrapper > .ant-input):not(.ant-input-group > .ant-input), body .ant-input-affix-wrapper, body .ant-picker { min-height: 38px; font-size: 14px; }
body .ant-input-affix-wrapper { padding-top: 0; padding-bottom: 0; align-items: center; }
body .ant-input-affix-wrapper > .ant-input { min-height: 0 !important; height: auto; padding: 0 !important; border: 0 !important; box-shadow: none !important; background: transparent; }
body .ant-input:not(.ant-input-affix-wrapper > .ant-input) { padding-top: 4px; padding-bottom: 4px; }
body .ant-input-number { width: 100%; min-height: 38px; }
body .ant-input-number .ant-input-number-input { height: 34px; }
body .ant-select:not(.ant-select-customize-input) .ant-select-selector { min-height: 38px; padding-inline: 12px !important; align-items: center; font-weight: 500; }
body .ant-select-single { height: 38px; }
body .ant-select-single .ant-select-selector .ant-select-selection-item, body .ant-select-single .ant-select-selector .ant-select-selection-placeholder { line-height: 36px !important; }
body .ant-input:hover, body .ant-input-affix-wrapper:hover, body .ant-input-number:hover, body .ant-picker:hover,
body .ant-select:not(.ant-select-disabled):hover .ant-select-selector { border-color: #8da0b8 !important; }
body .ant-input:focus, body .ant-input-focused, body .ant-input-affix-wrapper-focused, body .ant-input-number-focused, body .ant-picker-focused,
body .ant-select-focused:not(.ant-select-disabled) .ant-select-selector, body .ant-select-open .ant-select-selector {
  border-color: var(--ub-info) !important; box-shadow: var(--ub-ring) !important; outline: none;
}
body .ant-input::placeholder, body .ant-select-selection-placeholder, body .ant-picker-input > input::placeholder { color: var(--ub-faint) !important; font-weight: 400; }
body .ant-input[disabled], body .ant-input-disabled, body .ant-select-disabled .ant-select-selector, body .ant-picker-disabled { background: var(--ub-surface-2) !important; color: #8795a8 !important; }
body .ant-select-arrow, body .ant-select-clear { color: var(--ub-faint); }
body .ant-select-multiple .ant-select-selection-item { border-radius: 8px; background: var(--ub-info-bg); border: 0; color: var(--ub-navy); font-weight: 600; }
body .ant-input-prefix, body .ant-input-suffix { color: var(--ub-faint); }

body .ant-select-dropdown, body .ant-picker-dropdown .ant-picker-panel-container, body .ant-dropdown-menu, body .ant-cascader-dropdown .ant-cascader-menus {
  border-radius: 16px !important; box-shadow: 0 16px 48px rgba(11, 28, 48, .18), 0 0 0 1px var(--ub-border) !important; border: 0 !important; overflow: hidden;
}
body .ant-select-dropdown { padding: 6px !important; }
body .ant-select-dropdown .ant-select-item { border-radius: 10px; padding: 9px 12px; margin: 1px 0; min-height: 36px; font-weight: 500; color: var(--ub-ink); transition: background .12s; }
body .ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled) { background: #f1f5fa; }
body .ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled) { background: var(--ub-info-bg); color: var(--ub-navy); font-weight: 650; }
body .ant-select-dropdown .ant-select-item-option-state { color: var(--ub-info); }
body .ant-select-dropdown .ant-select-item-empty { color: var(--ub-faint); }
body .ant-select-dropdown .ant-select-item-group { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ub-faint); }
body .ant-dropdown-menu { padding: 6px !important; }
body .ant-dropdown-menu .ant-dropdown-menu-item, body .ant-dropdown-menu .ant-dropdown-menu-submenu-title { border-radius: 10px; padding: 9px 12px; font-weight: 500; }
body .ant-dropdown-menu .ant-dropdown-menu-item:hover { background: #f1f5fa; }
body .ant-dropdown-menu .ant-dropdown-menu-item-selected, body .ant-dropdown-menu .ant-dropdown-menu-item-selected .ant-dropdown-menu-title-content { background: var(--ub-info-bg); color: var(--ub-navy) !important; font-weight: 650; }
body .ant-dropdown-menu .ant-dropdown-menu-item, body .ant-dropdown-menu .ant-dropdown-menu-title-content { color: var(--ub-ink); font-size: 13px; }
body .ant-picker-dropdown .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner, body .ant-picker-dropdown .ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner, body .ant-picker-dropdown .ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner { background: var(--ub-navy) !important; }
body .ant-picker-dropdown .ant-picker-today-btn { color: var(--ub-info); font-weight: 600; }

body .ant-checkbox-checked .ant-checkbox-inner, body .ant-radio-checked .ant-radio-inner { background-color: var(--ub-navy) !important; border-color: var(--ub-navy) !important; }
body .ant-radio-checked .ant-radio-inner::after { background-color: #fff !important; }
body .ant-checkbox-inner { border-radius: 6px; border-color: var(--ub-border-strong); }
body .ant-switch.ant-switch-checked { background: var(--ub-ok) !important; }
body .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) { background: var(--ub-navy) !important; border-color: var(--ub-navy) !important; color: #fff !important; }
body .ant-radio-button-wrapper:first-child { border-radius: 10px 0 0 10px; } body .ant-radio-button-wrapper:last-child { border-radius: 0 10px 10px 0; }
body .ant-segmented { background: var(--ub-surface-2); border-radius: 12px; padding: 3px; } body .ant-segmented-item-selected { border-radius: 9px; box-shadow: 0 1px 3px rgba(15, 27, 45, .12); font-weight: 650; }

body .ant-form-item-label > label { font-size: 12.5px; font-weight: 600; color: var(--ub-muted); height: auto; }
body .ant-form-item { margin-bottom: 18px; }
body .ant-form-item-explain-error { font-size: 12.5px; }

/* ---------- tabelle ---------- */
body .ant-table-wrapper .ant-table { background: transparent; font-size: 13.5px; color: var(--ub-ink); }
body .ant-table-wrapper .ant-table-container { border: 1px solid var(--ub-border) !important; border-radius: 16px !important; overflow: hidden; background: #fff; }
body .ant-table-wrapper .ant-table-thead > tr > th, body .ant-table-wrapper .ant-table-thead > tr > td {
  background: var(--ub-surface-2) !important; color: var(--ub-muted) !important; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  padding: 12px 16px !important; border-bottom: 1px solid var(--ub-border-strong) !important; border-radius: 0 !important;
}
body .ant-table-wrapper .ant-table-thead > tr > th::before { display: none !important; }
body .ant-table-wrapper .ant-table-tbody > tr > td { padding: 12px 16px !important; border-bottom: 1px solid #eef1f6 !important; transition: background .12s; }
body .ant-table-wrapper .ant-table-tbody > tr:last-child > td { border-bottom: 0 !important; }
/* le parole non si spezzano lettera per lettera nelle celle strette: gli elementi vanno a capo interi */
body .ant-table-wrapper .ant-table-cell { word-break: normal; overflow-wrap: break-word; }
body .ant-table-wrapper .ant-table-cell > .ant-flex { flex-wrap: wrap; }
body .ant-table-wrapper .ant-table-tbody > tr > td:has(.ant-input, .ant-input-number, .ant-select, .ant-picker) { padding: 7px 10px !important; }
body .ant-table-wrapper .ant-table-tbody .ant-input, body .ant-table-wrapper .ant-table-tbody .ant-input-number, body .ant-table-wrapper .ant-table-tbody .ant-select-selector, body .ant-table-wrapper .ant-table-tbody .ant-picker { min-height: 32px !important; }
body .ant-table-wrapper .ant-table-tbody .ant-input-number .ant-input-number-input { height: 30px; }
body .ant-table-wrapper .ant-table-tbody .ant-select-single { height: 32px; }
body .ant-table-wrapper .ant-table-tbody .ant-select-single .ant-select-selector .ant-select-selection-item { line-height: 30px !important; }
body .ant-table-wrapper .ant-table-tbody > tr.ant-table-row:hover > td, body .ant-table-wrapper .ant-table-tbody > tr > td.ant-table-cell-row-hover { background: #f7f9fc !important; }
body .ant-table-wrapper .ant-table-summary > tr > td, body .ant-table-wrapper .ant-table-summary > tr > th { background: var(--ub-surface-2); font-weight: 650; }
body .ant-table-wrapper .ant-table-bordered .ant-table-cell { border-inline-end-color: #eef1f6 !important; }
body .ant-table-wrapper .ant-table-cell .ant-btn-sm { margin: 1px 0; }
body .ant-table-wrapper .ant-table-placeholder .ant-table-cell { padding: 40px 16px !important; }
body .ant-empty-description { color: var(--ub-faint); }
body .ant-pagination .ant-pagination-item, body .ant-pagination .ant-pagination-prev .ant-pagination-item-link, body .ant-pagination .ant-pagination-next .ant-pagination-item-link { border-radius: 10px; font-weight: 600; }
body .ant-pagination .ant-pagination-item-active { background: var(--ub-navy); border-color: var(--ub-navy); }
body .ant-pagination .ant-pagination-item-active a { color: #fff !important; }

/* ---------- schede, schede a linguetta, tag, avvisi ---------- */
body .ant-card { border-radius: 18px; border: 1px solid var(--ub-border); box-shadow: var(--ub-shadow); }
body .ant-card-head { border-bottom: 1px solid var(--ub-border); font-weight: 650; min-height: 52px; }
body .ant-card-bordered .ant-card-body { padding: 18px 20px; }
body .ant-statistic-title { font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ub-muted); }
body .ant-statistic-content { font-weight: 700; letter-spacing: -.015em; }
body .ant-statistic-content-value, body .ant-statistic-content-value-int { font-size: 21px; white-space: nowrap; }
body .ant-col > div > .ant-typography.ant-typography-secondary { display: block; margin-bottom: 4px; }
body .ant-tabs-nav::before { border-bottom-color: var(--ub-border) !important; }
body .ant-tabs-tab { padding: 12px 4px; font-weight: 600; color: var(--ub-muted); }
body .ant-tabs-tab-active .ant-tabs-tab-btn { color: var(--ub-navy) !important; font-weight: 650; }
body .ant-tabs-ink-bar { background: var(--ub-gold) !important; height: 3px !important; border-radius: 3px 3px 0 0; }
body .ant-tag { border-radius: 999px; padding: 1px 10px; font-weight: 600; font-size: 12px; border-width: 0; line-height: 20px; }
body .ant-tag-success { background: var(--ub-ok-bg); color: var(--ub-ok); } body .ant-tag-error { background: var(--ub-err-bg); color: var(--ub-err); }
body .ant-tag-warning { background: var(--ub-warn-bg); color: var(--ub-warn); } body .ant-tag-processing, body .ant-tag-blue { background: var(--ub-info-bg); color: var(--ub-info); }
body .ant-tag-default, body .ant-tag:not([class*="ant-tag-"]) { background: var(--ub-surface-2); color: var(--ub-muted); border: 1px solid var(--ub-border); }
body .ant-alert { border-radius: 14px; border-width: 0; padding: 12px 16px; }
body .ant-badge-count { box-shadow: 0 0 0 2px var(--ub-navy); font-weight: 700; }
body .ant-divider { border-block-start-color: var(--ub-border); }
body .ant-collapse { border-radius: 14px; border-color: var(--ub-border); background: #fff; } body .ant-collapse > .ant-collapse-item { border-bottom-color: var(--ub-border); }
body .ant-collapse-header { font-weight: 650; }
body .ant-descriptions-item-label { color: var(--ub-muted); font-weight: 600; }
body .ant-progress-bg { background: var(--ub-gold); }
body .ant-spin-dot-item { background-color: var(--ub-gold); }

/* ---------- finestre, cassetti, notifiche ---------- */
body .ant-modal-mask, body .ant-drawer-mask { background: rgba(10, 26, 46, .5) !important; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
body .ant-modal .ant-modal-content { border-radius: 22px !important; padding: 24px 26px !important; box-shadow: var(--ub-shadow-lg) !important; overflow: hidden; }
body .ant-modal .ant-modal-header { margin-bottom: 18px; background: transparent; border: 0; }
body .ant-modal .ant-modal-title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; color: var(--ub-ink); }
body .ant-modal .ant-modal-footer { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
body .ant-modal .ant-modal-footer .ant-btn + .ant-btn { margin-inline-start: 0; }
body .ant-modal .ant-modal-close { top: 18px; inset-inline-end: 18px; border-radius: 10px; color: var(--ub-muted); }
body .ant-modal .ant-modal-close:hover { background: var(--ub-surface-2); color: var(--ub-ink); }
body .ant-drawer .ant-drawer-content { border-radius: 22px 0 0 22px; box-shadow: var(--ub-shadow-lg); }
body .ant-drawer-title { font-weight: 700; letter-spacing: -.01em; }
body .ant-popover .ant-popover-inner, body .ant-popconfirm .ant-popover-inner { border-radius: 16px; box-shadow: 0 16px 48px rgba(11, 28, 48, .18), 0 0 0 1px var(--ub-border); padding: 14px 16px; }
body .ant-tooltip .ant-tooltip-inner { background: #0f1b2d; border-radius: 10px; padding: 7px 11px; font-size: 12.5px; font-weight: 500; box-shadow: 0 8px 24px rgba(11, 28, 48, .28); }
body .ant-tooltip .ant-tooltip-arrow::before { background: #0f1b2d; }
body .ant-message .ant-message-notice-content { border-radius: 14px; padding: 11px 18px; box-shadow: 0 14px 40px rgba(11, 28, 48, .18), 0 0 0 1px var(--ub-border); font-weight: 500; }
body .ant-notification .ant-notification-notice { border-radius: 16px; box-shadow: 0 16px 48px rgba(11, 28, 48, .2), 0 0 0 1px var(--ub-border); }

/* ---------- accesso (login e recupero password): l'ingresso ---------- */
html[data-ub-pagina="accesso"], html[data-ub-pagina="accesso"] body { background: #061629 !important; overflow: hidden; }
html[data-ub-pagina="accesso"] body #root { position: relative; z-index: 3; }
html[data-ub-pagina="accesso"] body .ant-layout { background: transparent !important; }
html[data-ub-pagina="accesso"] body .ant-layout-content > .ant-flex { justify-content: center; }

/* livelli dello sfondo (creati da tema.js, dietro l'app) */
#ub-ingresso { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: linear-gradient(135deg, #061629 0%, #0a2543 46%, #0d3157 100%); }
#ub-ingresso .ub-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
#ub-ingresso .b1 { width: 52vmax; height: 52vmax; left: -14vmax; top: -18vmax; background: radial-gradient(circle at 40% 40%, rgba(47, 111, 176, .85), rgba(47, 111, 176, 0) 68%); animation: ubDeriva1 26s ease-in-out infinite alternate; }
#ub-ingresso .b2 { width: 44vmax; height: 44vmax; right: -12vmax; top: -10vmax; background: radial-gradient(circle at 50% 50%, rgba(233, 175, 49, .62), rgba(233, 175, 49, 0) 66%); animation: ubDeriva2 31s ease-in-out infinite alternate; opacity: .42; }
#ub-ingresso .b3 { width: 46vmax; height: 46vmax; right: 8vmax; bottom: -26vmax; background: radial-gradient(circle at 50% 50%, rgba(22, 160, 150, .55), rgba(22, 160, 150, 0) 68%); animation: ubDeriva3 29s ease-in-out infinite alternate; opacity: .34; }
@keyframes ubDeriva1 { to { transform: translate3d(9vmax, 7vmax, 0) scale(1.12); } }
@keyframes ubDeriva2 { to { transform: translate3d(-8vmax, 9vmax, 0) scale(.92); } }
@keyframes ubDeriva3 { to { transform: translate3d(-9vmax, -5vmax, 0) scale(1.1); } }
#ub-ingresso .ub-griglia { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 46%, #000 20%, transparent 78%); mask-image: radial-gradient(ellipse 70% 62% at 50% 46%, #000 20%, transparent 78%); }
#ub-ingresso canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#ub-ingresso .ub-luce { position: absolute; inset: 0; background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 40%), rgba(233, 175, 49, .13), transparent 62%); transition: background .2s; }
#ub-ingresso .ub-lama { position: absolute; top: -20%; bottom: -20%; width: 28vmax; left: -40vmax; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .055), transparent); animation: ubLama 14s ease-in-out 2.2s infinite; }
@keyframes ubLama { 0% { left: -40vmax; } 55%, 100% { left: 130vw; } }
#ub-ingresso .ub-vignetta { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(2, 10, 20, .55) 100%); }

/* pannello di benvenuto (a sinistra, solo sugli schermi larghi) */
#ub-pannello { position: fixed; z-index: 2; left: clamp(36px, 7vw, 150px); top: 50%; transform: translateY(-50%); max-width: min(46vw, 700px); color: #fff; pointer-events: none; display: none; }
#ub-pannello > * { opacity: 0; animation: ubSale .9s cubic-bezier(.2, .7, .2, 1) forwards; }
#ub-pannello .ub-saluto { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: .01em; color: rgba(255, 255, 255, .86); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation-delay: .25s; }
#ub-pannello .ub-saluto i { width: 8px; height: 8px; border-radius: 50%; background: var(--ub-gold); box-shadow: 0 0 0 4px rgba(233, 175, 49, .22); animation: ubPulsa 2.6s ease-in-out infinite; }
@keyframes ubPulsa { 50% { box-shadow: 0 0 0 8px rgba(233, 175, 49, 0); } }
#ub-pannello h2 { margin: 22px 0 0; font-size: clamp(30px, 3.5vw, 52px); white-space: nowrap; line-height: 1.06; font-weight: 700; letter-spacing: -.035em; color: #fff; animation-delay: .4s; }
#ub-pannello h2 em { font-style: normal; background: linear-gradient(95deg, #ffe08a 0%, #e9af31 48%, #f6c85d 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
#ub-pannello p { margin: 20px 0 0; max-width: 460px; font-size: 16.5px; line-height: 1.65; color: rgba(255, 255, 255, .72); animation-delay: .6s; }
#ub-pannello ul { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; animation-delay: .8s; }
#ub-pannello li { display: flex; align-items: center; gap: 14px; font-size: 14.5px; font-weight: 500; color: rgba(255, 255, 255, .88); }
#ub-pannello li span { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #ffd57f; background: linear-gradient(135deg, rgba(233, 175, 49, .22), rgba(233, 175, 49, .06)); border: 1px solid rgba(233, 175, 49, .30); }
#ub-pannello li svg { width: 19px; height: 19px; }
#ub-pannello .ub-piede { margin-top: 44px; font-size: 12.5px; color: rgba(255, 255, 255, .42); animation-delay: 1s; }
@keyframes ubSale { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@media (min-width: 1100px) {
  #ub-pannello { display: block; }
  html[data-ub-pagina="accesso"] body .ant-layout-content > .ant-flex { justify-content: flex-end; padding-right: clamp(40px, 9vw, 170px); }
}
@media (max-height: 640px) { #ub-pannello ul, #ub-pannello .ub-piede { display: none; } }

/* logo: la stessa immagine, con un alone e un lento galleggiamento */
html[data-ub-pagina="accesso"] body .ant-layout-content img { filter: drop-shadow(0 0 30px rgba(233, 175, 49, .38)) drop-shadow(0 8px 18px rgba(0, 0, 0, .4)) !important; animation: ubSale .9s cubic-bezier(.2, .7, .2, 1) .1s both, ubFluttua 7s ease-in-out 1s infinite; }
@keyframes ubFluttua { 50% { transform: translateY(-5px); } }

/* scheda di accesso: vetro scuro con filo dorato */
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-card {
  position: relative; background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .055)) !important; border: 0 !important; border-radius: 26px !important;
  backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08) inset !important; padding: 10px 8px; min-width: 330px;
  animation: ubCard 1s cubic-bezier(.2, .7, .2, 1) .25s both; transition: box-shadow .4s;
}
@keyframes ubCard { from { opacity: 0; transform: translateY(34px) scale(.97); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(233, 175, 49, .85), rgba(255, 255, 255, .14) 38%, rgba(255, 255, 255, .05) 62%, rgba(233, 175, 49, .55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-card:focus-within { box-shadow: 0 40px 100px rgba(0, 0, 0, .55), 0 0 70px rgba(233, 175, 49, .16), 0 0 0 1px rgba(255, 255, 255, .1) inset !important; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-card-head { border: 0 !important; padding-top: 6px; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-card-head-title { color: #fff !important; font-size: 1.75rem !important; font-weight: 700 !important; letter-spacing: -.025em; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-card-head-title::after { content: "Accedi al tuo spazio di lavoro"; display: block; margin-top: 4px; font-size: .82rem; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, .55); }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-space-item { animation: ubSale .7s cubic-bezier(.2, .7, .2, 1) both; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-space-item:nth-child(1) { animation-delay: .55s; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-space-item:nth-child(2) { animation-delay: .65s; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-space-item:nth-child(3) { animation-delay: .75s; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-space-item:nth-child(4) { animation-delay: .85s; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-space-item:nth-child(5) { animation-delay: .95s; }
html[data-ub-pagina="accesso"] body .ant-layout-content label { color: rgba(255, 255, 255, .78) !important; font-size: 12.5px; font-weight: 600 !important; letter-spacing: .02em; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input, html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-affix-wrapper {
  background: rgba(255, 255, 255, .07) !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, .18) !important; border-radius: 14px !important; min-height: 50px; box-shadow: none !important; transition: border-color .2s, background .2s, box-shadow .2s;
}
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-affix-wrapper > .ant-input { background: transparent !important; border: 0 !important; min-height: 0; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input:hover, html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-affix-wrapper:hover { border-color: rgba(255, 255, 255, .34) !important; background: rgba(255, 255, 255, .1) !important; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input:focus, html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-affix-wrapper-focused {
  border-color: rgba(233, 175, 49, .9) !important; background: rgba(255, 255, 255, .12) !important; box-shadow: 0 0 0 4px rgba(233, 175, 49, .18) !important;
}
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-affix-wrapper > .ant-input,
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-affix-wrapper > .ant-input:hover,
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-affix-wrapper > .ant-input:focus { background: transparent !important; border: 0 !important; box-shadow: none !important; outline: none; }
html[data-ub-pagina="accesso"] body .ant-layout-content input::placeholder { color: rgba(255, 255, 255, .38) !important; }
html[data-ub-pagina="accesso"] body .ant-layout-content input:-webkit-autofill { -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px #12304f inset !important; caret-color: #fff; border-radius: 12px; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-input-suffix, html[data-ub-pagina="accesso"] body .ant-layout-content .anticon { color: rgba(255, 255, 255, .55) !important; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-typography, html[data-ub-pagina="accesso"] body .ant-layout-content .ant-typography span { color: rgba(255, 255, 255, .62) !important; font-size: .82rem !important; line-height: 1.6; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-typography a, html[data-ub-pagina="accesso"] body .ant-layout-content a { color: #ffd57f !important; font-weight: 600; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-primary:not(:disabled) {
  position: relative; overflow: hidden; height: 52px !important; border: 0 !important; border-radius: 15px !important; font-size: 15.5px; font-weight: 700 !important; letter-spacing: .01em; color: #1b2433 !important;
  background: linear-gradient(180deg, #f8d374 0%, #e9af31 100%) !important; box-shadow: 0 12px 30px rgba(233, 175, 49, .34), 0 1px 0 rgba(255, 255, 255, .5) inset !important; transition: transform .2s, box-shadow .2s !important;
}
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(233, 175, 49, .46), 0 1px 0 rgba(255, 255, 255, .5) inset !important; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-primary:not(:disabled)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 60%; left: -80%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-20deg); animation: ubLuccica 3.6s ease-in-out 1.4s infinite; }
@keyframes ubLuccica { 0%, 55% { left: -80%; } 100% { left: 150%; } }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-primary:disabled { height: 52px !important; border: 1px solid rgba(255, 255, 255, .12) !important; border-radius: 15px !important; background: rgba(255, 255, 255, .06) !important; color: rgba(255, 255, 255, .35) !important; font-size: 15.5px; font-weight: 600; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-link { color: #ffd57f !important; font-weight: 600; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-link:hover { color: #fff !important; }
html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-link:hover a { color: #fff !important; }
html[data-ub-pagina="accesso"] body .ant-message { z-index: 1100; }
@media (prefers-reduced-motion: reduce) {
  #ub-ingresso .ub-blob, #ub-ingresso .ub-lama, #ub-pannello .ub-saluto i, html[data-ub-pagina="accesso"] body .ant-layout-content img,
  html[data-ub-pagina="accesso"] body .ant-layout-content .ant-btn-primary::after { animation: none !important; }
  #ub-pannello > *, html[data-ub-pagina="accesso"] body .ant-layout-content .ant-card, html[data-ub-pagina="accesso"] body .ant-layout-content .ant-space-item { opacity: 1 !important; animation: none !important; }
}



/* ================================================================================
   TEMA SCURO: stessa identita' dell'ingresso (blu notte, vetro, oro). Si attiva con
   html[data-tema="scuro"], impostato da tema-scelta.js; il pulsante in alto lo cambia.
   ================================================================================ */
html[data-tema="scuro"] {
  color-scheme: dark;
  --d-text: #e8eef5; --d-muted: #9fb2c8; --d-faint: #6f8399; --d-border: rgba(255, 255, 255, .10); --d-input: rgba(255, 255, 255, .06);
  --ub-ink: #e8eef5; --ub-muted: #9fb2c8; --ub-faint: #6f8399; --ub-border: rgba(255, 255, 255, .10); --ub-border-strong: rgba(255, 255, 255, .18); --ub-surface-2: rgba(255, 255, 255, .05);
  --ub-ring: 0 0 0 3px rgba(233, 175, 49, .22);
  --bg-soft: #061629;
}
html[data-tema="scuro"] body {
  background: radial-gradient(900px 480px at 88% -6%, rgba(233, 175, 49, .08), transparent 60%), radial-gradient(800px 520px at -8% 6%, rgba(47, 111, 176, .18), transparent 60%), #061629 !important;
  background-attachment: fixed; color: var(--d-text);
}
/* ===== struttura ===== */
html[data-tema="scuro"] body .ant-layout-sider { background: linear-gradient(180deg, #04101f 0%, #061a30 55%, #04111f 100%) !important; box-shadow: 6px 0 40px rgba(0, 0, 0, .45); border-right: 1px solid rgba(255, 255, 255, .05); }
html[data-tema="scuro"] body .ant-layout-header { background: linear-gradient(115deg, #04101f 0%, #0a2543 55%, #04101f 100%) !important; box-shadow: 0 8px 30px rgba(0, 0, 0, .42); }
html[data-tema="scuro"] body .content-card { background: linear-gradient(160deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03)) !important; border: 1px solid var(--d-border) !important; box-shadow: 0 30px 70px rgba(0, 0, 0, .42), 0 0 0 1px rgba(255, 255, 255, .03) inset !important; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: var(--d-text); }
html[data-tema="scuro"] body .ant-layout-content,
html[data-tema="scuro"] body .main-content { color: var(--d-text); }
html[data-tema="scuro"] body .ant-menu-dark.ant-menu-root > .ant-menu-submenu:not(.ant-menu-submenu ~ .ant-menu-submenu)::before { color: rgba(255, 255, 255, .34); }
/* ===== testo ===== */
html[data-tema="scuro"] body h1,
html[data-tema="scuro"] body h2,
html[data-tema="scuro"] body h3,
html[data-tema="scuro"] body h4,
html[data-tema="scuro"] body h5,
html[data-tema="scuro"] body h6,
html[data-tema="scuro"] body .ant-typography,
html[data-tema="scuro"] body .ant-typography h1,
html[data-tema="scuro"] body .ant-typography h2,
html[data-tema="scuro"] body .ant-typography h3 { color: #f4f8fc !important; }
html[data-tema="scuro"] body .ant-typography-secondary,
html[data-tema="scuro"] body .ant-form-item-label > label,
html[data-tema="scuro"] body .ant-descriptions-item-label,
html[data-tema="scuro"] body .ant-statistic-title,
html[data-tema="scuro"] body .ant-empty-description,
html[data-tema="scuro"] body .ant-form-item-extra { color: var(--d-muted) !important; }
html[data-tema="scuro"] body .ant-typography a,
html[data-tema="scuro"] body .content-card a:not(.ant-btn) { color: #ffd57f !important; }
html[data-tema="scuro"] body .content-card a:not(.ant-btn):hover { color: #fff !important; }
html[data-tema="scuro"] body .ant-divider { border-block-start-color: var(--d-border) !important; color: var(--d-muted); }
html[data-tema="scuro"] body .ant-statistic-content { color: #f4f8fc; }
html[data-tema="scuro"] body .ant-form-item-explain-error { color: #ff9a90; }
html[data-tema="scuro"] body [style*="color: rgb(156, 163, 175)"],
html[data-tema="scuro"] body [style*="color: rgb(107, 114, 128)"],
html[data-tema="scuro"] body [style*="color: rgb(153, 153, 153)"] { color: var(--d-muted) !important; }
html[data-tema="scuro"] body [style*="color: rgb(192, 57, 43)"] { color: #ff8c82 !important; }
html[data-tema="scuro"] body [style*="color: rgb(233, 175, 49)"] { color: #ffd57f !important; }
html[data-tema="scuro"] body [style*="color: rgb(51, 51, 51)"],
html[data-tema="scuro"] body [style*="color: #333"] { color: var(--d-text) !important; }
html[data-tema="scuro"] body [style*="background: rgb(255, 255, 255)"],
html[data-tema="scuro"] body [style*="background-color: rgb(255, 255, 255)"] { background: rgba(255, 255, 255, .06) !important; }
html[data-tema="scuro"] body [style*="border: 1px dashed rgb(217, 217, 217)"] { border-color: rgba(255, 255, 255, .22) !important; }
/* ===== campi, selezioni, date ===== */
html[data-tema="scuro"] body .ant-input,
html[data-tema="scuro"] body .ant-input-affix-wrapper,
html[data-tema="scuro"] body .ant-input-number,
html[data-tema="scuro"] body .ant-picker,
html[data-tema="scuro"] body .ant-select:not(.ant-select-customize-input) .ant-select-selector,
html[data-tema="scuro"] body .ant-input-textarea textarea,
html[data-tema="scuro"] body textarea.ant-input {
  background: var(--d-input) !important; border-color: rgba(255, 255, 255, .16) !important; color: #fff !important;
}
html[data-tema="scuro"] body .ant-input-affix-wrapper > .ant-input,
html[data-tema="scuro"] body .ant-input-number-input,
html[data-tema="scuro"] body .ant-picker-input > input,
html[data-tema="scuro"] body .ant-select-selection-search-input { background: transparent !important; color: #fff !important; }
html[data-tema="scuro"] body .ant-input:hover,
html[data-tema="scuro"] body .ant-input-affix-wrapper:hover,
html[data-tema="scuro"] body .ant-input-number:hover,
html[data-tema="scuro"] body .ant-picker:hover,
html[data-tema="scuro"] body .ant-select:not(.ant-select-disabled):hover .ant-select-selector { border-color: rgba(255, 255, 255, .34) !important; background: rgba(255, 255, 255, .09) !important; }
html[data-tema="scuro"] body .ant-input:focus,
html[data-tema="scuro"] body .ant-input-focused,
html[data-tema="scuro"] body .ant-input-affix-wrapper-focused,
html[data-tema="scuro"] body .ant-input-number-focused,
html[data-tema="scuro"] body .ant-picker-focused,
html[data-tema="scuro"] body .ant-select-focused:not(.ant-select-disabled) .ant-select-selector,
html[data-tema="scuro"] body .ant-select-open .ant-select-selector {
  border-color: rgba(233, 175, 49, .9) !important; box-shadow: 0 0 0 4px rgba(233, 175, 49, .17) !important; background: rgba(255, 255, 255, .1) !important;
}
html[data-tema="scuro"] body .ant-input::placeholder,
html[data-tema="scuro"] body .ant-select-selection-placeholder,
html[data-tema="scuro"] body .ant-picker-input > input::placeholder,
html[data-tema="scuro"] body textarea::placeholder { color: rgba(255, 255, 255, .36) !important; }
html[data-tema="scuro"] body .ant-input[disabled],
html[data-tema="scuro"] body .ant-input-disabled,
html[data-tema="scuro"] body .ant-select-disabled .ant-select-selector,
html[data-tema="scuro"] body .ant-picker-disabled,
html[data-tema="scuro"] body .ant-input-number-disabled { background: rgba(255, 255, 255, .03) !important; color: rgba(255, 255, 255, .34) !important; }
html[data-tema="scuro"] body .ant-select-selection-item,
html[data-tema="scuro"] body .ant-picker-input > input,
html[data-tema="scuro"] body .ant-input-number-input { color: #fff !important; }
html[data-tema="scuro"] body .ant-select-arrow,
html[data-tema="scuro"] body .ant-select-clear,
html[data-tema="scuro"] body .ant-picker-suffix,
html[data-tema="scuro"] body .ant-input-suffix,
html[data-tema="scuro"] body .ant-input-prefix,
html[data-tema="scuro"] body .anticon-calendar,
html[data-tema="scuro"] body .ant-picker-clear { color: rgba(255, 255, 255, .5) !important; background: transparent; }
html[data-tema="scuro"] body .ant-input-number-handler-wrap { background: rgba(255, 255, 255, .04); border-inline-start-color: rgba(255, 255, 255, .1); }
html[data-tema="scuro"] body .ant-input-number-handler { color: rgba(255, 255, 255, .5); border-block-start-color: rgba(255, 255, 255, .1); }
html[data-tema="scuro"] body .ant-select-multiple .ant-select-selection-item { background: rgba(233, 175, 49, .16) !important; color: #ffd57f !important; }
html[data-tema="scuro"] body input[type="date"],
html[data-tema="scuro"] body input[type="month"],
html[data-tema="scuro"] body input[type="time"] { color-scheme: dark; }
html[data-tema="scuro"] body .ant-select-dropdown,
html[data-tema="scuro"] body .ant-picker-dropdown .ant-picker-panel-container,
html[data-tema="scuro"] body .ant-dropdown-menu,
html[data-tema="scuro"] body .ant-cascader-dropdown .ant-cascader-menus,
html[data-tema="scuro"] body .ant-picker-dropdown .ant-picker-panel {
  background: #0f263f !important; box-shadow: 0 22px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1) !important; color: var(--d-text);
}
html[data-tema="scuro"] body .ant-select-dropdown .ant-select-item,
html[data-tema="scuro"] body .ant-dropdown-menu .ant-dropdown-menu-item,
html[data-tema="scuro"] body .ant-dropdown-menu .ant-dropdown-menu-title-content { color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-select-dropdown .ant-select-item-option-active:not(.ant-select-item-option-disabled),
html[data-tema="scuro"] body .ant-dropdown-menu .ant-dropdown-menu-item:hover { background: rgba(255, 255, 255, .07) !important; }
html[data-tema="scuro"] body .ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled),
html[data-tema="scuro"] body .ant-dropdown-menu .ant-dropdown-menu-item-selected,
html[data-tema="scuro"] body .ant-dropdown-menu .ant-dropdown-menu-item-selected .ant-dropdown-menu-title-content { background: rgba(233, 175, 49, .17) !important; color: #ffd57f !important; }
html[data-tema="scuro"] body .ant-select-dropdown .ant-select-item-option-state { color: #ffd57f; }
html[data-tema="scuro"] body .ant-select-dropdown .ant-select-item-empty,
html[data-tema="scuro"] body .ant-select-dropdown .ant-select-item-group { color: var(--d-faint) !important; }
html[data-tema="scuro"] body .ant-picker-header,
html[data-tema="scuro"] body .ant-picker-header button,
html[data-tema="scuro"] body .ant-picker-content th,
html[data-tema="scuro"] body .ant-picker-cell { color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-picker-header { border-bottom-color: rgba(255, 255, 255, .1) !important; }
html[data-tema="scuro"] body .ant-picker-cell:not(.ant-picker-cell-in-view) { color: rgba(255, 255, 255, .26) !important; }
html[data-tema="scuro"] body .ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end) .ant-picker-cell-inner { background: rgba(255, 255, 255, .09) !important; }
html[data-tema="scuro"] body .ant-picker-dropdown .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner,
html[data-tema="scuro"] body .ant-picker-dropdown .ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner,
html[data-tema="scuro"] body .ant-picker-dropdown .ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner { background: #e9af31 !important; color: #1b2433 !important; }
html[data-tema="scuro"] body .ant-picker-dropdown .ant-picker-cell-today .ant-picker-cell-inner::before { border-color: #e9af31 !important; }
html[data-tema="scuro"] body .ant-picker-footer { border-top-color: rgba(255, 255, 255, .1) !important; }
html[data-tema="scuro"] body .ant-checkbox-inner,
html[data-tema="scuro"] body .ant-radio-inner { background: transparent !important; border-color: rgba(255, 255, 255, .3) !important; }
html[data-tema="scuro"] body .ant-checkbox-checked .ant-checkbox-inner,
html[data-tema="scuro"] body .ant-radio-checked .ant-radio-inner { background: #e9af31 !important; border-color: #e9af31 !important; }
html[data-tema="scuro"] body .ant-checkbox-checked .ant-checkbox-inner::after { border-color: #1b2433 !important; }
html[data-tema="scuro"] body .ant-radio-checked .ant-radio-inner::after { background-color: #1b2433 !important; }
html[data-tema="scuro"] body .ant-checkbox-wrapper,
html[data-tema="scuro"] body .ant-radio-wrapper { color: var(--d-text); }
html[data-tema="scuro"] body .ant-switch { background: rgba(255, 255, 255, .26) !important; }
html[data-tema="scuro"] body .ant-switch.ant-switch-checked { background: #12a37a !important; }
html[data-tema="scuro"] body .ant-segmented { background: rgba(255, 255, 255, .06) !important; color: var(--d-muted); }
html[data-tema="scuro"] body .ant-segmented-item-selected { background: rgba(255, 255, 255, .14) !important; color: #fff !important; }
html[data-tema="scuro"] body .ant-radio-button-wrapper { background: rgba(255, 255, 255, .05) !important; color: var(--d-text) !important; border-color: rgba(255, 255, 255, .14) !important; }
html[data-tema="scuro"] body .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) { background: #e9af31 !important; color: #1b2433 !important; border-color: #e9af31 !important; }
/* ===== pulsanti ===== */
html[data-tema="scuro"] body .ant-btn-default,
html[data-tema="scuro"] body .ant-btn-default.ant-btn-variant-outlined { background: rgba(255, 255, 255, .07) !important; border-color: rgba(255, 255, 255, .17) !important; color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-btn-default:hover:not(:disabled) { background: rgba(255, 255, 255, .13) !important; border-color: rgba(255, 255, 255, .32) !important; color: #fff !important; }
html[data-tema="scuro"] body .ant-btn-primary:not(.ant-btn-dangerous):not(.ant-btn-disabled):not(.ub-danger),
html[data-tema="scuro"] body .ant-btn.ub-cta { background: linear-gradient(180deg, #f8d374, #e9af31) !important; border: 0 !important; color: #1b2433 !important; box-shadow: 0 8px 22px rgba(233, 175, 49, .26), 0 1px 0 rgba(255, 255, 255, .45) inset !important; }
html[data-tema="scuro"] body .ant-btn-primary:not(.ant-btn-dangerous):not(.ub-danger):hover:not(:disabled),
html[data-tema="scuro"] body .ant-btn.ub-cta:hover:not(:disabled) { background: linear-gradient(180deg, #fadc8a, #ecb539) !important; color: #1b2433 !important; box-shadow: 0 12px 30px rgba(233, 175, 49, .38), 0 1px 0 rgba(255, 255, 255, .45) inset !important; }
html[data-tema="scuro"] body .ant-btn.ub-danger,
html[data-tema="scuro"] body .ant-btn.ant-btn-primary.ub-danger,
html[data-tema="scuro"] body .ant-btn-dangerous { background: rgba(224, 82, 70, .12) !important; box-shadow: none !important; border: 1px solid rgba(255, 130, 118, .4) !important; color: #ff9d94 !important; }
html[data-tema="scuro"] body .ant-btn.ub-danger:hover:not(:disabled),
html[data-tema="scuro"] body .ant-btn-dangerous:hover:not(:disabled) { background: rgba(224, 82, 70, .22) !important; border-color: rgba(255, 130, 118, .7) !important; color: #ffb9b2 !important; }
html[data-tema="scuro"] body .ant-btn-primary.ant-btn-dangerous { background: #d8453a !important; color: #fff !important; border-color: #d8453a !important; }
html[data-tema="scuro"] body .ant-btn-link,
html[data-tema="scuro"] body .ant-btn-link:not(.ub-danger) { color: #ffd57f !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
html[data-tema="scuro"] body .ant-btn-link:hover { color: #fff !important; }
html[data-tema="scuro"] body .ant-btn:disabled,
html[data-tema="scuro"] body .ant-btn-default:disabled,
html[data-tema="scuro"] body .ant-btn-primary:disabled { background: rgba(255, 255, 255, .05) !important; border: 1px solid rgba(255, 255, 255, .08) !important; color: rgba(255, 255, 255, .3) !important; box-shadow: none !important; }
html[data-tema="scuro"] body .ant-btn-text { color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-btn-text:hover { background: rgba(255, 255, 255, .08) !important; }
html[data-tema="scuro"] body .ant-layout-header .ant-btn-primary { background: linear-gradient(180deg, #f4c75d, #e9af31) !important; }
/* ===== tabelle ===== */
html[data-tema="scuro"] body .ant-table-wrapper .ant-table { background: transparent !important; color: var(--d-text); }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-container { background: rgba(255, 255, 255, .025) !important; border-color: var(--d-border) !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-thead > tr > th,
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-thead > tr > td { background: rgba(255, 255, 255, .055) !important; color: #a9bbd0 !important; border-bottom-color: rgba(255, 255, 255, .13) !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-tbody > tr > td { color: var(--d-text); border-bottom-color: rgba(255, 255, 255, .07) !important; background: transparent !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-tbody > tr.ant-table-row:hover > td,
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-tbody > tr > td.ant-table-cell-row-hover { background: rgba(255, 255, 255, .055) !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-summary > tr > td,
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-summary > tr > th { background: rgba(255, 255, 255, .055) !important; color: #fff; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-bordered .ant-table-cell { border-inline-end-color: rgba(255, 255, 255, .07) !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-title,
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-footer { background: rgba(255, 255, 255, .04) !important; color: var(--d-text) !important; border-color: var(--d-border) !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-summary,
html[data-tema="scuro"] body .ant-table-wrapper tfoot.ant-table-summary,
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-summary > tr { background: transparent !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-placeholder .ant-table-cell,
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-placeholder:hover > td { background: transparent !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-tbody > tr.ant-table-row-selected > td { background: rgba(233, 175, 49, .12) !important; }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-column-sorter { color: rgba(255, 255, 255, .4); }
html[data-tema="scuro"] body .ant-table-wrapper .ant-table-filter-trigger { color: rgba(255, 255, 255, .45); }
html[data-tema="scuro"] body .ant-pagination .ant-pagination-item,
html[data-tema="scuro"] body .ant-pagination .ant-pagination-prev .ant-pagination-item-link,
html[data-tema="scuro"] body .ant-pagination .ant-pagination-next .ant-pagination-item-link { background: rgba(255, 255, 255, .06) !important; border-color: rgba(255, 255, 255, .14) !important; }
html[data-tema="scuro"] body .ant-pagination .ant-pagination-item a,
html[data-tema="scuro"] body .ant-pagination .ant-pagination-item-link { color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-pagination .ant-pagination-item-active { background: #e9af31 !important; border-color: #e9af31 !important; }
html[data-tema="scuro"] body .ant-pagination .ant-pagination-item-active a { color: #1b2433 !important; }
html[data-tema="scuro"] body .ant-pagination-options .ant-select-selector { background: rgba(255, 255, 255, .06) !important; }
html[data-tema="scuro"] body .ant-empty-img-simple-ellipse { fill: rgba(255, 255, 255, .05); }
html[data-tema="scuro"] body .ant-empty-img-simple-path { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .18); }
html[data-tema="scuro"] body .ant-empty-img-simple-g { stroke: rgba(255, 255, 255, .22); }
/* ===== schede, linguette, etichette, avvisi ===== */
html[data-tema="scuro"] body .ant-card { background: rgba(255, 255, 255, .045) !important; border-color: var(--d-border) !important; color: var(--d-text); box-shadow: 0 16px 40px rgba(0, 0, 0, .3) !important; }
html[data-tema="scuro"] body .ant-card-head { border-bottom-color: var(--d-border) !important; color: #fff; background: transparent !important; }
html[data-tema="scuro"] body .ant-card-head-title { color: #fff; }
html[data-tema="scuro"] body .ant-tabs-nav::before { border-bottom-color: var(--d-border) !important; }
html[data-tema="scuro"] body .ant-tabs-tab { color: var(--d-muted) !important; }
html[data-tema="scuro"] body .ant-tabs-tab:hover { color: #fff !important; }
html[data-tema="scuro"] body .ant-tabs-tab-active .ant-tabs-tab-btn { color: #ffd57f !important; }
html[data-tema="scuro"] body .ant-tag-success { background: rgba(18, 163, 122, .16); color: #5fd9b0; }
html[data-tema="scuro"] body .ant-tag-error { background: rgba(224, 82, 70, .17); color: #ff9d94; }
html[data-tema="scuro"] body .ant-tag-warning { background: rgba(233, 175, 49, .17); color: #ffd57f; }
html[data-tema="scuro"] body .ant-tag-processing,
html[data-tema="scuro"] body .ant-tag-blue { background: rgba(47, 111, 176, .26); color: #9cc2ee; }
html[data-tema="scuro"] body .ant-tag-default,
html[data-tema="scuro"] body .ant-tag:not([class*="ant-tag-"]) { background: rgba(255, 255, 255, .07); color: var(--d-muted); border: 1px solid var(--d-border); }
html[data-tema="scuro"] body .ant-tag-green { background: rgba(18, 163, 122, .16) !important; color: #5fd9b0 !important; }
html[data-tema="scuro"] body .ant-tag-red { background: rgba(224, 82, 70, .17) !important; color: #ff9d94 !important; }
html[data-tema="scuro"] body .ant-tag-gold,
html[data-tema="scuro"] body .ant-tag-orange { background: rgba(233, 175, 49, .17) !important; color: #ffd57f !important; }
html[data-tema="scuro"] body .ant-alert { background: rgba(255, 255, 255, .06) !important; color: var(--d-text); }
html[data-tema="scuro"] body .ant-alert .ant-alert-message { color: #fff; }
html[data-tema="scuro"] body .ant-collapse,
html[data-tema="scuro"] body .ant-collapse > .ant-collapse-item,
html[data-tema="scuro"] body .ant-collapse-content { background: transparent !important; border-color: var(--d-border) !important; color: var(--d-text); }
html[data-tema="scuro"] body .ant-collapse-header { color: #fff !important; }
html[data-tema="scuro"] body .ant-descriptions-item-content { color: var(--d-text); }
html[data-tema="scuro"] body .ant-descriptions-bordered .ant-descriptions-view,
html[data-tema="scuro"] body .ant-descriptions-bordered .ant-descriptions-item-label,
html[data-tema="scuro"] body .ant-descriptions-bordered .ant-descriptions-item-content { border-color: var(--d-border) !important; background: transparent !important; }
html[data-tema="scuro"] body .ant-list-item { border-block-end-color: var(--d-border) !important; color: var(--d-text); }
html[data-tema="scuro"] body .ant-badge-count { box-shadow: 0 0 0 2px #04101f; }
html[data-tema="scuro"] body .ant-progress-text { color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-progress-bg { background: #e9af31; }
html[data-tema="scuro"] body .ant-progress-inner { background: rgba(255, 255, 255, .1) !important; }
html[data-tema="scuro"] body .ant-skeleton-content .ant-skeleton-title,
html[data-tema="scuro"] body .ant-skeleton-paragraph > li { background: rgba(255, 255, 255, .08) !important; }
/* ===== finestre, cassetti, notifiche ===== */
html[data-tema="scuro"] body .ant-modal .ant-modal-content,
html[data-tema="scuro"] body .ant-drawer .ant-drawer-content,
html[data-tema="scuro"] body .ant-drawer-content-wrapper .ant-drawer-body,
html[data-tema="scuro"] body .ant-drawer .ant-drawer-header { background: #0d2238 !important; color: var(--d-text); }
html[data-tema="scuro"] body .ant-modal .ant-modal-content { box-shadow: 0 40px 120px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .1) !important; }
html[data-tema="scuro"] body .ant-modal .ant-modal-header { background: transparent !important; }
html[data-tema="scuro"] body .ant-modal .ant-modal-title,
html[data-tema="scuro"] body .ant-drawer-title { color: #fff !important; }
html[data-tema="scuro"] body .ant-modal .ant-modal-close,
html[data-tema="scuro"] body .ant-drawer-close { color: var(--d-muted) !important; }
html[data-tema="scuro"] body .ant-modal .ant-modal-close:hover { background: rgba(255, 255, 255, .08) !important; color: #fff !important; }
html[data-tema="scuro"] body .ant-modal .ant-modal-footer { border-top: 0; }
html[data-tema="scuro"] body .ant-modal-mask,
html[data-tema="scuro"] body .ant-drawer-mask { background: rgba(2, 8, 16, .66) !important; }
html[data-tema="scuro"] body .ant-popover .ant-popover-inner,
html[data-tema="scuro"] body .ant-popconfirm .ant-popover-inner { background: #0f263f !important; color: var(--d-text); box-shadow: 0 22px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1) !important; }
html[data-tema="scuro"] body .ant-popover .ant-popover-title,
html[data-tema="scuro"] body .ant-popconfirm .ant-popconfirm-title,
html[data-tema="scuro"] body .ant-popover .ant-popover-inner-content,
html[data-tema="scuro"] body .ant-popconfirm-description { color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-popover-arrow::before,
html[data-tema="scuro"] body .ant-popover-arrow::after { background: #0f263f; }
html[data-tema="scuro"] body .ant-tooltip .ant-tooltip-inner { background: #1a3a5c; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1); }
html[data-tema="scuro"] body .ant-tooltip .ant-tooltip-arrow::before { background: #1a3a5c; }
html[data-tema="scuro"] body .ant-message .ant-message-notice-content,
html[data-tema="scuro"] body .ant-notification .ant-notification-notice { background: #0f263f !important; color: var(--d-text); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1) !important; }
html[data-tema="scuro"] body .ant-notification .ant-notification-notice-message { color: #fff; }
html[data-tema="scuro"] body .ant-notification .ant-notification-notice-description { color: var(--d-muted); }
/* ===== parti con CSS proprio dell'app: notebook, agenda, chat ===== */
html[data-tema="scuro"] body .notebook-split-container,
html[data-tema="scuro"] body .notebook-left-panel,
html[data-tema="scuro"] body .section-item,
html[data-tema="scuro"] body .page-item,
html[data-tema="scuro"] body .page-editor,
html[data-tema="scuro"] body .editor-header,
html[data-tema="scuro"] body .notes-container,
html[data-tema="scuro"] body .search-results,
html[data-tema="scuro"] body .result-item,
html[data-tema="scuro"] body .schedule-page-daily,
html[data-tema="scuro"] body .calendar-sidebar,
html[data-tema="scuro"] body .daily-header,
html[data-tema="scuro"] body .chat-layout .ant-layout-sider,
html[data-tema="scuro"] body .chat-sidebar-header,
html[data-tema="scuro"] body .chat-main-header,
html[data-tema="scuro"] body .chat-messages-area,
html[data-tema="scuro"] body .chat-input-area,
html[data-tema="scuro"] body .chat-reply-preview,
html[data-tema="scuro"] body .chat-file-preview,
html[data-tema="scuro"] body .chat-agency-selector,
html[data-tema="scuro"] body .chat-excel-table,
html[data-tema="scuro"] body .chat-readonly-notice,
html[data-tema="scuro"] body .chat-date-separator span,
html[data-tema="scuro"] body .chat-drag-overlay-content {
  background: rgba(255, 255, 255, .035) !important; color: var(--d-text) !important; border-color: var(--d-border) !important;
}
html[data-tema="scuro"] body .chat-layout .ant-layout-sider { background: #07192d !important; }
html[data-tema="scuro"] body .section-item:hover,
html[data-tema="scuro"] body .page-item:hover,
html[data-tema="scuro"] body .result-item:hover,
html[data-tema="scuro"] body .btn-toggle-left-panel:hover,
html[data-tema="scuro"] body .btn-expand-left-panel:hover,
html[data-tema="scuro"] body .btn-toggle-sidebar:hover,
html[data-tema="scuro"] body .btn-rename:hover,
html[data-tema="scuro"] body .btn-delete:hover,
html[data-tema="scuro"] body .btn-cancel-rename:hover,
html[data-tema="scuro"] body .chat-excel-table tbody tr:hover { background: rgba(255, 255, 255, .08) !important; color: #fff !important; }
html[data-tema="scuro"] body .page-item.selected { background: rgba(233, 175, 49, .16) !important; }
html[data-tema="scuro"] body .page,
html[data-tema="scuro"] body .section-name,
html[data-tema="scuro"] body .page-name,
html[data-tema="scuro"] body .page-item.selected .page-name,
html[data-tema="scuro"] body .section-header h4,
html[data-tema="scuro"] body .pages-header h4,
html[data-tema="scuro"] body .editor-header h4,
html[data-tema="scuro"] body .modal-content h4,
html[data-tema="scuro"] body .result-day-header,
html[data-tema="scuro"] body .date-display h1,
html[data-tema="scuro"] body .chat-reply-preview-author,
html[data-tema="scuro"] body .chat-excel-table th,
html[data-tema="scuro"] body .saved-indicator { color: var(--d-text) !important; }
html[data-tema="scuro"] body .editor-textarea,
html[data-tema="scuro"] body .notes-textarea,
html[data-tema="scuro"] body .chat-textarea,
html[data-tema="scuro"] body .chat-textarea:disabled { background: rgba(255, 255, 255, .05) !important; color: #fff !important; border-color: var(--d-border) !important; }
html[data-tema="scuro"] body .modal-content,
html[data-tema="scuro"] body .btn-secondary,
html[data-tema="scuro"] body .btn-nav,
html[data-tema="scuro"] body .btn-today,
html[data-tema="scuro"] body .btn-toggle-sidebar,
html[data-tema="scuro"] body .chat-file-preview-remove { background: #0d2238 !important; color: var(--d-text) !important; border-color: var(--d-border) !important; }
html[data-tema="scuro"] body .auto-save-badge.saving,
html[data-tema="scuro"] body .auto-save-badge.saved,
html[data-tema="scuro"] body .auto-save-indicator.saving,
html[data-tema="scuro"] body .auto-save-indicator.saved { background: rgba(255, 255, 255, .08) !important; color: var(--d-text) !important; }
html[data-tema="scuro"] body .auto-save-badge.error,
html[data-tema="scuro"] body .auto-save-indicator.error { background: rgba(224, 82, 70, .2) !important; color: #ff9d94 !important; }
html[data-tema="scuro"] body .chat-msg-bubble.other { background: rgba(255, 255, 255, .09) !important; color: var(--d-text) !important; }
html[data-tema="scuro"] body .chat-msg-bubble.broadcast,
html[data-tema="scuro"] body .chat-msg-bubble.selective { color: #1b2433; }
html[data-tema="scuro"] body .chat-msg-reply.own { background: rgba(233, 175, 49, .18) !important; }
html[data-tema="scuro"] body .sidebar-typing-badge { color: #1b2433; }
html[data-tema="scuro"] body .ant-picker-calendar,
html[data-tema="scuro"] body .ant-picker-calendar .ant-picker-panel { background: transparent !important; color: var(--d-text); }
html[data-tema="scuro"] body .ant-picker-calendar .ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner::before { border-color: #e9af31 !important; }
html[data-tema="scuro"] body .ant-menu-light,
html[data-tema="scuro"] body .ant-menu-light.ant-menu-root { background: transparent !important; color: var(--d-text) !important; border-inline-end-color: var(--d-border) !important; }
html[data-tema="scuro"] body .ant-menu-light .ant-menu-item,
html[data-tema="scuro"] body .ant-menu-light .ant-menu-submenu-title { color: var(--d-text) !important; }
html[data-tema="scuro"] body .ant-menu-light .ant-menu-item:hover { background: rgba(255, 255, 255, .07) !important; }
html[data-tema="scuro"] body .ant-menu-light .ant-menu-item-selected { background: rgba(233, 175, 49, .17) !important; color: #ffd57f !important; }
html[data-tema="scuro"] body .ant-menu-light .ant-menu-item-divider { border-color: var(--d-border) !important; }
html[data-tema="scuro"] body [style*="border-color: rgb(240, 240, 240)"] { border-top-color: rgba(255, 255, 255, .1) !important; border-right-color: rgba(255, 255, 255, .1) !important; border-bottom-color: rgba(255, 255, 255, .1) !important; background: rgba(255, 255, 255, .04) !important; }
html[data-tema="scuro"] body [style*="border: 1px solid rgb(240, 240, 240)"],
html[data-tema="scuro"] body [style*="border: 1px solid rgb(217, 217, 217)"],
html[data-tema="scuro"] body [style*="border: 1px solid #f0f0f0"],
html[data-tema="scuro"] body [style*="border: 1px solid #d9d9d9"] { border-color: var(--d-border) !important; }
html[data-tema="scuro"] body .ant-statistic-content,
html[data-tema="scuro"] body .ant-statistic-content-value,
html[data-tema="scuro"] body .ant-statistic-content-suffix { white-space: nowrap; }
html[data-tema="scuro"] body .ant-statistic-content { display: flex; align-items: baseline; flex-wrap: nowrap; }
/* ===== scorrimento ===== */
html[data-tema="scuro"] * { scrollbar-color: rgba(255, 255, 255, .22) transparent; }
html[data-tema="scuro"] *::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); background-clip: content-box; }
html[data-tema="scuro"] *::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .36); background-clip: content-box; }

/* ===== pulsante del tema (in alto) ===== */
.ub-tema-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 0 6px; padding: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .24); transition: background .15s, transform .15s; flex: none; line-height: 1; }
.ub-tema-btn:hover { background: rgba(255, 255, 255, .24); transform: rotate(18deg); }
.ub-tema-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(233, 175, 49, .45); }
.ub-tema-btn svg { width: 17px; height: 17px; }
.ub-tema-btn .ub-luna { display: none; }
html[data-tema="scuro"] .ub-tema-btn .ub-sole { display: none; }
html[data-tema="scuro"] .ub-tema-btn .ub-luna { display: block; }

/* ---------- varie ---------- */
body .mobile-menu-btn { border-radius: 10px; }
/* notifiche dell'app (react-toastify) nel tema scuro */
html[data-tema="scuro"] body .Toastify__toast { background: #0d2238 !important; color: var(--d-text) !important; border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px !important; box-shadow: 0 18px 50px rgba(0, 0, 0, .55) !important; }
html[data-tema="scuro"] body .Toastify__close-button { color: var(--d-muted) !important; opacity: .8; }
html[data-tema="scuro"] body .Toastify__progress-bar { opacity: .9; }
body .Toastify__toast { border-radius: 14px !important; font-family: var(--ub-font); }
@media (max-width: 991px) {
  body .ant-layout-header { height: auto !important; min-height: 56px; line-height: normal !important; padding: 8px 12px !important; }
  body .ant-layout-header > .ant-flex { flex-wrap: wrap; row-gap: 6px; column-gap: 8px; }
  body .ant-layout-header .ant-btn { height: 30px; padding: 0 11px; font-size: 12px; }
}
@media (max-width: 768px) {
  body .main-content { padding: 12px 10px 28px !important; }
  body .content-card { padding: 14px !important; border-radius: 16px !important; }
  body .ant-table-wrapper .ant-table-thead > tr > th, body .ant-table-wrapper .ant-table-tbody > tr > td { padding: 8px 10px !important; font-size: 12.5px; }
  body .ant-modal .ant-modal-content { padding: 18px 16px !important; border-radius: 18px !important; }
  body .ant-btn:not(.ant-btn-sm) { height: 34px; padding: 0 13px; }
}
@media (prefers-reduced-motion: reduce) { body *, body *::before, body *::after { animation: none !important; transition: none !important; } }
@media print { body .ant-layout-sider, body .ant-layout-header { display: none !important; } body .content-card { box-shadow: none !important; border: 0; } }

/* Pagina Reti (home admin): le righe delle agenzie dentro una rete hanno lo sfondo #fafafa scritto nel codice dell'app.
   Sul tema scuro il testo e' chiaro, quindi si leggeva bianco su bianco. Si riconoscono dallo stile in linea
   (React lo scrive come rgb(250, 250, 250)), non da una classe: React le riscrive. */
html[data-tema="scuro"] body [style*="background: rgb(250, 250, 250)"] { background: rgba(255, 255, 255, .06) !important; border: 1px solid var(--d-border); color: var(--d-text); }
html[data-tema="scuro"] body [style*="background: rgb(250, 250, 250)"] .ant-typography,
html[data-tema="scuro"] body [style*="background: rgb(250, 250, 250)"] .anticon { color: var(--d-text) !important; }
