/* =====================================================================
   Autoroute 4.0 — Modern Theme Override
   Additive layer over Bootstrap 4 + legacy style.css
   Brand: #064897 (navy blue)
   Font:  Inter (already loaded in avm.cfm head)
   ===================================================================== */

/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
  --ar-primary:        #064897;
  --ar-primary-light:  #1a5fa8;
  --ar-primary-hover:  #053a7a;
  --ar-primary-subtle: #e8eef7;
  --ar-accent:         #2e93e6;

  --ar-bg-page:        #f0f2f5;
  --ar-bg-surface:     #ffffff;
  --ar-bg-sidebar:     #064897;
  --ar-bg-navbar:      #064897;

  --ar-border:         #dce1e9;
  --ar-border-subtle:  #e8ebf0;

  --ar-text-primary:   #1a202c;
  --ar-text-secondary: #556070;
  --ar-text-muted:     #8a97a8;
  --ar-text-on-dark:   #ffffff;

  --ar-radius-sm:      4px;
  --ar-radius:         8px;
  --ar-radius-lg:      12px;

  --ar-shadow-sm:      0 1px 3px rgba(6,72,151,.08), 0 1px 2px rgba(0,0,0,.06);
  --ar-shadow:         0 4px 12px rgba(6,72,151,.10), 0 1px 4px rgba(0,0,0,.07);
  --ar-shadow-lg:      0 8px 24px rgba(6,72,151,.14), 0 2px 8px rgba(0,0,0,.08);

  --ar-transition:     .18s ease;
  --ar-transition-md:  .25s ease;
}

/* ── Base Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 13px;          /* sensible enterprise base */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Helvetica, Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 400;
  color: var(--ar-text-primary) !important;
  background-color: var(--ar-bg-page) !important;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Apply Inter to text nodes without touching icon pseudo-elements.
   Deliberately excludes <i> so Font Awesome ::before is unaffected. */
p, div, span, td, th, li, label, a, button, font,
input, select, textarea, h1, h2, h3, h4, h5, h6,
.form-control, .btn, .badge, .alert, .card,
.nav-link, .dropdown-item, .dropdown-toggle,
.modal-title, .modal-body, .card-header,
.tab-content, .tab-pane, .list-group-item,
.testobiancob2, [class*='testo'], [class*='form'] {
  font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont,
               'Segoe UI', Helvetica, Arial, sans-serif !important;
}

/* ── Typography scale ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--ar-text-primary);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

/* ── Scrollbar (Chrome/Edge) ────────────────────────────────────────── */
/* Rimosso perche clienti hanno chiesto di ripristinare alla vecchia scrollbar con i pulsanti freccia */
/*::-webkit-scrollbar               { width: 7px; height: 7px; }
::-webkit-scrollbar-track         { background: var(--ar-bg-page); }
::-webkit-scrollbar-thumb         { background: #b8c4d4; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover   { background: #94a3b8; }
*/

/* ── Page layout ────────────────────────────────────────────────────── */
#interne {
  background-color: var(--ar-bg-page) !important;
  min-height: 100%;
  overflow-x: auto;
}

#framecenter,
#framecenter2 {
  background-color: var(--ar-bg-surface) !important;
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow-sm);
}

#frameboxcornice {
  background-color: var(--ar-bg-surface) !important;
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow-sm);
}

/* ── Top Navbar ─────────────────────────────────────────────────────── */
.fixed-top.row[style*="56px"] {
  background: var(--ar-bg-navbar) !important;
  border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 2px 12px rgba(6,72,151,.18);
}

/* ensure content is below 56px navbar */
body[style*="margin-top: 56px"] {
  background-color: var(--ar-bg-page) !important;
}

/* ── Hamburger / Sidebar ────────────────────────────────────────────── */
#sidebar-wrapper {
  background: var(--ar-bg-sidebar) !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, .35) !important;
  border-right: 1px solid rgba(255, 255, 255, .06) !important;
  align-content: baseline;
}

/* ── Navbar top buttons (Cruscotto / Mappa) ─────────────────────────── */
.tuor {
  border-radius: var(--ar-radius-sm) !important;
  font-weight: 500;
  font-size: 13px !important;
  letter-spacing: .01em;
  transition: background var(--ar-transition), color var(--ar-transition) !important;
}

.tuor:hover {
  background: rgba(255,255,255,.18) !important;
  color: #ffffff !important;
}

/* ── User avatar circle ─────────────────────────────────────────────── */
.rounded-circle.circle_new,
.circle_new {
  background: rgba(255,255,255,.24) !important;
  border: 1.5px solid rgba(255,255,255,.6) !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 700;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  text-align: center;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ar-transition), border-color var(--ar-transition);
}

.rounded-circle.circle_new:hover,
#dropfocus:hover + .dropdown-menu,
.circle_new:hover {
  background: rgba(255,255,255,.32) !important;
}

/* ── Dropdown menu (user avatar, dark variant) ──────────────────────── */
.dropdown-menu[style*="064897"],
.dropdown-menu[style*="#064897"],
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] {
  background: var(--ar-primary) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow-lg) !important;
  padding: 8px 12px !important;
  min-width: 240px;
}

