/* page-standard.css — standard unico per le pagine caricate nel contenuto centrale. */
body.gest-page-content {
  --app-page-gutter: clamp(1rem, 1.6vw, 1.6rem);
  --app-footer-height: 86px;
  --app-footer-clearance: clamp(1rem, 1.4vw, 1.5rem);
  --app-footer-reserved: calc(var(--app-footer-height) + var(--app-footer-clearance));
  --app-content-max: 1760px;
  --app-content-width: calc(100% - (var(--app-page-gutter) * 2));
  --shell-topbar-h: 72px;
  --page-bg: #f2f8ff;
  --page-surface: rgba(255,255,255,.78);
  --page-surface-soft: rgba(238,248,255,.68);
  --page-border: rgba(168,205,235,.62);
  --page-border-soft: #edf2f7;
  --page-text: #172033;
  --page-muted: #64748b;
  --page-accent: #007fff;
  --page-accent-soft: rgba(0, 127, 255, .08);
  --page-success: #16825d;
  --page-danger: #dc2626;
  margin: 0 !important;
  min-height: 100vh;
  --page-glass-bg: #eef8ff;
  --page-glass-blur: none;
  background: var(--page-glass-bg) !important;
  background-attachment: scroll !important;
  color: var(--page-text) !important;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  -webkit-font-smoothing: antialiased;
  padding: var(--app-page-gutter) 0 var(--app-page-gutter) !important;
  scroll-padding-bottom: var(--app-footer-reserved);
}

body.gest-page-content *,
body.gest-page-content *::before,
body.gest-page-content *::after {
  box-sizing: border-box;
}

body.gest-page-content i[class^="bi-"],
body.gest-page-content i[class*=" bi-"] {
  font-family: "bootstrap-icons" !important;
}

body.gest-page-content i.bi-file-earmark-pdf,
body.gest-page-content i.bi-file-earmark-pdf-fill,
body.gest-page-content i.bi-file-pdf,
body.gest-page-content i.bi-filetype-pdf {
  width: 1.45em;
  height: 1.45em;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: #d93025 !important;
  color: #fff !important;
  border-radius: .28em;
  font-size: .95em;
  line-height: 1;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .18), 0 1px 2px rgba(127, 29, 29, .18);
  vertical-align: -.18em;
}

body.gest-page-content i.bi-file-earmark-pdf::before,
body.gest-page-content i.bi-file-earmark-pdf-fill::before,
body.gest-page-content i.bi-file-pdf::before,
body.gest-page-content i.bi-filetype-pdf::before {
  color: #fff !important;
}