.dropdown-menu > li > a {
  font-size: 13px !important;
  font-weight: 400;
  padding: 8px 20px !important;
  color: rgba(255,255,255,.9) !important;
  transition: background var(--ar-transition);
  border-radius: 0;
  display: block;
}

/* Link items inside the dark dropdown: compensate for ul's 12px h-padding */
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] > li > a {
  margin: 0 -12px !important;
  padding: 8px 20px !important;
  border-radius: 0 !important;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background-color: rgba(255,255,255,.14) !important;
  color: #ffffff !important;
}

.dropdown-menu .divider,
.dropdown-menu li.divider {
  background-color: rgba(255,255,255,.15) !important;
  margin: 5px 0 !important;
  height: 1px;
  padding: 0 !important;
}

/* ── Inputs INSIDE the dark navbar dropdown ─────────────────────────── */
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] .form-control,
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] input[type="search"],
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] input[type="text"] {
  background-color: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.3) !important;
  color: #ffffff !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  padding: 6px 10px !important;
  height: 34px !important;
  min-height: 34px !important;
  width: 200px !important;
  max-width: 200px !important;
  box-shadow: none !important;
}

ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] .form-control::placeholder,
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] input::placeholder {
  color: rgba(255,255,255,.45) !important;
}

ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] .form-control:focus,
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] input:focus {
  background-color: rgba(255,255,255,.2) !important;
  border-color: rgba(255,255,255,.6) !important;
  box-shadow: none !important;
}

ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] .custom-select,
ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] select {
  background-color: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.3) !important;
  color: #ffffff !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  height: 34px !important;
  padding: 5px 10px !important;
  width: 200px !important;
  max-width: 200px !important;
  box-shadow: none !important;
}

ul.dropdown-menu[style*="background-color: rgb(6, 72, 151)"] select option {
  background-color: var(--ar-primary) !important;
  color: #ffffff !important;
}

/* ── Bootstrap Navbar (global) ──────────────────────────────────────── */
.navbar {
  border-radius: 0 !important;
  box-shadow: 0 2px 10px rgba(6,72,151,.18);
}