body.gest-page-content > :not(script):not(style):not(link):not(.loading-overlay):not(.success-overlay) {
  width: var(--app-content-width) !important;
  max-width: 1760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.gest-page-content .main-content,
body.gest-page-content .container,
body.gest-page-content .container-fluid,
body.gest-page-content main,
body.gest-page-content .wrap,
body.gest-page-content .page,
body.gest-page-content .page-wrap {
  width: var(--app-content-width) !important;
  max-width: 1760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.gest-page-content > .main-content,
body.gest-page-content > .container,
body.gest-page-content > .container-fluid,
body.gest-page-content > main,
body.gest-page-content > .wrap,
body.gest-page-content > .page,
body.gest-page-content > .page-wrap {
  padding: 0 !important;
}

body.gest-page-content .stepper-wrapper {
  width: var(--app-content-width) !important;
  max-width: 1760px !important;
  margin: 0 auto var(--app-page-gutter) !important;
}

/* Master layout per le pagine avvolte dalla sidebar/header universale. */
body.gest-page-content.design-a-body .content-wrap {
  width: var(--app-content-width) !important;
  max-width: var(--app-content-max) !important;
  margin: 0 auto !important;
  padding: 0 0 var(--app-footer-reserved) !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content > .wrap,
body.gest-page-content.design-a-body .content-wrap > .legacy-content > .container,
body.gest-page-content.design-a-body .content-wrap > .legacy-content > .container-fluid,
body.gest-page-content.design-a-body .content-wrap > .legacy-content > .page,
body.gest-page-content.design-a-body .content-wrap > .legacy-content > .page-wrap,
body.gest-page-content.design-a-body .content-wrap > .legacy-content > main,
body.gest-page-content.design-a-body .content-wrap > .legacy-content > .main-content {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Shell interne tipo E-mail: stesso punto di partenza verticale del Task Manager.
   Il padding del body fornisce gia' il gutter superiore, quindi la toolbar non
   deve aggiungere ulteriore margine sopra. */
body.gest-page-content > .app-shell {
  width: var(--app-content-width) !important;
  max-width: 1760px !important;
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - (var(--app-page-gutter) * 2)) !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body.gest-page-content > .app-shell .email-topbar {
  width: 100% !important;
  margin: 0 0 var(--app-page-gutter) !important;
  box-sizing: border-box !important;
}

body.gest-page-content > .app-shell .app-body {
  width: 100% !important;
  margin: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content > .app-shell {
  width: 100% !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - var(--shell-topbar-h) - (var(--app-page-gutter) * 2)) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content > .app-shell .email-topbar {
  width: 100% !important;
  margin: 0 0 var(--app-page-gutter) !important;
  box-sizing: border-box !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content > .app-shell .app-body {
  width: 100% !important;
  margin: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

body.gest-page-content > .tm-page {
  display: grid !important;
  width: var(--app-content-width) !important;
  max-width: var(--app-content-max) !important;
  height: calc(100vh - (var(--app-page-gutter) * 2)) !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  gap: var(--app-page-gutter) !important;
  box-sizing: border-box !important;
}

body.gest-page-content > .tm-page.no-detail {
  grid-template-columns: 260px minmax(0, 1fr) !important;
}

body.gest-page-content > .tm-page:not(.no-detail) {
  grid-template-columns: 260px minmax(0, 1fr) 380px !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content > .tm-page {
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  height: calc(100vh - var(--shell-topbar-h) - (var(--app-page-gutter) * 2)) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: var(--app-page-gutter) !important;
  box-sizing: border-box !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content > .tm-page.no-detail {
  grid-template-columns: 260px minmax(0, 1fr) !important;
}

body.gest-page-content.design-a-body .content-wrap > .legacy-content > .tm-page:not(.no-detail) {
  grid-template-columns: 260px minmax(0, 1fr) 380px !important;
}

body.gest-page-content .tm-left,
body.gest-page-content .tm-center,
body.gest-page-content .tm-detail {
  margin: 0 !important;
}

body.gest-page-content > .container.foto-editor-page,
body.gest-page-content > .container:has(> .page-title-block),
body.gest-page-content.design-a-body .content-wrap > .legacy-content > .foto-editor-page {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.gest-page-content > .container.foto-editor-page #usageCard:empty,
body.gest-page-content.design-a-body .content-wrap > .legacy-content > .foto-editor-page #usageCard:empty {
  display: none !important;
}

body.gest-page-content h1,
body.gest-page-content h2,
body.gest-page-content h3,
body.gest-page-content h4,
body.gest-page-content h5,
body.gest-page-content h6 {
  color: var(--page-text) !important;
  letter-spacing: -.015em;
}

body.gest-page-content h1 {
  font-size: clamp(1.45rem, 2vw, 2rem) !important;
  font-weight: 800 !important;
  margin: 0 0 1rem !important;
}

body.gest-page-content .page-title-block {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 auto .85rem !important;
  box-shadow: none !important;
}

body.gest-page-content .page-title-main {
  display: flex !important;
  align-items: center !important;
  gap: .5rem !important;
  margin: 0 !important;
  color: var(--page-text) !important;
  font-size: 1.3rem !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
}

body.gest-page-content .page-title-main i,
body.gest-page-content .page-title-icon {
  width: auto !important;
  height: auto !important;
  flex: 0 0 auto !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--page-accent) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
}

body.gest-page-content .page-title-kicker {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 24px !important;
  padding: .16rem .52rem !important;
  border-radius: 999px !important;
  background: #f8fafc !important;
  border: 1px solid var(--page-border) !important;
  color: var(--page-muted) !important;
  font-size: .78rem !important;
  font-weight: 650 !important;
  letter-spacing: .01em !important;
}

body.gest-page-content .page-title-desc {
  display: none !important;
}

@media (max-width: 720px) {
  body.gest-page-content .page-title-block {
    padding: 0 !important;
    border-radius: 0 !important;
  }

  body.gest-page-content .page-title-main {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    font-size: 1.22rem !important;
  }

  body.gest-page-content .page-title-desc {
    margin-left: 0 !important;
  }
}

body.gest-page-content h2,
body.gest-page-content .step-title {
  font-size: 1.08rem !important;
  font-weight: 750 !important;
}

body.gest-page-content p,
body.gest-page-content small,
body.gest-page-content .text-muted {
  color: var(--page-muted) !important;
}

body.gest-page-content .card,
body.gest-page-content .step-card,
body.gest-page-content .main-card,
body.gest-page-content .card-panel,
body.gest-page-content .card-section,
body.gest-page-content .panel,
body.gest-page-content .box,
body.gest-page-content .gen-form-panel,
body.gest-page-content .info-box,
body.gest-page-content .ai-result-card,
body.gest-page-content .doc-section-group,
body.gest-page-content .stat-card,
body.gest-page-content .stat-box {
  background: rgba(255, 255, 255, .96) !important;
  border: 1px solid var(--page-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06) !important;
}

body.gest-page-content .card,
body.gest-page-content .step-card,
body.gest-page-content .main-card,
body.gest-page-content .card-panel,
body.gest-page-content .card-section,
body.gest-page-content .panel,
body.gest-page-content .box,
body.gest-page-content .gen-form-panel,
body.gest-page-content .doc-section-group {
  padding: 1.25rem 1.35rem !important;
  margin-bottom: 1rem !important;
}

body.gest-page-content .card-header,
body.gest-page-content .step-title,
body.gest-page-content .section-title,
body.gest-page-content .gen-form-panel-header,
body.gest-page-content .doc-section-header {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--page-border-soft) !important;
  color: var(--page-text) !important;
  padding: 0 0 .7rem !important;
  margin: 0 0 1rem !important;
  display: flex;
  align-items: center;
  gap: .55rem;
}

body.gest-page-content .title-icon,
body.gest-page-content .step-title .title-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: var(--page-accent-soft) !important;
  color: var(--page-accent) !important;
}

body.gest-page-content .form-label,
body.gest-page-content label {
  color: #27364d !important;
  font-size: .86rem !important;
  font-weight: 650 !important;
  margin-bottom: .3rem !important;
}

body.gest-page-content .form-control,
body.gest-page-content .form-select,
body.gest-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body.gest-page-content textarea,
body.gest-page-content select {
  background-color: #fff !important;
  border: 1.5px solid var(--page-border) !important;
  border-radius: 10px !important;
  color: var(--page-text) !important;
  font-size: .92rem !important;
  min-height: 42px;
  box-shadow: none !important;
}

body.gest-page-content textarea {
  min-height: 92px;
  resize: vertical;
}

body.gest-page-content .form-control:focus,
body.gest-page-content .form-select:focus,
body.gest-page-content input:focus,
body.gest-page-content textarea:focus,
body.gest-page-content select:focus {
  border-color: var(--page-accent) !important;
  box-shadow: 0 0 0 4px rgba(0, 127, 255, .13) !important;
  outline: none !important;
}

body.gest-page-content .btn,
body.gest-page-content button:not(.accordion-button):not(.btn-close) {
  border-radius: 10px !important;
  font-weight: 650 !important;
  min-height: 40px;
}

body.gest-page-content .btn-primary,
body.gest-page-content .btn-primary-custom,
body.gest-page-content .btn-accent,
body.gest-page-content .btn-sm-accent {
  background: var(--page-accent) !important;
  border-color: var(--page-accent) !important;
  color: #fff !important;
}

body.gest-page-content .btn-outline-primary,
body.gest-page-content .btn-outline-custom {
  border-color: var(--page-accent) !important;
  color: var(--page-accent) !important;
  background: #fff !important;
}

body.gest-page-content .btn-outline-primary:hover,
body.gest-page-content .btn-outline-custom:hover {
  background: var(--page-accent-soft) !important;
}

body.gest-page-content button:has(i.bi-trash),
body.gest-page-content button:has(i.bi-trash3),
body.gest-page-content button:has(i.bi-trash-fill),
body.gest-page-content button:has(i.bi-trash3-fill),
body.gest-page-content .btn:has(i.bi-trash),
body.gest-page-content .btn:has(i.bi-trash3),
body.gest-page-content .btn:has(i.bi-trash-fill),
body.gest-page-content .btn:has(i.bi-trash3-fill) {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .4rem !important;
  text-align: center !important;
}

body.gest-page-content button:has(i.bi-trash):hover,
body.gest-page-content button:has(i.bi-trash3):hover,
body.gest-page-content button:has(i.bi-trash-fill):hover,
body.gest-page-content button:has(i.bi-trash3-fill):hover,
body.gest-page-content .btn:has(i.bi-trash):hover,
body.gest-page-content .btn:has(i.bi-trash3):hover,
body.gest-page-content .btn:has(i.bi-trash-fill):hover,
body.gest-page-content .btn:has(i.bi-trash3-fill):hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}

body.gest-page-content button:has(i.bi-trash) i,
body.gest-page-content button:has(i.bi-trash3) i,
body.gest-page-content button:has(i.bi-trash-fill) i,
body.gest-page-content button:has(i.bi-trash3-fill) i,
body.gest-page-content .btn:has(i.bi-trash) i,
body.gest-page-content .btn:has(i.bi-trash3) i,
body.gest-page-content .btn:has(i.bi-trash-fill) i,
body.gest-page-content .btn:has(i.bi-trash3-fill) i {
  color: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

body.gest-page-content table,
body.gest-page-content .table {
  background: #fff !important;
  border: 1px solid var(--page-border) !important;
  border-radius: 14px !important;
  overflow: hidden;
}

body.gest-page-content .table thead th,
body.gest-page-content table thead th {
  background: var(--page-surface-soft) !important;
  color: #42526b !important;
  font-size: .76rem !important;
  font-weight: 750 !important;
  text-transform: uppercase;
  letter-spacing: .045em;
  border-bottom: 1px solid var(--page-border) !important;
}

body.gest-page-content .alert {
  border-radius: 14px !important;
  border-width: 1px !important;
  box-shadow: none !important;
}

body.gest-page-content .nav-tabs,
body.gest-page-content .tab-nav,
body.gest-page-content .wizard-steps,
body.gest-page-content .stepper-wrapper {
  background: rgba(255, 255, 255, .9) !important;
  border: 1px solid var(--page-border) !important;
  border-radius: 14px !important;
  padding: .45rem !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04) !important;
  margin-bottom: 1rem !important;
}

body.gest-page-content .nav-tabs .nav-link,
body.gest-page-content .tab-btn {
  border-radius: 10px !important;
  border: 0 !important;
  color: var(--page-muted) !important;
  font-weight: 650 !important;
}

body.gest-page-content .nav-tabs .nav-link.active,
body.gest-page-content .tab-btn.active {
  background: var(--page-accent-soft) !important;
  color: var(--page-accent) !important;
}

/* Footer/azioni: regola unica piu avanti nel Bottom bar master. */

body.gest-page-content .drop-zone,
body.gest-page-content .upload-sec-box,
body.gest-page-content input[type="file"] {
  background: var(--page-surface-soft) !important;
  border: 1px dashed #b8c5d8 !important;
  border-radius: 14px !important;
}

@media (max-width: 900px) {
  body.gest-page-content {
    padding: .9rem .85rem 5.5rem !important;
    overflow-x: hidden !important;
  }

  body.gest-page-content .card,
  body.gest-page-content .step-card,
  body.gest-page-content .main-card,
  body.gest-page-content .gen-form-panel {
    padding: 1rem !important;
    border-radius: 14px !important;
  }

  body.gest-page-content .stepper-wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }

}

@media (max-width: 640px) {
  body.gest-page-content h1 {
    font-size: 1.28rem !important;
  }

  body.gest-page-content h2,
  body.gest-page-content .step-title {
    font-size: 1rem !important;
  }

  body.gest-page-content .form-control,
  body.gest-page-content .form-select,
  body.gest-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  body.gest-page-content textarea,
  body.gest-page-content select {
    font-size: 16px !important;
  }

  body.gest-page-content .nav-tabs,
  body.gest-page-content .tab-nav,
  body.gest-page-content .wizard-steps,
  body.gest-page-content .stepper-wrapper {
    border-radius: 14px !important;
  }
}

/* ============================================================
   FORM CONTRAST SYSTEM
   Regola madre per tutta l'app:
   - pagina: azzurro/grigio chiarissimo
   - sezione/card: bianco
   - area campi: grigio chiarissimo
   - input: bianco
   Cambiando questi token cambia tutto il gestionale.
============================================================ */
body.gest-page-content{
  --ui-page-bg:#eef5fc;
  --ui-section-bg:#ffffff;
  --ui-fields-bg:#f3f7fb;
  --ui-fields-bg-soft:#f6f9fc;
  --ui-input-bg:#ffffff;
  --ui-border:#d7e2ef;
  --ui-border-strong:#c7d4e5;
  --ui-text:#0f172a;
  --ui-muted:#64748b;
  background:
    radial-gradient(circle at 8% 0%, rgba(0,127,255,.08), transparent 26rem),
    linear-gradient(180deg,#f7fbff 0%,var(--ui-page-bg) 100%)!important;
}

body.gest-page-content .card,
body.gest-page-content .step-card,
body.gest-page-content .main-card,
body.gest-page-content .card-panel,
body.gest-page-content .card-section,
body.gest-page-content .section-card,
body.gest-page-content .panel,
body.gest-page-content .box,
body.gest-page-content .gen-form-panel,
body.gest-page-content .doc-section-group,
body.gest-page-content .ai-result-card,
body.gest-page-content .preview-card,
body.gest-page-content .riepilogo,
body.gest-page-content .summary{
  background:var(--ui-section-bg)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:18px!important;
  box-shadow:0 16px 42px rgba(15,23,42,.06)!important;
}

body.gest-page-content .card-header,
body.gest-page-content .step-title,
body.gest-page-content .section-title,
body.gest-page-content .gen-form-panel-header,
body.gest-page-content .doc-section-header{
  background:transparent!important;
  border-bottom:1px solid #e6edf5!important;
  padding-bottom:.8rem!important;
  margin-bottom:1rem!important;
}

body.gest-page-content .sub-card,
body.gest-page-content .persona-fields-box,
body.gest-page-content .form-grid,
body.gest-page-content .fields-box,
body.gest-page-content .fields-panel,
body.gest-page-content .input-panel,
body.gest-page-content .form-panel,
body.gest-page-content .form-section-body,
body.gest-page-content [id$="-fields"],
body.gest-page-content [id*="-fields-"],
body.gest-page-content .upload-sec-box,
body.gest-page-content .ai-upload-wrap,
body.gest-page-content .ai-upload-field,
body.gest-page-content .drop-zone,
body.gest-page-content .search-box.search-box,
body.gest-page-content .summary,
body.gest-page-content .preview-card,
body.gest-page-content .riepilogo{
  background:var(--ui-fields-bg)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:12px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75)!important;
}

body.gest-page-content .card > form,
body.gest-page-content .step-card > form,
body.gest-page-content .main-card > form,
body.gest-page-content .card-panel > form,
body.gest-page-content .card-section > form,
body.gest-page-content .gen-form-panel > form{
  background:var(--ui-fields-bg)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:12px!important;
  padding:1rem!important;
}

/* Search archivio/clienti: resta sempre giallo, anche dentro card e form grigi. */
body.gest-page-content .cerca-db-wrap.cerca-db-wrap{
  position:relative!important;
  background:#fef9c3!important;
  border:1.5px solid #facc15!important;
  border-radius:12px!important;
  padding:.8rem!important;
  box-shadow:0 1px 3px rgba(234,179,8,.12)!important;
}
body.gest-page-content .cerca-db-wrap .input-group-text,
body.gest-page-content .cerca-db-wrap .form-control,
body.gest-page-content .cerca-db-wrap .form-select{
  background:#fff!important;
  border-color:#facc15!important;
}
/* Regola madre: nei box gialli di ricerca/selezione l'icona non deve mai
   essere incollata al campo compilabile. Vale per agenti, clienti e simili. */
body.gest-page-content .cerca-db-wrap .input-group{
  display:flex!important;
  align-items:stretch!important;
  gap:.55rem!important;
  flex-wrap:nowrap!important;
}
body.gest-page-content .cerca-db-wrap .input-group > .input-group-text{
  flex:0 0 44px!important;
  width:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid #facc15!important;
  border-radius:10px!important;
  padding:0!important;
  margin:0!important;
}
body.gest-page-content .cerca-db-wrap .input-group > .form-control,
body.gest-page-content .cerca-db-wrap .input-group > .form-select{
  flex:1 1 auto!important;
  width:auto!important;
  min-width:0!important;
  border:1px solid #facc15!important;
  border-radius:10px!important;
  margin:0!important;
}
body.gest-page-content .cerca-db-wrap .input-group > .border-start-0{
  border-left:1px solid #facc15!important;
}
body.gest-page-content .cerca-db-wrap .input-group > .border-end-0{
  border-right:1px solid #facc15!important;
}
body.gest-page-content .cerca-db-wrap .form-control:focus,
body.gest-page-content .cerca-db-wrap .form-select:focus{
  border-color:#eab308!important;
  box-shadow:0 0 0 .15rem rgba(234,179,8,.2)!important;
}

body.gest-page-content .card > .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .step-card > .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .main-card > .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .card-section > .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .gen-form-panel > .row:has(input,select,textarea,.form-control,.form-select){
  background:var(--ui-fields-bg)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:12px!important;
  padding:.85rem!important;
  margin-left:0!important;
  margin-right:0!important;
}

body.gest-page-content .card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .step-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .main-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .card-section .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .gen-form-panel .row:has(input,select,textarea,.form-control,.form-select){
  background:var(--ui-fields-bg)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:12px!important;
  padding:.85rem!important;
  margin-left:0!important;
  margin-right:0!important;
}

body.gest-page-content .step-card .row .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .card .row .row:has(input,select,textarea,.form-control,.form-select){
  background:var(--ui-fields-bg-soft)!important;
}

body.gest-page-content .form-control,
body.gest-page-content .form-select,
body.gest-page-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
body.gest-page-content textarea,
body.gest-page-content select{
  background:var(--ui-input-bg)!important;
  border:1px solid var(--ui-border-strong)!important;
  border-radius:10px!important;
  color:var(--ui-text)!important;
  box-shadow:0 1px 2px rgba(15,23,42,.035)!important;
}

body.gest-page-content .form-control::placeholder,
body.gest-page-content textarea::placeholder,
body.gest-page-content input::placeholder{
  color:#b4c0cf!important;
}

body.gest-page-content label,
body.gest-page-content .form-label{
  color:var(--ui-text)!important;
  font-weight:750!important;
}

body.gest-page-content .form-text,
body.gest-page-content .help-text,
body.gest-page-content small{
  color:var(--ui-muted)!important;
}

/* AI extraction buttons: standard master arancione + altezza campo upload. */
body.gest-page-content{
  --ui-ai:#f97316;
  --ui-ai-dark:#ea580c;
  --ui-ai-soft:#fff7ed;
}
body.gest-page-content .btn-extract-ai,
body.gest-page-content .ai-btn-extract,
body.gest-page-content .btn-ai,
body.gest-page-content .btn-ai-extract,
body.gest-page-content button[onclick*="estrai" i],
body.gest-page-content button[onclick*="extract" i],
body.gest-page-content button[id*="estrai" i],
body.gest-page-content button[id*="extract" i],
body.gest-page-content button[class*="extract" i],
body.gest-page-content button[class*="ai" i]:not(.btn-close){
  background:linear-gradient(135deg,var(--ui-ai) 0%,var(--ui-ai-dark) 100%)!important;
  border:1px solid var(--ui-ai-dark)!important;
  color:#fff!important;
  border-radius:10px!important;
  font-weight:800!important;
  box-shadow:0 8px 18px rgba(249,115,22,.24)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:.45rem!important;
  white-space:nowrap!important;
}
body.gest-page-content .btn-extract-ai:hover,
body.gest-page-content .ai-btn-extract:hover,
body.gest-page-content .btn-ai:hover,
body.gest-page-content .btn-ai-extract:hover,
body.gest-page-content button[onclick*="estrai" i]:hover,
body.gest-page-content button[onclick*="extract" i]:hover,
body.gest-page-content button[id*="estrai" i]:hover,
body.gest-page-content button[id*="extract" i]:hover,
body.gest-page-content button[class*="extract" i]:hover,
body.gest-page-content button[class*="ai" i]:not(.btn-close):hover{
  background:linear-gradient(135deg,#fb923c 0%,#c2410c 100%)!important;
  border-color:#c2410c!important;
  color:#fff!important;
  transform:translateY(-1px);
}
body.gest-page-content .upload-sec-box,
body.gest-page-content .ai-upload-wrap,
body.gest-page-content .ai-upload-field{
  align-items:stretch!important;
}
body.gest-page-content .upload-sec-box > div:has(.dz-mini,.ai-dropzone,.drop-zone,.btn-extract-ai,.ai-btn-extract),
body.gest-page-content .ai-upload-wrap > div:has(.dz-mini,.ai-dropzone,.drop-zone,.btn-extract-ai,.ai-btn-extract),
body.gest-page-content .ai-upload-field > div:has(.dz-mini,.ai-dropzone,.drop-zone,.btn-extract-ai,.ai-btn-extract){
  align-items:stretch!important;
}
body.gest-page-content .upload-sec-box .dz-mini,
body.gest-page-content .upload-sec-box .ai-dropzone,
body.gest-page-content .upload-sec-box .drop-zone,
body.gest-page-content .ai-upload-wrap .dz-mini,
body.gest-page-content .ai-upload-wrap .ai-dropzone,
body.gest-page-content .ai-upload-wrap .drop-zone,
body.gest-page-content .ai-upload-field .dz-mini,
body.gest-page-content .ai-upload-field .ai-dropzone,
body.gest-page-content .ai-upload-field .drop-zone{
  min-height:48px!important;
}
body.gest-page-content .upload-sec-box .btn-extract-ai,
body.gest-page-content .upload-sec-box .ai-btn-extract,
body.gest-page-content .upload-sec-box button[onclick*="estrai" i],
body.gest-page-content .upload-sec-box button[onclick*="extract" i],
body.gest-page-content .upload-sec-box button[class*="extract" i],
body.gest-page-content .ai-upload-wrap .btn-extract-ai,
body.gest-page-content .ai-upload-wrap .ai-btn-extract,
body.gest-page-content .ai-upload-wrap button[onclick*="estrai" i],
body.gest-page-content .ai-upload-wrap button[onclick*="extract" i],
body.gest-page-content .ai-upload-wrap button[class*="extract" i],
body.gest-page-content .ai-upload-field .btn-extract-ai,
body.gest-page-content .ai-upload-field .ai-btn-extract,
body.gest-page-content .ai-upload-field button[onclick*="estrai" i],
body.gest-page-content .ai-upload-field button[onclick*="extract" i],
body.gest-page-content .ai-upload-field button[class*="extract" i]{
  align-self:stretch!important;
  min-height:100%!important;
  height:auto!important;
  padding:.65rem 1.05rem!important;
}

/* ============================================================
   MASTER BUTTON SYSTEM
   Un solo standard per tutta l'app: stessa altezza, font,
   raggio, centratura icone/testo. Le pagine possono cambiare
   solo il ruolo colore, non le dimensioni.
============================================================ */
body.gest-page-content{
  --ui-btn-height:46px;
  --ui-btn-radius:10px;
  --ui-btn-font-size:.95rem;
  --ui-btn-font-weight:650;
  --ui-btn-pad-x:1.15rem;
  --ui-btn-gap:.48rem;
  --ui-btn-primary:#007fff;
  --ui-btn-primary-dark:#0066cc;
  --ui-btn-secondary:#64748b;
  --ui-btn-danger:#ef4444;
  --ui-btn-danger-dark:#b91c1c;
}
body.gest-page-content .btn,
body.gest-page-content a.btn,
body.gest-page-content button:not(.btn-close):not(.accordion-button),
body.gest-page-content input[type="button"],
body.gest-page-content input[type="submit"],
body.gest-page-content input[type="reset"]{
  min-height:var(--ui-btn-height)!important;
  height:var(--ui-btn-height)!important;
  padding:.62rem var(--ui-btn-pad-x)!important;
  border-radius:var(--ui-btn-radius)!important;
  font-size:var(--ui-btn-font-size)!important;
  font-weight:var(--ui-btn-font-weight)!important;
  line-height:1!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:var(--ui-btn-gap)!important;
  text-align:center!important;
  white-space:nowrap!important;
  vertical-align:middle!important;
  box-sizing:border-box!important;
  letter-spacing:0!important;
  text-transform:none!important;
}
body.gest-page-content .btn i,
body.gest-page-content button:not(.btn-close):not(.accordion-button) i,
body.gest-page-content a.btn i{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  font-size:1rem!important;
  margin:0!important;
}
body.gest-page-content .btn-sm,
body.gest-page-content .btn-lg,
body.gest-page-content .btn-sm-accent,
body.gest-page-content .btn-add-card,
body.gest-page-content .btn-add-persona,
body.gest-page-content .btn-add-delegante,
body.gest-page-content .preview-nav-btn{
  min-height:var(--ui-btn-height)!important;
  height:var(--ui-btn-height)!important;
  padding:.62rem var(--ui-btn-pad-x)!important;
  font-size:var(--ui-btn-font-size)!important;
  border-radius:var(--ui-btn-radius)!important;
}
body.gest-page-content .btn-primary,
body.gest-page-content .btn-primary-custom,
body.gest-page-content .btn-accent,
body.gest-page-content .btn-sm-accent,
body.gest-page-content .btn-add-card,
body.gest-page-content .btn-add-persona,
body.gest-page-content .btn-add-delegante{
  background:linear-gradient(135deg,var(--ui-btn-primary) 0%,var(--ui-btn-primary-dark) 100%)!important;
  border:1px solid var(--ui-btn-primary-dark)!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(0,127,255,.22)!important;
}
body.gest-page-content .btn-outline-primary,
body.gest-page-content .btn-outline-custom,
body.gest-page-content .btn-outline-secondary,
body.gest-page-content .preview-nav-btn{
  background:#fff!important;
  border:1px solid #b8c8da!important;
  color:var(--ui-btn-primary)!important;
  box-shadow:0 4px 12px rgba(15,23,42,.04)!important;
}
body.gest-page-content .btn-secondary,
body.gest-page-content .btn-light{
  background:#f8fafc!important;
  border:1px solid #cbd5e1!important;
  color:var(--ui-btn-secondary)!important;
  box-shadow:0 4px 12px rgba(15,23,42,.04)!important;
}
body.gest-page-content .btn-danger,
body.gest-page-content .btn-reset,
body.gest-page-content .btn-reset-danger,
body.gest-page-content .btn-outline-danger,
body.gest-page-content button:has(i.bi-trash),
body.gest-page-content button:has(i.bi-trash3),
body.gest-page-content button:has(i.bi-trash-fill),
body.gest-page-content button:has(i.bi-trash3-fill){
  background:linear-gradient(135deg,var(--ui-btn-danger) 0%,var(--ui-btn-danger-dark) 100%)!important;
  border:1px solid var(--ui-btn-danger-dark)!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(239,68,68,.22)!important;
}
body.gest-page-content .btn:hover,
body.gest-page-content button:not(.btn-close):not(.accordion-button):hover,
body.gest-page-content a.btn:hover{
  filter:brightness(.98);
}
body.gest-page-content .btn:disabled,
body.gest-page-content button:disabled,
body.gest-page-content input[type="button"]:disabled,
body.gest-page-content input[type="submit"]:disabled{
  opacity:.48!important;
  cursor:not-allowed!important;
  transform:none!important;
  box-shadow:none!important;
}

/* AI resta variante arancione, ma eredita lo stesso standard dimensionale. */
body.gest-page-content .btn-extract-ai,
body.gest-page-content .ai-btn-extract,
body.gest-page-content .btn-ai,
body.gest-page-content .btn-ai-extract,
body.gest-page-content button[onclick*="estrai" i],
body.gest-page-content button[onclick*="extract" i],
body.gest-page-content button[id*="estrai" i],
body.gest-page-content button[id*="extract" i],
body.gest-page-content button[class*="extract" i],
body.gest-page-content button[class*="ai" i]:not(.btn-close){
  background:linear-gradient(135deg,var(--ui-ai) 0%,var(--ui-ai-dark) 100%)!important;
  border:1px solid var(--ui-ai-dark)!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(249,115,22,.24)!important;
}

/* ============================================================
   MASTER FINAL UI CONTRACT
   Questo blocco e' l'ultima regola grafica: ogni nuova pagina
   eredita upload AI, bottoni e bottom bar senza override locali.
============================================================ */
body.gest-page-content{
  --ui-ai:#f97316;
  --ui-ai-dark:#ea580c;
  --ui-ai-border:#fb923c;
  --ui-ai-soft:#fff7ed;
  --ui-ai-soft-strong:#ffedd5;
  --ui-btn-font-weight:650;
}

/* Upload/crop/AI: contenitore grigio standard, campo upload arancione chiaro,
   bottone arancione pieno. Il tratteggio non va mai sul contenitore esterno. */
body.gest-page-content .upload-sec-box,
body.gest-page-content .ai-upload-wrap,
body.gest-page-content .ai-upload-field,
body.gest-page-content .proposal-upload-box{
  background:var(--ui-fields-bg)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:14px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75)!important;
}

body.gest-page-content .dz,
body.gest-page-content .drop-zone,
body.gest-page-content .file-drop-zone,
body.gest-page-content .upload-zone{
  background:var(--ui-ai-soft)!important;
  border:1px dashed var(--ui-ai-border)!important;
  border-radius:14px!important;
  box-shadow:0 8px 22px rgba(249,115,22,.08)!important;
}

body.gest-page-content .dz-mini,
body.gest-page-content .dz,
body.gest-page-content .ai-dropzone,
body.gest-page-content .ai-upload-dz,
body.gest-page-content .dropzone,
body.gest-page-content .drop-zone-inner,
body.gest-page-content .upload-drop,
body.gest-page-content .upload-dropzone{
  background:#fffaf3!important;
  border:1px dashed var(--ui-ai-border)!important;
  border-radius:12px!important;
  color:#9a3412!important;
  font-weight:550!important;
  min-height:54px!important;
}

body.gest-page-content .dz-mini:hover,
body.gest-page-content .dz-mini.drag-over,
body.gest-page-content .dz-mini.over,
body.gest-page-content .dz:hover,
body.gest-page-content .dz.drag-over,
body.gest-page-content .dz.over,
body.gest-page-content .ai-dropzone:hover,
body.gest-page-content .ai-upload-dz:hover,
body.gest-page-content .drop-zone:hover,
body.gest-page-content .drop-zone.drag-over,
body.gest-page-content .upload-dropzone:hover{
  background:var(--ui-ai-soft-strong)!important;
  border-color:var(--ui-ai-dark)!important;
  color:#7c2d12!important;
}

body.gest-page-content .btn-extract-ai,
body.gest-page-content .ai-btn-extract,
body.gest-page-content .btn-ai,
body.gest-page-content .btn-ai-extract,
body.gest-page-content .btn-sm-accent,
body.gest-page-content button[onclick*="estrai" i],
body.gest-page-content button[onclick*="extract" i],
body.gest-page-content button[id*="estrai" i],
body.gest-page-content button[id*="extract" i],
body.gest-page-content button[class*="extract" i],
body.gest-page-content button[class*="ai" i]:not(.btn-close){
  background:linear-gradient(135deg,var(--ui-ai) 0%,var(--ui-ai-dark) 100%)!important;
  border:1px solid var(--ui-ai-dark)!important;
  color:#fff!important;
  font-weight:650!important;
  min-height:var(--ui-btn-height)!important;
  height:var(--ui-btn-height)!important;
  border-radius:var(--ui-btn-radius)!important;
  box-shadow:0 8px 18px rgba(249,115,22,.24)!important;
}

body.gest-page-content .upload-sec-box .btn-extract-ai,
body.gest-page-content .upload-sec-box .ai-btn-extract,
body.gest-page-content .upload-sec-box .btn-sm-accent,
body.gest-page-content .upload-sec-box button[onclick*="estrai" i],
body.gest-page-content .upload-sec-box button[onclick*="extract" i],
body.gest-page-content .ai-upload-wrap .btn-extract-ai,
body.gest-page-content .ai-upload-wrap .ai-btn-extract,
body.gest-page-content .ai-upload-wrap .btn-sm-accent,
body.gest-page-content .proposal-upload-box .btn-sm-accent,
body.gest-page-content .proposal-upload-box button[onclick*="estrai" i],
body.gest-page-content .proposal-upload-box button[onclick*="extract" i]{
  align-self:stretch!important;
  min-height:54px!important;
  height:auto!important;
}

/* Evita il caos visivo dei box grigi annidati nei soggetti dinamici:
   la persona-card e' gia' il pannello grigio; dentro rimangono solo campi bianchi
   e, quando serve, il solo campo upload arancione. */
body.gest-page-content .persona-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .person-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .subject-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .persona-card .radio-group,
body.gest-page-content .person-card .radio-group,
body.gest-page-content .subject-card .radio-group{
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding:0!important;
  margin-left:0!important;
  margin-right:0!important;
}

body.gest-page-content .persona-card .upload-sec-box,
body.gest-page-content .person-card .upload-sec-box,
body.gest-page-content .subject-card .upload-sec-box,
body.gest-page-content .persona-card .proposal-upload-box,
body.gest-page-content .person-card .proposal-upload-box,
body.gest-page-content .subject-card .proposal-upload-box{
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding:0!important;
}

/* Bottoni: stessa struttura ma peso piu' leggero e leggibile. */
body.gest-page-content .btn,
body.gest-page-content a.btn,
body.gest-page-content button:not(.btn-close):not(.accordion-button),
body.gest-page-content input[type="button"],
body.gest-page-content input[type="submit"],
body.gest-page-content input[type="reset"]{
  font-weight:var(--ui-btn-font-weight)!important;
}

/* Form dinamici: bridge master per componenti creati da JS nelle pagine wizard.
   Esempi: proposta di locazione/acquisto, soggetti multipli, clausole e radio card. */
body.gest-page-content .persona-card,
body.gest-page-content .person-card,
body.gest-page-content .subject-card,
body.gest-page-content .dynamic-card,
body.gest-page-content .clausola-row,
body.gest-page-content .clause-row,
body.gest-page-content .fieldset-card{
  background:#fff!important;
  border:1px solid var(--ui-border)!important;
  border-left:4px solid var(--page-accent)!important;
  border-radius:14px!important;
  box-shadow:none!important;
  padding:1.25rem 1rem 1rem!important;
  margin-bottom:1rem!important;
}

body.gest-page-content .persona-card.locatore,
body.gest-page-content .person-card.locatore,
body.gest-page-content .subject-card.locatore{
  border-left-color:var(--ui-ai)!important;
}

body.gest-page-content .persona-card-header,
body.gest-page-content .person-card-header,
body.gest-page-content .subject-card-header{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:1rem!important;
  margin-bottom:.95rem!important;
}

body.gest-page-content .persona-card-title,
body.gest-page-content .person-card-title,
body.gest-page-content .subject-card-title{
  color:var(--ui-text)!important;
  font-size:.9rem!important;
  font-weight:750!important;
  letter-spacing:0!important;
  text-transform:none!important;
}

body.gest-page-content .persona-card-title .persona-num,
body.gest-page-content .person-card-title .persona-num,
body.gest-page-content .subject-card-title .persona-num{
  background:var(--page-accent)!important;
  color:#fff!important;
}

body.gest-page-content .radio-group{
  background:var(--ui-fields-bg)!important;
  border:1px solid var(--ui-border)!important;
  border-radius:12px!important;
  padding:.55rem!important;
  gap:.55rem!important;
}

body.gest-page-content .radio-btn{
  background:#fff!important;
  border:1px solid var(--ui-border-strong)!important;
  border-radius:10px!important;
  color:var(--ui-text)!important;
  font-weight:600!important;
  min-height:42px!important;
  padding:.55rem .8rem!important;
  box-shadow:0 1px 2px rgba(15,23,42,.035)!important;
}

body.gest-page-content .radio-btn:hover{
  border-color:var(--page-accent)!important;
  background:#f8fbff!important;
}

body.gest-page-content .radio-btn.selected{
  background:var(--page-accent-soft)!important;
  border-color:var(--page-accent)!important;
  color:var(--page-accent)!important;
}

body.gest-page-content .section-divider{
  color:var(--ui-muted)!important;
  font-size:.78rem!important;
  font-weight:750!important;
  letter-spacing:.055em!important;
  margin:1.1rem 0 .75rem!important;
}

body.gest-page-content .section-divider::before,
body.gest-page-content .section-divider::after{
  background:var(--ui-border)!important;
}

/* Regola finale sui soggetti: niente box grigi dentro box grigi. */
body.gest-page-content .persona-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .person-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .subject-card .row:has(input,select,textarea,.form-control,.form-select),
body.gest-page-content .persona-card .radio-group,
body.gest-page-content .person-card .radio-group,
body.gest-page-content .subject-card .radio-group{
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding:0!important;
  margin-left:0!important;
  margin-right:0!important;
}

body.gest-page-content .persona-card .upload-sec-box,
body.gest-page-content .person-card .upload-sec-box,
body.gest-page-content .subject-card .upload-sec-box,
body.gest-page-content .persona-card .proposal-upload-box,
body.gest-page-content .person-card .proposal-upload-box,
body.gest-page-content .subject-card .proposal-upload-box{
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding:0!important;
}

/* Bottom bar: una sola regola assoluta, sempre ancorata al bordo basso. */
body.gest-page-content:has(.nav-footer),
body.gest-page-content:has(.actions-bottom),
body.gest-page-content:has(.form-actions),
body.gest-page-content:has(.step-actions),
body.gest-page-content:has(.wizard-actions),
body.gest-page-content:has(.proposta-nav-footer){
  padding-bottom:var(--app-footer-reserved)!important;
  scroll-padding-bottom:var(--app-footer-reserved)!important;
}

/* Safe area assoluta per i form con footer fisso.
   Il footer resta ancorato, ma l'ultimo blocco della pagina deve sempre
   poter scorrere sopra di lui con un piccolo margine visibile. */
body.gest-page-content .content-wrap:has(.nav-footer),
body.gest-page-content .content-wrap:has(.actions-bottom),
body.gest-page-content .content-wrap:has(.form-actions),
body.gest-page-content .content-wrap:has(.step-actions),
body.gest-page-content .content-wrap:has(.wizard-actions),
body.gest-page-content .content-wrap:has(.proposta-nav-footer),
body.gest-page-content .legacy-content:has(.nav-footer),
body.gest-page-content .legacy-content:has(.actions-bottom),
body.gest-page-content .legacy-content:has(.form-actions),
body.gest-page-content .legacy-content:has(.step-actions),
body.gest-page-content .legacy-content:has(.wizard-actions),
body.gest-page-content .legacy-content:has(.proposta-nav-footer),
body.gest-page-content .wrap:has(.nav-footer),
body.gest-page-content .wrap:has(.actions-bottom),
body.gest-page-content .wrap:has(.form-actions),
body.gest-page-content .wrap:has(.step-actions),
body.gest-page-content .wrap:has(.wizard-actions),
body.gest-page-content .wrap:has(.proposta-nav-footer),
body.gest-page-content .page-wrap:has(.nav-footer),
body.gest-page-content .page-wrap:has(.actions-bottom),
body.gest-page-content .page-wrap:has(.form-actions),
body.gest-page-content .page-wrap:has(.step-actions),
body.gest-page-content .page-wrap:has(.wizard-actions),
body.gest-page-content .page-wrap:has(.proposta-nav-footer),
body.gest-page-content main:has(.nav-footer),
body.gest-page-content main:has(.actions-bottom),
body.gest-page-content main:has(.form-actions),
body.gest-page-content main:has(.step-actions),
body.gest-page-content main:has(.wizard-actions),
body.gest-page-content main:has(.proposta-nav-footer){
  padding-bottom:var(--app-footer-reserved)!important;
}

body.gest-page-content .nav-footer,
body.gest-page-content .actions-bottom,
body.gest-page-content .form-actions,
body.gest-page-content .step-actions,
body.gest-page-content .wizard-actions,
body.gest-page-content .proposta-nav-footer{
  position:fixed!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  width:100vw!important;
  max-width:100vw!important;
  min-height:86px!important;
  margin:0!important;
  transform:none!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
  align-items:center!important;
  gap:1rem!important;
  padding:1rem var(--app-page-gutter)!important;
  border-radius:18px 18px 0 0!important;
  background:#ffffff!important;
  border:1px solid var(--page-border)!important;
  border-bottom:0!important;
  box-shadow:0 -8px 20px rgba(15,50,90,.08)!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  z-index:760!important;
}

/* Regola madre: niente doppi footer.
   Se una vecchia pagina contiene ancora un wrapper interno, lo neutralizziamo:
   la barra footer resta una sola e i bottoni vengono allineati dalla griglia master. */
body.gest-page-content .actions-bottom > .actions-bottom-inner,
body.gest-page-content .nav-footer > .nav-footer-inner,
body.gest-page-content .form-actions > .form-actions-inner,
body.gest-page-content .step-actions > .step-actions-inner,
body.gest-page-content .wizard-actions > .wizard-actions-inner{
  display:contents!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  margin:0!important;
  border-radius:0!important;
}

html body.gest-page-content > .nav-footer,
html body.gest-page-content > .actions-bottom,
html body.gest-page-content > .form-actions,
html body.gest-page-content > .step-actions,
html body.gest-page-content > .wizard-actions,
html body.gest-page-content > .proposta-nav-footer{
  width:100vw!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
  left:0!important;
  right:0!important;
}

html body.gest-page-content > .nav-footer.nav-footer.nav-footer,
html body.gest-page-content > .actions-bottom.actions-bottom.actions-bottom,
html body.gest-page-content > .form-actions.form-actions.form-actions,
html body.gest-page-content > .step-actions.step-actions.step-actions,
html body.gest-page-content > .wizard-actions.wizard-actions.wizard-actions,
html body.gest-page-content > .proposta-nav-footer.proposta-nav-footer.proposta-nav-footer{
  width:100vw!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
  left:0!important;
  right:0!important;
}

body.gest-page-content .nav-footer-left,
body.gest-page-content .actions-bottom .left,
body.gest-page-content .form-actions .left,
body.gest-page-content .step-actions .left,
body.gest-page-content .wizard-actions .left{
  grid-column:1!important;
  justify-self:start!important;
  justify-content:flex-start!important;
  position:static!important;
  transform:none!important;
}

body.gest-page-content .nav-footer-center,
body.gest-page-content .actions-bottom .center,
body.gest-page-content .form-actions .center,
body.gest-page-content .step-actions .center,
body.gest-page-content .wizard-actions .center,
body.gest-page-content .nav-footer > div:not(.nav-footer-left):not(.nav-footer-right):not(:first-child):not(:last-child){
  grid-column:2!important;
  justify-self:center!important;
  justify-content:center!important;
  text-align:center!important;
  position:static!important;
  transform:none!important;
}

body.gest-page-content .nav-footer-right,
body.gest-page-content .actions-bottom .right,
body.gest-page-content .form-actions .right,
body.gest-page-content .step-actions .right,
body.gest-page-content .wizard-actions .right{
  grid-column:3!important;
  justify-self:end!important;
  justify-content:flex-end!important;
  position:static!important;
  transform:none!important;
}

body.gest-page-content .nav-footer > :first-child:not(.nav-footer-center):not(.nav-footer-right),
body.gest-page-content .actions-bottom > :first-child:not(.center):not(.right),
body.gest-page-content .form-actions > :first-child:not(.center):not(.right),
body.gest-page-content .step-actions > :first-child:not(.center):not(.right),
body.gest-page-content .wizard-actions > :first-child:not(.center):not(.right){
  grid-column:1!important;
  justify-self:start!important;
  position:static!important;
  transform:none!important;
}

body.gest-page-content .nav-footer > :last-child:not(.nav-footer-center):not(.nav-footer-left),
body.gest-page-content .actions-bottom > :last-child:not(.center):not(.left),
body.gest-page-content .form-actions > :last-child:not(.center):not(.left),
body.gest-page-content .step-actions > :last-child:not(.center):not(.left),
body.gest-page-content .wizard-actions > :last-child:not(.center):not(.left){
  grid-column:3!important;
  justify-self:end!important;
  position:static!important;
  transform:none!important;
}

body.gest-page-content .nav-footer button,
body.gest-page-content .actions-bottom button,
body.gest-page-content .form-actions button,
body.gest-page-content .step-actions button,
body.gest-page-content .wizard-actions button{
  min-width:0!important;
}

@media(max-width:760px){
  body.gest-page-content:has(.nav-footer),
  body.gest-page-content:has(.actions-bottom),
  body.gest-page-content:has(.form-actions),
  body.gest-page-content:has(.step-actions),
  body.gest-page-content:has(.wizard-actions),
  body.gest-page-content:has(.proposta-nav-footer){
    padding-bottom:calc((var(--app-footer-height) * 2) + var(--app-footer-clearance))!important;
  }
  body.gest-page-content .nav-footer,
  body.gest-page-content .actions-bottom,
  body.gest-page-content .form-actions,
  body.gest-page-content .step-actions,
  body.gest-page-content .wizard-actions,
  body.gest-page-content .proposta-nav-footer{
    grid-template-columns:1fr!important;
    min-height:0!important;
    gap:.6rem!important;
    padding:.8rem!important;
  }
  body.gest-page-content .nav-footer > *,
  body.gest-page-content .actions-bottom > *,
  body.gest-page-content .form-actions > *,
  body.gest-page-content .step-actions > *,
  body.gest-page-content .wizard-actions > *{
    grid-column:1!important;
    justify-self:stretch!important;
    width:100%!important;
  }
}

/* Override anti-deriva: vince anche sugli stili locali storici della proposta. */
body.gest-page-content .upload-sec-box .dz-mini,
body.gest-page-content .proposal-upload-box .dz-mini,
body.gest-page-content .dz,
body.gest-page-content .upload-sec-box .dz-mini.ai-upload-dz,
body.gest-page-content .proposal-upload-box .dz-mini.ai-upload-dz,
body.gest-page-content .ai-upload-wrap .dz-mini,
body.gest-page-content .ai-upload-field .dz-mini,
body.gest-page-content .upload-sec-box .ai-dropzone,
body.gest-page-content .proposal-upload-box .ai-dropzone,
body.gest-page-content .upload-sec-box .drop-zone,
body.gest-page-content .proposal-upload-box .drop-zone{
  background:#fffaf3!important;
  border:1px dashed var(--ui-ai-border)!important;
  color:#9a3412!important;
}

body.gest-page-content .upload-sec-box .dz-mini:hover,
body.gest-page-content .proposal-upload-box .dz-mini:hover,
body.gest-page-content .upload-sec-box .dz-mini.drag-over,
body.gest-page-content .proposal-upload-box .dz-mini.drag-over,
body.gest-page-content .upload-sec-box .dz-mini.over,
body.gest-page-content .proposal-upload-box .dz-mini.over,
body.gest-page-content .dz:hover,
body.gest-page-content .dz.drag-over,
body.gest-page-content .dz.over{
  background:var(--ui-ai-soft-strong)!important;
  border-color:var(--ui-ai-dark)!important;
  color:#7c2d12!important;
}

body.gest-page-content .upload-sec-box .btn-sm-accent,
body.gest-page-content .proposal-upload-box .btn-sm-accent,
body.gest-page-content .upload-sec-box .btn-extract-ai,
body.gest-page-content .proposal-upload-box .btn-extract-ai,
body.gest-page-content .upload-sec-box .ai-btn-extract,
body.gest-page-content .proposal-upload-box .ai-btn-extract,
body.gest-page-content .upload-sec-box button[onclick*="estrai" i],
body.gest-page-content .proposal-upload-box button[onclick*="estrai" i],
body.gest-page-content .upload-sec-box button[onclick*="extract" i],
body.gest-page-content .proposal-upload-box button[onclick*="extract" i]{
  background:linear-gradient(135deg,var(--ui-ai) 0%,var(--ui-ai-dark) 100%)!important;
  border:1px solid var(--ui-ai-dark)!important;
  color:#fff!important;
  font-weight:650!important;
}

/* ===== PAGE TITLE CANONICAL MASTER =====
   Ultimo override per le pagine gest-page-content: impedisce ai CSS locali
   di trasformare i titoli in box, icone colorate o formati fuori standard. */
body.gest-page-content {
  --app-title-size: 1.3rem;
  --app-title-weight: 700;
  --app-title-gap: .5rem;
  --app-title-margin: 0 0 .85rem;
}

body.gest-page-content .page-title-block,
body.gest-page-content .wrap > .page-title-block,
body.gest-page-content .container > .page-title-block,
body.gest-page-content .container-fluid > .page-title-block,
body.gest-page-content .main-content > .page-title-block,
body.gest-page-content .page-title-host > .page-title-block {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: var(--app-title-margin) !important;
}

body.gest-page-content .page-title-main,
body.gest-page-content h1.t,
body.gest-page-content h1.imp-title,
body.gest-page-content .tm-head h1,
body.gest-page-content .wrap > h1:first-child,
body.gest-page-content .container > h1:first-child,
body.gest-page-content .container-fluid > h1:first-child,
body.gest-page-content .main-content > h1:first-child,
body.gest-page-content main > h1:first-child {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: var(--app-title-gap) !important;
  margin: var(--app-title-margin) !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--page-text, #0f172a) !important;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif !important;
  font-size: var(--app-title-size) !important;
  line-height: 1.15 !important;
  font-weight: var(--app-title-weight) !important;
  letter-spacing: -.01em !important;
  text-transform: none !important;
}

body.gest-page-content .page-title-main > i,
body.gest-page-content h1.t > i,
body.gest-page-content h1.imp-title > i,
body.gest-page-content .tm-head-icon,
body.gest-page-content .tm-head-icon > i,
body.gest-page-content .wrap > h1:first-child > i,
body.gest-page-content .container > h1:first-child > i,
body.gest-page-content .container-fluid > h1:first-child > i,
body.gest-page-content .main-content > h1:first-child > i,
body.gest-page-content main > h1:first-child > i {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: currentColor !important;
  font-size: 1rem !important;
  line-height: 1 !important;
}

body.gest-page-content .tm-head p {
  display: none !important;
}

body.gest-page-content .page-title-desc,
body.gest-page-content .page-title-block > p,
body.gest-page-content h1.t > small,
body.gest-page-content h1.imp-title > small {
  display: none !important;
}

/* ============================================================
   REGOLA MADRE SEARCH / AGENTI / CLIENTI
   Bootstrap input-group tende a unire i bordi con margini negativi e
   classi border-start-0/border-end-0. Questa regola deve vincere sempre:
   icona separata dal campo con gap visibile.
============================================================ */
html body.gest-page-content .cerca-db-wrap .input-group,
html body.gest-page-content .search-box .input-group,
html body.gest-page-content .client-search-wrap .input-group,
html body.gest-page-content .agent-search-wrap .input-group {
  display: flex !important;
  align-items: stretch !important;
  gap: .6rem !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}

html body.gest-page-content .cerca-db-wrap .input-group > *,
html body.gest-page-content .search-box .input-group > *,
html body.gest-page-content .client-search-wrap .input-group > *,
html body.gest-page-content .agent-search-wrap .input-group > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html body.gest-page-content .cerca-db-wrap .input-group > .input-group-text,
html body.gest-page-content .search-box .input-group > .input-group-text,
html body.gest-page-content .client-search-wrap .input-group > .input-group-text,
html body.gest-page-content .agent-search-wrap .input-group > .input-group-text {
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #facc15 !important;
  border-radius: 10px !important;
  background: #fff !important;
}

html body.gest-page-content .cerca-db-wrap .input-group > .form-control,
html body.gest-page-content .cerca-db-wrap .input-group > .form-select,
html body.gest-page-content .search-box .input-group > .form-control,
html body.gest-page-content .search-box .input-group > .form-select,
html body.gest-page-content .client-search-wrap .input-group > .form-control,
html body.gest-page-content .client-search-wrap .input-group > .form-select,
html body.gest-page-content .agent-search-wrap .input-group > .form-control,
html body.gest-page-content .agent-search-wrap .input-group > .form-select {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  border-left: 1px solid #facc15 !important;
  border-right: 1px solid #facc15 !important;
  border-radius: 10px !important;
}

/* ============================================================
   AI_UPLOAD_CANONICAL_V1
   Regola madre upload AI/documenti: stessa grafica per tutti i campi
   di caricamento, anche quando le pagine hanno CSS legacy locale.
   Campo leggero, icona cloud uniforme, testo sobrio e bottone arancione.
============================================================ */
html body.gest-page-content .upload-sec-box,
html body.gest-page-content .ai-upload-wrap,
html body.gest-page-content .proposal-upload-box,
html body.gest-page-content .persona-ai-upload {
  background: var(--ui-fields-bg) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  padding: 1rem !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
}

html body.gest-page-content .upload-sec-box .dz,
html body.gest-page-content .upload-sec-box .dz-mini,
html body.gest-page-content .upload-sec-box .drop-zone,
html body.gest-page-content .upload-sec-box .ai-dropzone,
html body.gest-page-content .upload-sec-box .ai-upload-dz,
html body.gest-page-content .ai-upload-wrap .dz,
html body.gest-page-content .ai-upload-wrap .dz-mini,
html body.gest-page-content .ai-upload-wrap .drop-zone,
html body.gest-page-content .ai-upload-wrap .ai-dropzone,
html body.gest-page-content .ai-upload-wrap .ai-upload-dz,
html body.gest-page-content .proposal-upload-box .dz,
html body.gest-page-content .proposal-upload-box .dz-mini,
html body.gest-page-content .proposal-upload-box .drop-zone,
html body.gest-page-content .proposal-upload-box .ai-dropzone,
html body.gest-page-content .proposal-upload-box .ai-upload-dz,
html body.gest-page-content .persona-ai-upload .dz,
html body.gest-page-content .persona-ai-upload .dz-mini,
html body.gest-page-content .persona-ai-upload .drop-zone,
html body.gest-page-content .persona-ai-upload .ai-dropzone,
html body.gest-page-content .persona-ai-upload .ai-upload-dz,
html body.gest-page-content .drop-zone.ai-upload-dz,
html body.gest-page-content .drop-zone[data-ai-upload="true"] {
  min-height: 108px !important;
  width: 100% !important;
  background: var(--ui-ai-soft) !important;
  border: 1px dashed var(--ui-ai-border) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  color: #475569 !important;
  padding: 1.05rem 1.15rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;
  text-align: center !important;
  font-size: .94rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

html body.gest-page-content .upload-sec-box .dz:hover,
html body.gest-page-content .upload-sec-box .dz-mini:hover,
html body.gest-page-content .upload-sec-box .drop-zone:hover,
html body.gest-page-content .upload-sec-box .ai-dropzone:hover,
html body.gest-page-content .upload-sec-box .ai-upload-dz:hover,
html body.gest-page-content .ai-upload-wrap .dz:hover,
html body.gest-page-content .ai-upload-wrap .dz-mini:hover,
html body.gest-page-content .ai-upload-wrap .drop-zone:hover,
html body.gest-page-content .ai-upload-wrap .ai-dropzone:hover,
html body.gest-page-content .ai-upload-wrap .ai-upload-dz:hover,
html body.gest-page-content .proposal-upload-box .dz:hover,
html body.gest-page-content .proposal-upload-box .dz-mini:hover,
html body.gest-page-content .proposal-upload-box .drop-zone:hover,
html body.gest-page-content .proposal-upload-box .ai-dropzone:hover,
html body.gest-page-content .proposal-upload-box .ai-upload-dz:hover,
html body.gest-page-content .persona-ai-upload .dz:hover,
html body.gest-page-content .persona-ai-upload .dz-mini:hover,
html body.gest-page-content .persona-ai-upload .drop-zone:hover,
html body.gest-page-content .persona-ai-upload .ai-dropzone:hover,
html body.gest-page-content .persona-ai-upload .ai-upload-dz:hover {
  background: var(--ui-ai-soft-strong) !important;
  border-color: var(--ui-ai-dark) !important;
  color: #334155 !important;
}

html body.gest-page-content .upload-sec-box .dz > i,
html body.gest-page-content .upload-sec-box .dz-mini > i,
html body.gest-page-content .upload-sec-box .drop-zone > i,
html body.gest-page-content .upload-sec-box .ai-dropzone > i,
html body.gest-page-content .upload-sec-box .ai-upload-dz > i,
html body.gest-page-content .ai-upload-wrap .dz > i,
html body.gest-page-content .ai-upload-wrap .dz-mini > i,
html body.gest-page-content .ai-upload-wrap .drop-zone > i,
html body.gest-page-content .ai-upload-wrap .ai-dropzone > i,
html body.gest-page-content .ai-upload-wrap .ai-upload-dz > i,
html body.gest-page-content .proposal-upload-box .dz > i,
html body.gest-page-content .proposal-upload-box .dz-mini > i,
html body.gest-page-content .proposal-upload-box .drop-zone > i,
html body.gest-page-content .proposal-upload-box .ai-dropzone > i,
html body.gest-page-content .proposal-upload-box .ai-upload-dz > i,
html body.gest-page-content .persona-ai-upload .dz > i,
html body.gest-page-content .persona-ai-upload .dz-mini > i,
html body.gest-page-content .persona-ai-upload .drop-zone > i,
html body.gest-page-content .persona-ai-upload .ai-dropzone > i,
html body.gest-page-content .persona-ai-upload .ai-upload-dz > i {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 1.9rem !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

html body.gest-page-content .upload-sec-box .dz strong,
html body.gest-page-content .upload-sec-box .dz-mini strong,
html body.gest-page-content .upload-sec-box .drop-zone strong,
html body.gest-page-content .upload-sec-box .ai-dropzone strong,
html body.gest-page-content .upload-sec-box .ai-upload-dz strong,
html body.gest-page-content .ai-upload-wrap .dz strong,
html body.gest-page-content .ai-upload-wrap .dz-mini strong,
html body.gest-page-content .ai-upload-wrap .drop-zone strong,
html body.gest-page-content .ai-upload-wrap .ai-dropzone strong,
html body.gest-page-content .ai-upload-wrap .ai-upload-dz strong,
html body.gest-page-content .proposal-upload-box .dz strong,
html body.gest-page-content .proposal-upload-box .dz-mini strong,
html body.gest-page-content .proposal-upload-box .drop-zone strong,
html body.gest-page-content .proposal-upload-box .ai-dropzone strong,
html body.gest-page-content .proposal-upload-box .ai-upload-dz strong,
html body.gest-page-content .persona-ai-upload .dz strong,
html body.gest-page-content .persona-ai-upload .dz-mini strong,
html body.gest-page-content .persona-ai-upload .drop-zone strong,
html body.gest-page-content .persona-ai-upload .ai-dropzone strong,
html body.gest-page-content .persona-ai-upload .ai-upload-dz strong {
  color: #475569 !important;
  font-size: .95rem !important;
  font-weight: 650 !important;
}

html body.gest-page-content .upload-sec-box .dz small,
html body.gest-page-content .upload-sec-box .dz-mini small,
html body.gest-page-content .upload-sec-box .drop-zone small,
html body.gest-page-content .upload-sec-box .ai-dropzone small,
html body.gest-page-content .upload-sec-box .ai-upload-dz small,
html body.gest-page-content .ai-upload-wrap .dz small,
html body.gest-page-content .ai-upload-wrap .dz-mini small,
html body.gest-page-content .ai-upload-wrap .drop-zone small,
html body.gest-page-content .ai-upload-wrap .ai-dropzone small,
html body.gest-page-content .ai-upload-wrap .ai-upload-dz small,
html body.gest-page-content .proposal-upload-box .dz small,
html body.gest-page-content .proposal-upload-box .dz-mini small,
html body.gest-page-content .proposal-upload-box .drop-zone small,
html body.gest-page-content .proposal-upload-box .ai-dropzone small,
html body.gest-page-content .proposal-upload-box .ai-upload-dz small,
html body.gest-page-content .persona-ai-upload .dz small,
html body.gest-page-content .persona-ai-upload .dz-mini small,
html body.gest-page-content .persona-ai-upload .drop-zone small,
html body.gest-page-content .persona-ai-upload .ai-dropzone small,
html body.gest-page-content .persona-ai-upload .ai-upload-dz small {
  color: #64748b !important;
  font-size: .84rem !important;
  font-weight: 500 !important;
}

html body.gest-page-content .upload-sec-box .btn-extract-ai,
html body.gest-page-content .upload-sec-box .ai-btn-extract,
html body.gest-page-content .upload-sec-box button[onclick*="estrai" i],
html body.gest-page-content .upload-sec-box button[onclick*="extract" i],
html body.gest-page-content .ai-upload-wrap .btn-extract-ai,
html body.gest-page-content .ai-upload-wrap .ai-btn-extract,
html body.gest-page-content .ai-upload-wrap button[onclick*="estrai" i],
html body.gest-page-content .ai-upload-wrap button[onclick*="extract" i],
html body.gest-page-content .proposal-upload-box .btn-extract-ai,
html body.gest-page-content .proposal-upload-box .ai-btn-extract,
html body.gest-page-content .proposal-upload-box button[onclick*="estrai" i],
html body.gest-page-content .proposal-upload-box button[onclick*="extract" i],
html body.gest-page-content .persona-ai-upload .btn-extract-ai,
html body.gest-page-content .persona-ai-upload .ai-btn-extract,
html body.gest-page-content .persona-ai-upload button[onclick*="estrai" i],
html body.gest-page-content .persona-ai-upload button[onclick*="extract" i],
html body.gest-page-content .upload-sec-box .upload-action #btnExtract.btn.btn-extract-ai,
html body.gest-page-content .upload-sec-box .upload-action .btn.btn-extract-ai {
  align-self: stretch !important;
  min-height: 108px !important;
  height: auto !important;
  border-radius: 14px !important;
  font-weight: 650 !important;
}

/* ============================================================
   AI_UPLOAD_CANONICAL_V2
   Assorbe anche i nomi legacy rimasti nelle pagine storiche:
   upload-card/grid/row, dropzone, file-drop, file-upload-area,
   upload-drop e campi con id dz-*. Deve restare in fondo al file.
============================================================ */
html body.gest-page-content :is(
  .upload-box,
  .upload-link-box,
  .ai-field-row,
  .ai-fields-row,
  .ai-upload-field,
  .persona-ai-files
) {
  background: var(--ui-fields-bg) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  padding: 1rem !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
}

/* Layout-only: questi wrapper non devono mai diventare box grigi.
   Il contenitore sezione puo' essere grigio, il campo upload resta arancione. */
html body.gest-page-content :is(
  .upload-card,
  .upload-grid,
  .upload-grid-single,
  .upload-row
) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

html body.gest-page-content :is(
  .dz,
  .dz-mini,
  .drop-zone,
  .dropzone,
  .ai-dropzone,
  .ai-upload-dz,
  .file-drop,
  .file-drop-zone,
  .file-upload-area,
  .upload-area,
  .upload-drop,
  .upload-dropzone,
  .upload-zone
),
html body.gest-page-content [id^="dz-"],
html body.gest-page-content [data-ai-upload="true"] {
  min-height: 108px !important;
  width: 100% !important;
  background: var(--ui-ai-soft) !important;
  border: 1px dashed var(--ui-ai-border) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  color: #475569 !important;
  padding: 1.05rem 1.15rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;
  text-align: center !important;
  font-size: .94rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

html body.gest-page-content :is(
  .dz,
  .dz-mini,
  .drop-zone,
  .dropzone,
  .ai-dropzone,
  .ai-upload-dz,
  .file-drop,
  .file-drop-zone,
  .file-upload-area,
  .upload-area,
  .upload-drop,
  .upload-dropzone,
  .upload-zone
):hover,
html body.gest-page-content :is(
  .dz,
  .dz-mini,
  .drop-zone,
  .dropzone,
  .ai-dropzone,
  .ai-upload-dz,
  .file-drop,
  .file-drop-zone,
  .file-upload-area,
  .upload-area,
  .upload-drop,
  .upload-dropzone,
  .upload-zone
).drag-over,
html body.gest-page-content [id^="dz-"]:hover,
html body.gest-page-content [data-ai-upload="true"]:hover {
  background: var(--ui-ai-soft-strong) !important;
  border-color: var(--ui-ai-dark) !important;
  color: #334155 !important;
}

html body.gest-page-content :is(
  .dz,
  .dz-mini,
  .drop-zone,
  .dropzone,
  .ai-dropzone,
  .ai-upload-dz,
  .file-drop,
  .file-drop-zone,
  .file-upload-area,
  .upload-area,
  .upload-drop,
  .upload-dropzone,
  .upload-zone
) :is(i, .upload-icon, .dz-icon, .drop-icon, .ai-upload-icon, svg),
html body.gest-page-content [id^="dz-"] :is(i, .upload-icon, .dz-icon, .drop-icon, .ai-upload-icon, svg),
html body.gest-page-content [data-ai-upload="true"] :is(i, .upload-icon, .dz-icon, .drop-icon, .ai-upload-icon, svg) {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 1.9rem !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

html body.gest-page-content :is(
  .dz,
  .dz-mini,
  .drop-zone,
  .dropzone,
  .ai-dropzone,
  .ai-upload-dz,
  .file-drop,
  .file-drop-zone,
  .file-upload-area,
  .upload-area,
  .upload-drop,
  .upload-dropzone,
  .upload-zone
) :is(strong, b, .upload-title, .dz-title),
html body.gest-page-content [id^="dz-"] :is(strong, b, .upload-title, .dz-title),
html body.gest-page-content [data-ai-upload="true"] :is(strong, b, .upload-title, .dz-title) {
  color: #475569 !important;
  font-size: .95rem !important;
  font-weight: 650 !important;
}

html body.gest-page-content :is(
  .dz,
  .dz-mini,
  .drop-zone,
  .dropzone,
  .ai-dropzone,
  .ai-upload-dz,
  .file-drop,
  .file-drop-zone,
  .file-upload-area,
  .upload-area,
  .upload-drop,
  .upload-dropzone,
  .upload-zone
) :is(small, .text-muted, .upload-hint, .dz-hint),
html body.gest-page-content [id^="dz-"] :is(small, .text-muted, .upload-hint, .dz-hint),
html body.gest-page-content [data-ai-upload="true"] :is(small, .text-muted, .upload-hint, .dz-hint) {
  color: #64748b !important;
  font-size: .84rem !important;
  font-weight: 500 !important;
}

html body.gest-page-content :is(
  .upload-sec-box,
  .ai-upload-wrap,
  .proposal-upload-box,
  .persona-ai-upload,
  .upload-card,
  .upload-grid,
  .upload-grid-single,
  .upload-row,
  .upload-box,
  .upload-link-box,
  .ai-field-row,
  .ai-fields-row,
  .ai-upload-field,
  .persona-ai-files
) :is(
  .btn-extract-ai,
  .ai-btn-extract,
  .btn-ai,
  .btn-ai-extract,
  .btn-sm-accent,
  button[onclick*="estrai" i],
  button[onclick*="extract" i],
  button[id*="estrai" i],
  button[id*="extract" i],
  button[class*="extract" i]
) {
  align-self: stretch !important;
  min-height: 108px !important;
  height: auto !important;
  border-radius: 14px !important;
  font-weight: 650 !important;
}

/* ============================================================
   NO_NESTED_GREY_PANELS_V1
   Regola madre: mai pannelli grigi annidati dentro pannelli grigi.
   I wrapper interni restano layout-only; i campi reali rimangono bianchi
   o arancione chiaro se sono upload AI.
============================================================ */
html body.gest-page-content :is(
  .settings-body,
  .sub-card,
  .persona-fields-box,
  .form-grid,
  .fields-box,
  .fields-panel,
  .input-panel,
  .form-panel,
  .form-section-body,
  .upload-sec-box,
  .ai-upload-wrap,
  .ai-upload-field,
  .proposal-upload-box,
  .persona-ai-upload
) :is(
  .row,
  .upload-grid,
  .upload-grid-single,
  .upload-card,
  .upload-row
) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* ============================================================
   DELETE_BUTTON_CANONICAL_V1
   Ogni rimozione/cancellazione dentro card dinamiche usa icona cestino
   rossa, quadrata/compatta e centrata. Niente link testuali "Rimuovi".
============================================================ */
html body.gest-page-content :is(
  .btn-remove-icon,
  .btn-delete-icon,
  button[onclick*="removePersona"],
  button[onclick*="remove"][class*="text-danger"],
  button[onclick*="delete"][class*="text-danger"],
  button[onclick*="elimina"][class*="text-danger"]
) {
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  border: 1px solid #b91c1c !important;
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
  color: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  font-size: 0 !important;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(239,68,68,.22) !important;
}

html body.gest-page-content .btn-remove-icon-sm {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 14px rgba(239,68,68,.18) !important;
}

html body.gest-page-content :is(
  .btn-remove-icon,
  .btn-delete-icon,
  button[onclick*="removePersona"],
  button[onclick*="remove"][class*="text-danger"],
  button[onclick*="delete"][class*="text-danger"],
  button[onclick*="elimina"][class*="text-danger"]
):hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
  border-color: #991b1b !important;
  color: #fff !important;
}

html body.gest-page-content :is(
  .btn-remove-icon,
  .btn-delete-icon,
  button[onclick*="removePersona"],
  button[onclick*="remove"][class*="text-danger"],
  button[onclick*="delete"][class*="text-danger"],
  button[onclick*="elimina"][class*="text-danger"]
) i {
  color: #fff !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  margin: 0 !important;
}

html body.gest-page-content :is(
  .btn-remove-icon,
  .btn-delete-icon,
  button[onclick*="removePersona"],
  button[onclick*="remove"][class*="text-danger"],
  button[onclick*="delete"][class*="text-danger"],
  button[onclick*="elimina"][class*="text-danger"]
) i::before {
  content: "\f78a" !important;
  font-family: "bootstrap-icons" !important;
  font-style: normal !important;
  font-weight: 400 !important;
}

html body.gest-page-content :is(
  .btn-remove-icon,
  .btn-delete-icon,
  button[onclick*="removePersona"],
  button[onclick*="remove"][class*="text-danger"],
  button[onclick*="delete"][class*="text-danger"],
  button[onclick*="elimina"][class*="text-danger"]
) :is(span, small) {
  display: none !important;
}

/* ============================================================
   FOTO_EDITOR_CANONICAL_V1
   Allinea foto-editor.html allo stesso linguaggio grafico master:
   sezioni bianche, pannelli interni grigio chiaro, upload arancione
   e card dinamiche leggibili senza stili locali pesanti.
============================================================ */
html body.gest-page-content .foto-editor-page {
  width: 100% !important;
  max-width: none !important;
}

html body.gest-page-content .foto-editor-page :is(.card-main, .settings-accordion) {
  background: var(--ui-section-bg) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 42px rgba(15,23,42,.06) !important;
  padding: 1.35rem !important;
  margin: 0 0 var(--app-page-gutter) !important;
  overflow: visible !important;
}

html body.gest-page-content .foto-editor-page .settings-header,
html body.gest-page-content .foto-editor-page .card-main > h5 {
  min-height: auto !important;
  padding: 0 0 .85rem !important;
  margin: 0 0 1rem !important;
  border: 0 !important;
  border-bottom: 1px solid #e6edf5 !important;
  background: transparent !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: .75rem !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: -.015em !important;
}

html body.gest-page-content .foto-editor-page .settings-header span,
html body.gest-page-content .foto-editor-page .card-main > h5 {
  display: inline-flex !important;
  align-items: center !important;
  gap: .6rem !important;
}

html body.gest-page-content .foto-editor-page .settings-header i:first-child,
html body.gest-page-content .foto-editor-page .card-main > h5 > i:first-child {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  background: #eaf4ff !important;
  color: #007fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
}

html body.gest-page-content .foto-editor-page .settings-body {
  display: none !important;
  padding: 1rem !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  background: var(--ui-fields-bg) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
}

html body.gest-page-content .foto-editor-page .settings-body.open {
  display: block !important;
}

html body.gest-page-content .foto-editor-page .card-main > .row,
html body.gest-page-content .foto-editor-page #statusContent {
  background: var(--ui-fields-bg) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  padding: 1rem !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
}

html body.gest-page-content .foto-editor-page .settings-body > :is(.row, .d-flex, .mt-3) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

html body.gest-page-content .foto-editor-page .dropzone {
  min-height: 150px !important;
  background: var(--ui-ai-soft) !important;
  border: 1px dashed var(--ui-ai-border) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  color: #475569 !important;
  padding: 1.3rem !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;
  text-align: center !important;
}

html body.gest-page-content .foto-editor-page .dropzone:hover,
html body.gest-page-content .foto-editor-page .dropzone.drag {
  background: var(--ui-ai-soft-strong) !important;
  border-color: var(--ui-ai-dark) !important;
}

html body.gest-page-content .foto-editor-page .dropzone i {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 2.15rem !important;
  line-height: 1 !important;
}

html body.gest-page-content .foto-editor-page .dropzone .fw-bold {
  color: #475569 !important;
  font-size: .98rem !important;
  font-weight: 650 !important;
}

html body.gest-page-content .foto-editor-page :is(.file-grid, .wm-gallery) {
  gap: .85rem !important;
}

html body.gest-page-content .foto-editor-page :is(.file-card, .wm-card, .batch-row, .cost-panel, .preview-box) {
  background: var(--ui-input-bg) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 22px rgba(15,23,42,.04) !important;
}

html body.gest-page-content .foto-editor-page .wm-card {
  position: relative !important;
}

html body.gest-page-content .foto-editor-page .file-card {
  padding: .65rem !important;
}

html body.gest-page-content .foto-editor-page .file-card.drop-target {
  border-color: #007fff !important;
  box-shadow: 0 0 0 3px rgba(0,127,255,.16) !important;
  background: #f8fbff !important;
}

html body.gest-page-content .foto-editor-page .file-card .preview {
  background-color: #eef4fb !important;
  border: 1px solid #dbe7f3 !important;
  border-radius: 10px !important;
}

html body.gest-page-content .foto-editor-page .wm-card.selected {
  border-color: #007fff !important;
  box-shadow: 0 0 0 3px rgba(0,127,255,.14) !important;
}

html body.gest-page-content .foto-editor-page .cost-panel {
  border-left: 4px solid #10b981 !important;
}

html body.gest-page-content .foto-editor-page .cost-panel.warn {
  background: #fff7ed !important;
  border-left-color: #f97316 !important;
}

html body.gest-page-content .foto-editor-page :is(.slider-row, .wm-actions, .batch-row) {
  min-width: 0 !important;
}

html body.gest-page-content .foto-editor-page .wm-actions .btn,
html body.gest-page-content .foto-editor-page .file-card .btn {
  min-width: 0 !important;
}

/* ============================================================
   FOTO_EDITOR_QWEN_REFINEMENTS_V1
   Correzioni specifiche QWEN: pannelli coerenti, watermark visibile,
   CTA processing leggibile e preview compatta.
============================================================ */
html body.gest-page-content .foto-editor-qwen-page .card-main > .row {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

html body.gest-page-content .foto-editor-qwen-page .card-main > h5 {
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: .55rem !important;
  text-align: left !important;
  border-bottom: 1px solid #e6edf5 !important;
  padding-bottom: .75rem !important;
}

html body.gest-page-content .foto-editor-qwen-page .qwen-batch-info-panel,
html body.gest-page-content .foto-editor-qwen-page .qwen-watermark-panel {
  background: var(--ui-fields-bg) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  padding: 1rem !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75) !important;
}

html body.gest-page-content .foto-editor-qwen-page .qwen-batch-info-panel .row,
html body.gest-page-content .foto-editor-qwen-page .qwen-watermark-panel .row {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-left: calc(-.5 * var(--bs-gutter-x)) !important;
  margin-right: calc(-.5 * var(--bs-gutter-x)) !important;
}

html body.gest-page-content .foto-editor-qwen-page .qwen-watermark-toggle {
  display: flex !important;
  align-items: center !important;
  gap: .6rem !important;
  min-height: 42px !important;
  margin: 0 !important;
}

html body.gest-page-content .foto-editor-qwen-page #historyList {
  background: var(--ui-fields-bg) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 14px !important;
  padding: .9rem !important;
}

html body.gest-page-content .foto-editor-qwen-page #historyList .batch-row {
  background: var(--ui-input-bg) !important;
}

html body.gest-page-content .foto-editor-qwen-page .qwen-watermark-check {
  width: 1.35rem !important;
  height: 1.35rem !important;
  margin-top: .05rem !important;
  border-width: 2px !important;
}

html body.gest-page-content .foto-editor-qwen-page .qwen-watermark-check + label {
  font-size: 1rem !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
}

html body.gest-page-content .foto-editor-qwen-page .preview-tabs {
  margin-top: .15rem !important;
}

html body.gest-page-content .foto-editor-qwen-page .preview-tabs .btn {
  border-radius: 12px !important;
  min-width: 120px !important;
}

/* ============================================================
   MASTER SOLID CONTENT THEME
   Regola super partes: tutte le pagine respirano sullo stesso
   sfondo azzurrino uniforme della shell, senza blur grafici.
============================================================ */
html body.gest-page-content {
  background: var(--page-glass-bg) !important;
  background-attachment: scroll !important;
}

html body.gest-page-content :is(
  .card,
  .step-card,
  .main-card,
  .card-panel,
  .card-section,
  .section-card,
  .doc-section-group,
  .ai-result-card,
  .preview-card,
  .settings-accordion,
  .email-topbar,
  .email-pane,
  .tm-panel,
  .task-shell,
  .app-shell > .app-body > *,
  .page-title-card
) {
  background: #ffffff !important;
  border-color: var(--page-border) !important;
  box-shadow: 0 10px 28px rgba(15,50,90,.06) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html body.gest-page-content :is(
  .sub-card,
  .form-section-body,
  .settings-body,
  .upload-card,
  .qwen-batch-info-panel,
  .qwen-watermark-panel,
  .persona-card,
  .person-card,
  .subject-card,
  .dynamic-card,
  .fieldset-card,
  .row:has(input, select, textarea, .form-control, .form-select)
) {
  background: #f3f7fb !important;
  border-color: rgba(168,205,235,.58) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html body.gest-page-content :is(
  input,
  select,
  textarea,
  .form-control,
  .form-select,
  .input-group-text
) {
  background-color: rgba(255,255,255,.88) !important;
}

html body.gest-page-content :is(.drop-zone, .ai-dropzone, .ai-upload-dz, [data-ai-upload="true"], [id^="dz-"]) {
  background: rgba(255,247,237,.78) !important;
  border-width: 1px !important;
}

/* ============================================================
   MASTER BUTTON HOVER
   Effetto uniforme ispirato alle card di utility.html:
   leggero lift, bordo accent e ombra morbida. Vale per tutta
   l'app, lasciando fermi bottoni disabilitati e controlli icon-only.
============================================================ */
body.gest-page-content :where(
  button,
  .btn,
  .op-btn,
  .tab-btn,
  .admin-tab,
  .btn-topbar,
  .btn-add-card,
  .btn-extract-ai,
  .btn-outline-primary,
  .btn-outline-secondary,
  .btn-outline-danger,
  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-warning,
  .btn-danger,
  .btn-gdoc,
  .btn-docx,
  .btn-pdf,
  .btn-xlsx,
  .btn-gsheet,
  .output-btns a,
  .doc-format-actions a,
  .doc-format-actions button,
  .actions-bottom button,
  .footer-actions button,
  .preview-tabs .btn
) {
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    background-color .18s ease,
    color .18s ease !important;
  will-change: transform;
}

body.gest-page-content :where(
  button,
  .btn,
  .op-btn,
  .tab-btn,
  .admin-tab,
  .btn-topbar,
  .btn-add-card,
  .btn-extract-ai,
  .btn-outline-primary,
  .btn-outline-secondary,
  .btn-outline-danger,
  .btn-primary,
  .btn-secondary,
  .btn-success,
  .btn-warning,
  .btn-danger,
  .btn-gdoc,
  .btn-docx,
  .btn-pdf,
  .btn-xlsx,
  .btn-gsheet,
  .output-btns a,
  .doc-format-actions a,
  .doc-format-actions button,
  .actions-bottom button,
  .footer-actions button,
  .preview-tabs .btn
):where(:hover, :focus-visible):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 28px rgba(0,127,255,.15) !important;
  border-color: var(--accent) !important;
  text-decoration: none !important;
}

body.gest-page-content :where(
  .btn-primary,
  .btn-primary-grad,
  .btn-add-card,
  .btn-extract-ai,
  .btn-success,
  .btn-danger,
  .btn-pdf,
  .actions-bottom .btn-primary,
  .footer-actions .btn-primary
):where(:hover, :focus-visible):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
  box-shadow: 0 6px 28px rgba(0,127,255,.22) !important;
}

body.gest-page-content :where(
  .btn-remove-icon,
  .btn-remove-icon-sm,
  .close,
  .modal-close,
  .gs-fab,
  .gs-back-fab,
  .page-fab,
  .floating-action,
  .form-check-input,
  .accordion-button,
  .dropdown-toggle
):where(:hover, :focus-visible) {
  will-change: auto;
}

body.gest-page-content :where(
  .btn-remove-icon,
  .btn-remove-icon-sm,
  .close,
  .modal-close,
  .form-check-input
):where(:hover, :focus-visible) {
  transform: none !important;
}

body.gest-page-content :where(
  .btn-danger,
  .btn-outline-danger,
  .btn-remove-icon,
  .btn-remove-icon-sm,
  .trash-btn,
  .delete-btn,
  .remove-btn,
  [data-action="delete"],
  [data-action="remove"]
):where(:hover, :focus-visible):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
  border-color: var(--danger) !important;
  box-shadow: 0 6px 28px rgba(220,38,38,.18) !important;
}

/* ============================================================
   MASTER CLICKABLE HOVER - VISIBLE
   Versione piu' evidente dell'effetto utility.html: vale anche
   per card/tile cliccabili, link-bottone e azioni formato file.
============================================================ */
body.gest-page-content :where(
  button,
  .btn,
  [role="button"],
  a.btn,
  .menu-card,
  .action-card,
  .doc-card,
  .document-card,
  .doc-option,
  .document-option,
  .format-btn,
  .rd-format,
  .quick-action,
  .tile,
  .card-clickable,
  .clickable-card,
  .download-card,
  .deadline-card,
  .task-card
) {
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease,
    background-color .22s ease,
    color .22s ease,
    filter .22s ease !important;
}

body.gest-page-content :where(
  button,
  .btn,
  [role="button"],
  a.btn,
  .menu-card,
  .action-card,
  .doc-card,
  .document-card,
  .doc-option,
  .document-option,
  .format-btn,
  .rd-format,
  .quick-action,
  .tile,
  .card-clickable,
  .clickable-card,
  .download-card,
  .deadline-card,
  .task-card
):where(:hover, :focus-visible):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 30px rgba(0,127,255,.22) !important;
  border-color: var(--accent) !important;
  filter: brightness(1.015) !important;
  text-decoration: none !important;
}

body.gest-page-content :where(
  .btn-outline-primary,
  .btn-outline-secondary,
  .btn-outline-custom,
  .btn-light,
  .btn-white,
  .tab-btn,
  .admin-tab,
  .doc-option,
  .document-option,
  .format-btn,
  .rd-format
):where(:hover, :focus-visible):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
  background-color: #f5fbff !important;
}

body.gest-page-content :where(
  .btn-primary,
  .btn-primary-grad,
  .btn-add-card,
  .btn-extract-ai,
  .btn-success,
  .btn-pdf,
  .btn-gdoc,
  .btn-docx,
  .btn-xlsx,
  .btn-gsheet
):where(:hover, :focus-visible):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
  box-shadow: 0 8px 30px rgba(0,127,255,.28) !important;
}

body.gest-page-content :where(
  .btn-danger,
  .btn-outline-danger,
  .btn-remove-icon,
  .btn-remove-icon-sm,
  .trash-btn,
  .delete-btn,
  .remove-btn,
  [data-action="delete"],
  [data-action="remove"]
):where(:hover, :focus-visible):not(:disabled):not(.disabled):not([aria-disabled="true"]) {
  border-color: var(--danger) !important;
  box-shadow: 0 8px 30px rgba(220,38,38,.22) !important;
}