/* ── Fixed-top row: compact 56px height ─────────────────────────────── */
.fixed-top.row {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.fixed-top.row .col-auto,
.fixed-top.row .col {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ── Tables ─────────────────────────────────────────────────────────── */
/* Restore border-spacing approach: table background shows as 1px gaps  */
.tabella {
  border-spacing: 1px !important;
  border-collapse: separate !important;
  width: 100%;
}

/* All cells get white background; border-spacing gaps show table bg    */
.tabella td,
.tabella th {
  /* background-color: transparent;
  background-color: var(--ar-bg-surface); */
  padding: 5px 8px !important;
  vertical-align: middle;
  font-size: 12px;
  color: var(--ar-text-primary);
}

/* sfondoblu: change table background from navy to soft border gray.
   1px gaps between cells now render as subtle #dce1e9 grid lines.      */
.tabella.sfondoblu {
  background-color: var(--ar-border) !important;
}

/* Proper <thead> header row */
.tabella > thead > tr > th,
.tabella thead th {
  background: var(--ar-primary) !important;
  color: var(--ar-text-on-dark) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: none !important;
  padding: 9px 10px !important;
  white-space: normal;
  word-break: break-word;
}

/* Legacy header rows: <tr class="testobiancob2"> (no <thead> wrapper)  */
.tabella tr.testobiancob2 > td,
.tabella tr.testobiancob2 > th {
  background-color: var(--ar-primary) !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 8px !important;
  white-space: normal;
  word-break: break-word;
}

/* Row hover — skip header rows */
.tabella > tbody > tr:not(.testobiancob2):hover > td,
.tabella > tbody > tr:not(.testobiancob2):hover > th {
  background-color: var(--ar-primary-subtle) !important;
  transition: background var(--ar-transition);
}

/* Alternating row tint (header rows always win via !important above)   */
.tabella > tbody > tr:nth-child(even) > td {
  background-color: #f8fafc;
}

/* Bootstrap .table improvements */
.table {
  border-color: var(--ar-border) !important;
}

.table thead th {
  background: var(--ar-primary) !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-top: none !important;
  border-bottom: 2px solid var(--ar-primary-hover) !important;
  padding: 10px 12px !important;
  white-space: nowrap;
}

/* Headers: never wrap (keeps table readable) */
th,
thead td,
tr.elenco-header:not(.Arial_bianco_body) > td,
tr.elenco-header:not(.Arial_bianco_body) > th,
tr.elenco-header2:not(.Arial_bianco_body) > td,
tr.elenco-header2:not(.Arial_bianco_body) > th,
tr.Arial_bianco_header > td,
tr.Arial_bianco_header > th,
tr.report-header > td,
tr.report-header > th,
tr.persist-header > td,
tr.persist-header > th,
tr.testobiancob1 > td,
tr.testobiancob1 > th,
tr.testobiancob2 > td,
tr.testobiancob2 > th {
  white-space: nowrap !important;
}

/* Body cells: column grows to fit content naturally (table-layout: auto),
   but caps at 280px — content wraps at word boundaries beyond that.
   overflow-wrap ensures extremely long words (URLs etc.) also break. */
tr.Arial_bianco_body > td {
  max-width: 280px;
  overflow-wrap: break-word;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f8fafc;
}

.table-hover > tbody > tr:hover {
  background-color: var(--ar-primary-subtle) !important;
}

.table td, .table th {
  font-size: 12px;
  vertical-align: middle !important;
  padding: 7px 12px !important;
}

/* Sticky header enhancement */
.table-sticky-header thead th,
.table-sticky-header thead td {
  background: var(--ar-primary) !important;
  color: #ffffff !important;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-control {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  color: var(--ar-text-primary) !important;
  background-color: var(--ar-bg-surface) !important;
  padding: 6px 10px !important;
  transition: border-color var(--ar-transition), box-shadow var(--ar-transition) !important;
  box-shadow: none !important;
}

/* Height only for single-value controls — multi-select lists keep their inline/size-based height */
.form-control:not(select[multiple]),
input.form-control {
  height: 34px !important;
}

textarea.form-control {
  height: auto !important;
  min-height: 80px;
}

.form-control:focus {
  border-color: var(--ar-accent) !important;
  box-shadow: 0 0 0 3px rgba(46,147,230,.16) !important;
  outline: none !important;
}

.form-control::placeholder {
  color: var(--ar-text-muted) !important;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
select:not([multiple]) {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  color: var(--ar-text-primary) !important;
  height: 34px !important;
  padding: 5px 8px !important;
  transition: border-color var(--ar-transition), box-shadow var(--ar-transition) !important;
}

textarea {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  color: var(--ar-text-primary) !important;
  transition: border-color var(--ar-transition), box-shadow var(--ar-transition) !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
  border-color: var(--ar-accent) !important;
  box-shadow: 0 0 0 3px rgba(46,147,230,.16) !important;
  outline: none !important;
}

.input-group-text {
  background-color: #f0f2f5 !important;
  border-color: var(--ar-border) !important;
  color: var(--ar-text-secondary) !important;
  font-size: 13px !important;
}

/* Legacy form classes — normalize to modern sizes */
.form1, .form2, .form3, .form4,
.formb1, .formb2, .formb3, .formb4 {
  font-size: 13px !important;
  border-radius: var(--ar-radius-sm) !important;
  border-color: var(--ar-border) !important;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  font-size: 13px !important;
  font-weight: 500;
  border-radius: var(--ar-radius-sm) !important;
  padding: 6px 14px !important;
  letter-spacing: .01em;
  transition: all var(--ar-transition) !important;
  border-width: 1px !important;
}

.btn-primary,
.btn[style*="background-color:#004899"],
.btn[style*="background-color: #004899"] {
  background-color: var(--ar-primary) !important;
  border-color: var(--ar-primary) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn[style*="background-color:#004899"]:hover,
.btn[style*="background-color: #004899"]:hover {
  background-color: var(--ar-primary-hover) !important;
  border-color: var(--ar-primary-hover) !important;
  box-shadow: 0 3px 10px rgba(6,72,151,.25) !important;
  transform: translateY(-1px);
}

.btn-primary:active,
.btn-primary:focus {
  background-color: var(--ar-primary-hover) !important;
  box-shadow: 0 0 0 3px rgba(6,72,151,.25) !important;
  transform: none !important;
}

.btn-secondary {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
}

.btn-secondary:hover {
  background-color: #5a6268 !important;
  box-shadow: var(--ar-shadow-sm) !important;
  transform: translateY(-1px);
}

.btn-success {
  border-radius: var(--ar-radius-sm) !important;
}

.btn-danger {
  border-radius: var(--ar-radius-sm) !important;
}

.btn-warning {
  border-radius: var(--ar-radius-sm) !important;
}

.btn-light {
  background-color: #f0f2f5 !important;
  border-color: var(--ar-border) !important;
  color: var(--ar-text-primary) !important;
}

.btn-light:hover {
  background-color: #e2e6ea !important;
  border-color: #c8d0da !important;
  box-shadow: var(--ar-shadow-sm) !important;
}

.btn-sm {
  font-size: 11.5px !important;
  padding: 3px 10px !important;
}

.btn-lg {
  font-size: 14px !important;
  padding: 10px 22px !important;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow-sm) !important;
  background-color: var(--ar-bg-surface) !important;
  transition: box-shadow var(--ar-transition-md) !important;
}

.card:hover {
  box-shadow: var(--ar-shadow) !important;
}

.card-header {
  background-color: #f8f9fb !important;
  border-bottom: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) var(--ar-radius) 0 0 !important;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px !important;
  color: var(--ar-text-primary);
}

.card-body {
  padding: 16px !important;
}

/* Bootstrap 3 panel → modernise */
.panel {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow-sm) !important;
  transition: box-shadow var(--ar-transition-md) !important;
}

.panel:hover {
  box-shadow: var(--ar-shadow) !important;
}

.panel-heading {
  background-color: var(--ar-primary) !important;
  color: #ffffff !important;
  border-radius: var(--ar-radius) var(--ar-radius) 0 0 !important;
  padding: 12px 16px !important;
  font-weight: 600;
  font-size: 13px;
  border-bottom: none !important;
}

.panel-body {
  padding: 16px !important;
}

.panel-footer {
  background-color: #f8f9fb !important;
  border-top: 1px solid var(--ar-border) !important;
  border-radius: 0 0 var(--ar-radius) var(--ar-radius) !important;
  padding: 10px 16px !important;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  border-left-width: 4px !important;
}

.alert-danger  { border-left-color: #dc3545 !important; }
.alert-success { border-left-color: #28a745 !important; }
.alert-warning { border-left-color: #ffc107 !important; }
.alert-info    { border-left-color: #17a2b8 !important; }

/* ── Badges ─────────────────────────────────────────────────────────── */
.badge {
  font-size: 10.5px !important;
  font-weight: 600;
  border-radius: 4px !important;
  padding: 3px 7px !important;
  letter-spacing: .02em;
}

/* ── Modals ─────────────────────────────────────────────────────────── */
.modal-content {
  border: none !important;
  border-radius: var(--ar-radius-lg) !important;
  box-shadow: var(--ar-shadow-lg) !important;
}

.modal-header {
  background-color: var(--ar-primary) !important;
  color: #ffffff !important;
  border-radius: var(--ar-radius-lg) var(--ar-radius-lg) 0 0 !important;
  padding: 14px 20px !important;
  border-bottom: none !important;
}

.modal-header .modal-title {
  font-weight: 600;
  font-size: 15px !important;
  color: #ffffff !important;
}

.modal-header .close {
  color: #ffffff !important;
  opacity: .8;
  font-size: 20px;
  text-shadow: none;
}

.modal-header .close:hover { opacity: 1; }

.modal-body {
  padding: 20px !important;
  font-size: 13px !important;
}

.modal-footer {
  padding: 12px 20px !important;
  border-top: 1px solid var(--ar-border) !important;
  background-color: #f8f9fb !important;
  border-radius: 0 0 var(--ar-radius-lg) var(--ar-radius-lg) !important;
}

/* ── Bootstrap Selectpicker ─────────────────────────────────────────── */
/* Outer wrapper gets .form-control class — strip its visual styling so
   only the inner .dropdown-toggle button is visible.                   */
.bootstrap-select.form-control,
div.bootstrap-select {
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  height: auto !important;
  min-height: unset !important;
}

.bootstrap-select > .dropdown-toggle {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  background-color: var(--ar-bg-surface) !important;
  color: var(--ar-text-primary) !important;
  width: 100%;
}

.bootstrap-select .dropdown-menu {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow) !important;
}

.bootstrap-select .dropdown-menu li a span.text {
  color: var(--ar-text-primary) !important;
  font-size: 13px !important;
}

/* ── jQuery UI autocomplete ─────────────────────────────────────────── */
.ui-autocomplete {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow) !important;
  font-size: 13px !important;
  background: var(--ar-bg-surface) !important;
}

.ui-menu-item .ui-menu-item-wrapper {
  padding: 7px 14px !important;
  color: var(--ar-text-primary) !important;
  border-radius: 0 !important;
  transition: background var(--ar-transition) !important;
}

.ui-menu-item .ui-menu-item-wrapper.ui-state-active,
.ui-menu-item .ui-menu-item-wrapper:hover {
  background: var(--ar-primary-subtle) !important;
  color: var(--ar-primary) !important;
  border: none !important;
  margin: 0 !important;
}

/* ── jQuery UI Datepicker ───────────────────────────────────────────── */
.ui-datepicker {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow) !important;
  font-size: 13px !important;
  padding: 6px !important;
}

.ui-datepicker-header {
  background: var(--ar-primary) !important;
  border: none !important;
  color: #ffffff !important;
  border-radius: var(--ar-radius-sm) !important;
  font-weight: 600;
}

.ui-datepicker .ui-datepicker-title { color: #ffffff !important; }
.ui-datepicker .ui-icon { filter: brightness(10); }

.ui-datepicker td a.ui-state-active,
.ui-datepicker td a.ui-state-highlight {
  background: var(--ar-primary) !important;
  color: #ffffff !important;
  border-radius: var(--ar-radius-sm) !important;
  border: none !important;
}

.ui-datepicker td a:hover {
  background: var(--ar-primary-subtle) !important;
  color: var(--ar-primary) !important;
  border-radius: var(--ar-radius-sm) !important;
}

/* ── Loading Spinner ────────────────────────────────────────────────── */
.spinner-overlay {
  background: rgba(0,0,0,.45) !important;
}

.spinner {
  border-color: rgba(255,255,255,.25) !important;
  border-top-color: var(--ar-accent) !important;
  width: 40px !important;
  height: 40px !important;
  border-width: 4px !important;
}

.loadingOverlay {
  background: rgba(0,0,0,.4) !important;
}

/* ── DataTables ─────────────────────────────────────────────────────── */
table.dataTable thead th,
table.dataTable thead td {
  background: var(--ar-primary) !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ar-primary-hover) !important;
  padding: 10px 12px !important;
  white-space: nowrap !important;
}

table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
  color: rgba(255,255,255,.7) !important;
}

table.dataTable tbody tr:hover {
  background-color: var(--ar-primary-subtle) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--ar-primary) !important;
  border-color: var(--ar-primary) !important;
  color: #ffffff !important;
  border-radius: var(--ar-radius-sm) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--ar-primary-subtle) !important;
  border-color: var(--ar-border) !important;
  color: var(--ar-primary) !important;
  border-radius: var(--ar-radius-sm) !important;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 12px !important;
  padding: 4px 8px !important;
}

/* ── Color utility upgrades (normalize pt sizes → px) ───────────────── */
/* These override the legacy .testoblu2, .testoverde2 etc. classes
   without removing them from the DOM — we just harmonize sizes        */
[class*="testo"]  { font-size: inherit !important; }
[class*="form1"], [class*="form2"], [class*="form3"], [class*="form4"] {
  font-size: 13px !important;
}

/* ── Section / content card wrapper ────────────────────────────────── */
div[align="center"] > .container-fluid,
div[align="center"] > .container {
  padding: 12px !important;
}

/* ── Link defaults inside content area ─────────────────────────────── */
#interne a {
  color: var(--ar-primary);
  transition: color var(--ar-transition) !important;
}

#interne a:hover {
  color: var(--ar-primary-hover) !important;
  text-decoration: underline;
}

/* ── jumbotron (used in avm.css) ────────────────────────────────────── */
.jumbotron {
  border-radius: var(--ar-radius) !important;
}

/* ── Filter table search ────────────────────────────────────────────── */
.filter_table_search {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  transition: border-color var(--ar-transition) !important;
}

.filter_table_search:focus {
  border-color: var(--ar-accent) !important;
  box-shadow: 0 0 0 3px rgba(46,147,230,.16) !important;
  outline: none !important;
}

/* ── Sortable table headers ─────────────────────────────────────────── */
table.sortable thead th {
  cursor: pointer;
  user-select: none;
  white-space: normal;
  word-break: break-word;
}

table.sortable thead th:hover {
  background: var(--ar-primary-light) !important;
}

/* ── Info / detail content areas ───────────────────────────────────── */
.sfondoblu {
  background-color: var(--ar-primary) !important;
  border-radius: var(--ar-radius-sm);
}

.sfondogrigio {
  background-color: #f0f2f5 !important;
}

/* ── Breadcrumb-style top bar text ──────────────────────────────────── */
.testobiancob2 {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,.92) !important;
  letter-spacing: .01em;
}

/* ── Pagination ─────────────────────────────────────────────────────── */
.pagination .page-item .page-link {
  border-color: var(--ar-border) !important;
  color: var(--ar-primary) !important;
  font-size: 13px !important;
  border-radius: var(--ar-radius-sm) !important;
  margin: 0 2px !important;
  transition: all var(--ar-transition) !important;
}

.pagination .page-item.active .page-link {
  background-color: var(--ar-primary) !important;
  border-color: var(--ar-primary) !important;
  color: #ffffff !important;
}

.pagination .page-item .page-link:hover {
  background-color: var(--ar-primary-subtle) !important;
  color: var(--ar-primary) !important;
}

/* ── Tabs ───────────────────────────────────────────────────────────── */
.nav-tabs {
  border-bottom: 2px solid var(--ar-border) !important;
}

.nav-tabs .nav-link {
  font-size: 13px !important;
  font-weight: 500;
  color: var(--ar-text-secondary) !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  padding: 8px 16px !important;
  margin-bottom: -2px;
  transition: all var(--ar-transition) !important;
  border-radius: 0 !important;
}

.nav-tabs .nav-link:hover {
  color: var(--ar-primary) !important;
  border-bottom-color: var(--ar-primary-light) !important;
}

.nav-tabs .nav-link.active {
  color: var(--ar-primary) !important;
  border-bottom: 2px solid var(--ar-primary) !important;
  font-weight: 600;
  background: transparent !important;
}

/* ── Custom select ──────────────────────────────────────────────────── */
.custom-select {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
  font-size: 13px !important;
  color: var(--ar-text-primary) !important;
  background-color: var(--ar-bg-surface) !important;
  height: 34px !important;
  padding: 5px 28px 5px 10px !important;
  transition: border-color var(--ar-transition) !important;
}

.custom-select:focus {
  border-color: var(--ar-accent) !important;
  box-shadow: 0 0 0 3px rgba(46,147,230,.16) !important;
  outline: none !important;
}

/* ── Progress bars ──────────────────────────────────────────────────── */
.progress {
  border-radius: 8px !important;
  height: 8px !important;
  background-color: #e9ecef !important;
}

.progress-bar {
  border-radius: 8px !important;
  background-color: var(--ar-primary) !important;
}

/* ── Typeahead ──────────────────────────────────────────────────────── */
.tt-menu,
.tsa-dropdown-container {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius) !important;
  box-shadow: var(--ar-shadow) !important;
  background: var(--ar-bg-surface) !important;
  font-size: 13px !important;
}

/* ── Tooltips ───────────────────────────────────────────────────────── */
.tooltip-inner {
  border-radius: var(--ar-radius-sm) !important;
  font-size: 12px !important;
  padding: 5px 10px !important;
  background-color: #1a202c !important;
}

/* ── Focus-visible accessibility ring ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ar-accent) !important;
  outline-offset: 2px !important;
}

/* ── Print cleanup ──────────────────────────────────────────────────── */
@media print {
  #sidebar-wrapper,
  .fixed-top,
  .hamburger,
  .overlay,
  .spinner-overlay,
  .loadingOverlay { display: none !important; }
  body { background: #ffffff !important; font-size: 11px !important; }
}

/* ── Soften legacy border classes (bordi.css uses harsh black #000000) */
.b_si  { border: 1px solid var(--ar-border) !important; }
.b_no  { border: none !important; }
.b_ud  { border-top: 1px solid var(--ar-border) !important; border-bottom: 1px solid var(--ar-border) !important; border-left: none !important; border-right: none !important; }
.b_udl { border-top: 1px solid var(--ar-border) !important; border-bottom: 1px solid var(--ar-border) !important; border-left: 1px solid var(--ar-border) !important; border-right: none !important; }
.b_udr { border-top: 1px solid var(--ar-border) !important; border-bottom: 1px solid var(--ar-border) !important; border-right: 1px solid var(--ar-border) !important; border-left: none !important; }
.b_ulr { border-top: 1px solid var(--ar-border) !important; border-right: 1px solid var(--ar-border) !important; border-left: 1px solid var(--ar-border) !important; }
.b_ur  { border-top: 1px solid var(--ar-border) !important; border-right: 1px solid var(--ar-border) !important; }
.b_ul  { border-top: 1px solid var(--ar-border) !important; border-left: 1px solid var(--ar-border) !important; }
.b_t   { border-top: 1px solid var(--ar-border) !important; }
.b_d   { border-bottom: 1px solid var(--ar-border) !important; }
.b_r   { border-right: 1px solid var(--ar-border) !important; }
.b_lr  { border-right: 1px solid var(--ar-border) !important; border-left: 1px solid var(--ar-border) !important; }
.b_dlr { border-bottom: 1px solid var(--ar-border) !important; border-right: 1px solid var(--ar-border) !important; border-left: 1px solid var(--ar-border) !important; }
.b_dr  { border-bottom: 1px solid var(--ar-border) !important; border-right: 1px solid var(--ar-border) !important; }

/* ── .tab_sommario ──────────────────────────────────────────────────── */
.tab_sommario {
  border: 1px solid var(--ar-border) !important;
  border-radius: var(--ar-radius-sm) !important;
}

/* ── Form labels ────────────────────────────────────────────────────── */
label {
  font-weight: 500 !important;
  font-size: 12px !important;
  color: var(--ar-text-secondary) !important;
  margin-bottom: 3px !important;
  display: inline-block;
}

/* Exception: label INSIDE .circle_new avatar inherits the white color  */
.circle_new label,
.circle_new > label {
  color: #ffffff !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  margin-bottom: 0 !important;
  display: inline !important;
}

/* ── Form group spacing ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 12px !important;
}

/* ── Inner content wrapper ──────────────────────────────────────────── */
#interne > div[align="center"],
#interne > div[align="left"],
#interne > div[align="right"] {
  padding: 6px 4px;
}

/* ── Generic plain tables inside #interne ───────────────────────────── */
#interne table:not(.tabella):not(.table):not([class*="dataTable"]):not([id*="DataTables"]) {
  font-size: 12px;
}

/* ── Inline submit buttons using formb classes ──────────────────────── */
input[type="submit"].formb1,
input[type="submit"].formb2,
input[type="submit"].formb3,
input[type="submit"].formb4,
input[type="submit"].form1,
input[type="submit"].form2,
input[type="submit"].form3,
input[type="submit"].form4 {
  background-color: var(--ar-primary) !important;
  color: #ffffff !important;
  border: 1px solid var(--ar-primary) !important;
  border-radius: var(--ar-radius-sm) !important;
  padding: 5px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  transition: background var(--ar-transition) !important;
}

input[type="submit"].formb1:hover,
input[type="submit"].formb2:hover,
input[type="submit"].formb3:hover,
input[type="submit"].formb4:hover {
  background-color: var(--ar-primary-hover) !important;
  border-color: var(--ar-primary-hover) !important;
}

/* ── Checkbox / radio improvements ──────────────────────────────────── */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--ar-primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ── Disabled inputs ────────────────────────────────────────────────── */
input:disabled,
select:disabled,
textarea:disabled,
.form-control:disabled {
  background-color: #f0f2f5 !important;
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
  cursor: not-allowed;
  opacity: 1;
}

/* ── Readonly inputs (e.g. summary counters like "N° richieste") ─────── */
input[readonly],
input[readonly="readonly"],
.form-control[readonly],
textarea[readonly] {
  background-color: #f0f2f5 !important;
  color: var(--ar-text-secondary) !important;
  cursor: default !important;
  box-shadow: none !important;
  border-color: var(--ar-border-subtle) !important;
}

/* ── Inline table cells colored by bgcolor attribute — keep legible ─── */
/* When a td gets bgcolor="#cccccc" from ColdFusion conditional logic,
   ensure the text remains readable (dark text on light gray)           */
td[bgcolor="#cccccc"],
td[bgcolor="##cccccc"] {
  background-color: #e9ecef !important;
  color: var(--ar-text-primary) !important;
}

td[bgcolor="#ff8000"],
td[bgcolor="##ff8000"] {
  background-color: #ff8000 !important;
  color: #ffffff !important;
}

/* ── Inline legacy font color classes ──────────────────────────────── */
.testorosso1, .testorosso2, .testorosso3, .testorosso4 { color: #dc3545 !important; }
.testoverde1, .testoverde2, .testoverde3, .testoverde4 { color: #28a745 !important; }
.testoarancio1, .testoarancio2, .testoarancio3, .testoarancio4 { color: #e67e00 !important; }
.testogrigio1, .testogrigio2, .testogrigio3, .testogrigio4 { color: var(--ar-text-muted) !important; }
.testobianco1, .testobianco2, .testobianco3, .testobianco4 { color: #ffffff !important; }
.testoblu1, .testoblu2, .testoblu3, .testoblu4 { color: var(--ar-primary) !important; }

/* ── Colored background form classes ────────────────────────────────── */
.formrossosfondob2, .formrossosfondob4  { background-color: #dc3545 !important; color: #fff !important; border-radius: var(--ar-radius-sm) !important; }
.formverdesfondob2                       { background-color: #28a745 !important; color: #fff !important; border-radius: var(--ar-radius-sm) !important; }
.formaranciosfondob2, .formaranciosfondob4 { background-color: #e67e00 !important; color: #fff !important; border-radius: var(--ar-radius-sm) !important; }

/* ── Small text improvements ────────────────────────────────────────── */
small, .small { font-size: 11px !important; }

/* ── HR divider ─────────────────────────────────────────────────────── */
hr {
  border-color: var(--ar-border) !important;
  margin: 12px 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   HOMEPAGE / DASHBOARD
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Dashboard page background ──────────────────────────────────────── */
/* Replace the old Sfondo_2000.png swirl with a clean deep-navy gradient */
#dash {
  background-image: none !important;
  background: linear-gradient(155deg, #031e52 0%, #053a7a 25%, #064897 55%, #0d5ab3 80%, #1262c0 100%) !important;
  background-attachment: fixed !important;
  min-height: 100%;
}

/* ── Dashboard search bar ───────────────────────────────────────────── */
#dash .row.py-5 {
  padding-top: 2.5rem !important;
  padding-bottom: 1.5rem !important;
}

/* Wrap the entire input-group in one cohesive pill */
#dash .input-group {
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.22) !important;
}

#dash .input-group .form-control[type="search"] {
  background-color: rgba(255,255,255,.97) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 14px !important;
  height: 46px !important;
  color: var(--ar-text-primary) !important;
}

#dash .input-group .form-control[type="search"]:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* Both append wrappers: strip their own styling so they sit flush */
#dash .input-group .input-group-append {
  margin-left: 0 !important;
}

#dash .input-group .btn-outline-secondary {
  background-color: rgba(255,255,255,.97) !important;
  border: none !important;
  border-left: 1px solid #e0e4ec !important;
  color: var(--ar-primary) !important;
  height: 46px !important;
  padding: 0 18px !important;
  font-size: 15px !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transition: background var(--ar-transition), color var(--ar-transition) !important;
}

#dash .input-group .btn-outline-secondary:hover {
  background-color: var(--ar-primary-subtle) !important;
  color: var(--ar-primary-hover) !important;
}

/* ── Dashboard tile GRID ─────────────────────────────────────────────── */
/* Kill the grow scale (causes jitter) — replace with elegant lift */
#dash .grow {
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s ease !important;
}

#dash .grow:hover {
  transform: translateY(-5px) !important;
  z-index: 9999 !important;
}

/* ── Dashboard tiles (cards) ────────────────────────────────────────── */
#dash .card.same_wh,
#dash .card.same_wh2 {
  border-radius: 16px !important;
  border: none !important;
  background: rgba(255,255,255,.97) !important;
  box-shadow:
    0 2px 8px rgba(0,0,0,.12),
    0 0 0 1px rgba(255,255,255,.08) !important;
  overflow: hidden !important;
  transition: box-shadow .22s ease !important;
}

#dash .card.same_wh:hover,
#dash .card.same_wh2:hover {
  box-shadow:
    0 16px 48px rgba(3,30,82,.30),
    0 6px 18px rgba(0,0,0,.14) !important;
}

/* Tile header padding */
#dash .card .col-12.pt-2.pl-2.pr-2 {
  padding: 14px 16px 4px !important;
}

/* Tile title text */
#dash .card font[color="##999999"],
#dash .card font[color="#999999"],
#dash .card .col-10.text-left font {
  color: #8a97a8 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .07em;
  text-transform: uppercase !important;
  font-family: 'Inter', sans-serif !important;
}

/* Tile + link */
#dash .card .col-2.text-right a,
#dash .card .col-2.text-right i.fa-plus {
  color: var(--ar-accent) !important;
  font-size: 12px !important;
  opacity: .65;
  transition: opacity .15s ease, color .15s ease;
}

#dash .card:hover .col-2.text-right a,
#dash .card:hover .col-2.text-right i.fa-plus {
  opacity: 1;
  color: var(--ar-primary) !important;
}

/* Bottom decorative icon inside tiles */
#dash .card .fas:not(.fa-plus):not(.fa-search):not(.fa-redo),
#dash .card .fa:not(.fa-plus):not(.fa-search):not(.fa-redo) {
  color: var(--ar-primary) !important;
  opacity: .12;
  font-size: 42px !important;
}

/* ── Tile content text sizes — tame the viewport-scaled classes ──────── */
/* style.css .text-* classes scale up to 28–40px; too big for small tiles */
#dash .card .text-xsmall { font-size: 11px !important; line-height: 1.4 !important; }
#dash .card .text-small  { font-size: 12px !important; line-height: 1.4 !important; }
#dash .card .text-medium { font-size: 13px !important; line-height: 1.45 !important; }
#dash .card .text-large  { font-size: 16px !important; line-height: 1.35 !important; font-weight: 600 !important; }
#dash .card .text-xlarge { font-size: 20px !important; line-height: 1.25 !important; font-weight: 700 !important; }

/* avm.css h2=24px, h4=19px — too large inside tiles */
#dash .card h1 { font-size: 20px !important; font-weight: 700 !important; color: var(--ar-primary) !important; margin-bottom: 4px !important; }
#dash .card h2 { font-size: 18px !important; font-weight: 700 !important; color: var(--ar-primary) !important; margin-bottom: 4px !important; }
#dash .card h3 { font-size: 16px !important; font-weight: 700 !important; color: var(--ar-primary) !important; margin-bottom: 4px !important; }
#dash .card h4 { font-size: 14px !important; font-weight: 600 !important; color: var(--ar-primary) !important; margin-bottom: 2px !important; }
#dash .card h5 { font-size: 13px !important; font-weight: 600 !important; color: var(--ar-text-secondary) !important; }

/* Generic text inside tiles */
#dash .card p  { font-size: 12px !important; color: var(--ar-text-secondary) !important; margin-bottom: 4px !important; }
#dash .card .text-xsmall + small,
#dash .card small { font-size: 10px !important; color: var(--ar-text-muted) !important; }

/* ═══════════════════════════════════════════════════════════════════════
   NAVBAR IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Navbar logo (top bar) ───────────────────────────────────────────── */
/* The logo sits inside a col-auto.align-self-center next to the hamburger */
.fixed-top.row .col-auto.align-self-center a img,
.fixed-top.row .col-auto.align-self-center > a > img {
  max-height: 36px !important;
  max-width: 160px !important;
  height: auto !important;
  width: auto !important;
  object-fit: contain !important;
  display: block;
}

/* ── Sidebar logo ────────────────────────────────────────────────────── */
#sidebar-wrapper img.d-block,
nav#sidebar-wrapper img,
#sidebar-wrapper .col-auto img {
  max-height: 44px !important;
  max-width: 120px !important;
  height: auto !important;
  width: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 6px auto 4px !important;
}

/* ── Navbar top buttons (Cruscotto / Mappa) — extend existing .tuor ─── */
.tuor {
  color: rgba(255, 255, 255, .90) !important;
  background: rgba(255, 255, 255, .08) !important;
  padding: 4px 16px !important;
  border: 1px solid rgba(255, 255, 255, .28) !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  transition: background .18s ease, border-color .18s ease, color .18s ease !important;
  -webkit-transition: background .18s ease, border-color .18s ease, color .18s ease !important;
  line-height: 1.6 !important;
}

/* Kill the oversized <font> tag inside the button */
.tuor font {
  font-size: 12px !important;
  font-family: inherit !important;
}

.tuor:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, .18) !important;
  border-color: rgba(255, 255, 255, .60) !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

/* ── Language picker (replaces Google Translate widget UI) ───────────── */
.lang-picker-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-flex;
  align-items: center;
  height: 29px !important;
  background: rgba(255, 255, 255, .08) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, .28) !important;
  border-radius: 8px !important;
  padding: 0 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  cursor: pointer;
  outline: none;
  line-height: 29px !important;
  vertical-align: middle;
  transition: background .18s ease, border-color .18s ease;
}

.lang-picker-select:hover,
.lang-picker-select:focus {
  background: rgba(255, 255, 255, .18) !important;
  border-color: rgba(255, 255, 255, .60) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  outline: none;
}

.lang-picker-select option {
  background: #064897 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── DataTables: hide cloned thead in scroll body (prevents double header) ── */
/* DataTables injects a visibility:hidden <thead> clone into .dataTables_scrollBody
   for column-width sync. Sort pseudo-elements still bleed through — hide the row. */
.dataTables_scrollBody thead tr {
  height: 0 !important;
  line-height: 0 !important;
  visibility: hidden !important;
}
.dataTables_scrollBody thead tr th,
.dataTables_scrollBody thead tr td {
  height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

/* ── Navbar info text (Azienda / Gruppo) ─────────────────────────────── */
.testobiancob2 {
  font-size: 12px !important;
  color: rgba(255,255,255,.80) !important;
  font-weight: 400 !important;
  letter-spacing: .01em;
  line-height: 1.5 !important;
}

