/* =========================================================================
   Contenuto delle pagine come HubLEM (ADR-265)
   Schede dei record in griglia, schede di settore, card dei totali, barra
   dei filtri e intestazioni delle schede di dettaglio.
   ========================================================================= */

/* --- Barra dei filtri: ricerca e tendine in riga, senza riquadro ---------- */
.hub-filters { margin-bottom: 1.25rem; }
.hub-filters__search { max-width: 28rem; margin-bottom: .75rem; position: relative; }
.hub-filters__search .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.hub-filters__search .form-control { padding-left: 2.4rem; }
.hub-filters__row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.hub-filters__row .form-select, .hub-filters__row .form-control { width: auto; min-width: 11rem; max-width: 18rem; }
.hub-filters__count { margin-left: auto; font-size: .75rem; font-weight: 700; color: #6b7280; }

/* --- Schede di settore: barra grigia a segmenti con i conteggi ------------ */
.hub-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: .25rem;
  padding: .25rem;
  margin-bottom: 1.5rem;
  background: #f3f4f6;
  border-radius: .75rem;
}
.hub-tabs__item {
  text-align: center;
  padding: .55rem .5rem;
  border-radius: .75rem;
  font-size: .78rem;
  font-weight: 700;
  color: #4b5563;
  text-decoration: none;
  white-space: nowrap;
}
.hub-tabs__item:hover { color: #0a0a0a; background: rgba(255, 255, 255, .6); }
.hub-tabs__item.is-active { background: #fff; color: #0a0a0a; box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .12); }
.hub-tabs__count { font-weight: 600; color: inherit; opacity: .8; }

/* --- Card dei totali con i fondi sfumati di HubLEM ------------------------ */
.hub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.hub-stat {
  position: relative;
  padding: 1rem 1.15rem;
  border: 2px solid #e5e7eb;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, .08);
}
.hub-stat__icon { position: absolute; right: 1rem; top: 1rem; font-size: 1.25rem; opacity: .6; }
.hub-stat__value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: #111827; }
.hub-stat__label { font-size: .72rem; font-weight: 700; color: #4b5563; margin-top: .25rem; letter-spacing: .03em; }
.hub-stat--green { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); border-color: #6ee7b7; }
.hub-stat--blue { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); border-color: #93c5fd; }
.hub-stat--orange { background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%); border-color: #fb923c; }
.hub-stat--purple { background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%); border-color: #c084fc; }
.hub-stat--red { background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%); border-color: #f87171; }

/* --- Griglia delle schede ------------------------------------------------- */
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1199.98px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .hub-grid { grid-template-columns: 1fr; } }

.hub-record {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 1.5rem;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, .08);
  transition: box-shadow .3s cubic-bezier(.4, 0, .2, 1), transform .3s cubic-bezier(.4, 0, .2, 1);
  min-width: 0;
}
.hub-record:hover { box-shadow: 0 12px 28px -4px rgba(0, 0, 0, .15); transform: translateY(-2px); }
@media (hover: none) { .hub-record:hover { transform: none; } }
.hub-record.is-muted { opacity: .7; }
.hub-record__head { display: flex; align-items: flex-start; gap: .75rem; padding: 1.1rem 1.1rem .6rem; }
.hub-record__avatar {
  flex: 0 0 2.5rem; height: 2.5rem; border-radius: 50%;
  background: #111827; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.hub-record__titles { flex: 1 1 auto; min-width: 0; }
.hub-record__title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.hub-record__title:hover { text-decoration: underline; color: #000; }
.hub-record__subtitle { font-size: .8rem; color: #6b7280; margin-top: .15rem; }
.hub-record__meta { font-size: .72rem; font-weight: 600; margin-top: .25rem; }
.hub-tone--green { color: #16a34a; }
.hub-tone--blue { color: #2563eb; }
.hub-tone--purple { color: #9333ea; }
.hub-tone--orange { color: #ea580c; }
.hub-tone--red { color: #dc2626; }
.hub-tone--gray { color: #6b7280; }
.hub-record__badges { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex-shrink: 0; }
.hub-record__code { font-size: .65rem; font-weight: 700; color: #9ca3af; }
.hub-record__body { padding: .25rem 1.1rem .75rem 4.35rem; display: grid; gap: .35rem; }
.hub-record__line { display: flex; gap: .5rem; align-items: baseline; font-size: .8rem; color: #374151; min-width: 0; }
.hub-record__line .bi { color: #9ca3af; flex-shrink: 0; }
.hub-record__line span { overflow-wrap: anywhere; }
.hub-record__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .75rem 1.1rem 1rem;
  border-top: 1px solid #f1f2f4;
}
.hub-record__actions .btn { flex: 1 1 auto; }
@media (max-width: 767.98px) {
  .hub-record__body { padding-left: 1.1rem; }
  .hub-record__actions .btn { min-height: 2.75rem; }
}

/* --- Intestazione della scheda di dettaglio di un record ------------------ */
.hub-hero {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
  background: #fff; border: 2px solid #e5e7eb; border-radius: 1.5rem;
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, .08);
}
.hub-hero .hub-record__avatar { flex-basis: 3.5rem; height: 3.5rem; font-size: 1.6rem; }
.hub-hero__title { font-size: 1.35rem; font-weight: 700; color: #111827; margin: 0; }
.hub-hero__subtitle { color: #6b7280; font-size: .85rem; }
.hub-hero__badges { margin-left: auto; display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }

/* --- Paginazione centrata sotto la griglia -------------------------------- */
.hub-grid + nav .pagination, .hub-grid + .pagination { justify-content: center; margin-top: 1.5rem; }

/* Badge viola dei compensi, come HubLEM (purple-100 / purple-800). */
.text-bg-purple { background-color: #f3e8ff !important; color: #6b21a8 !important; }

/* Card gialla (Tagli totali del registro merci), come HubLEM. */
.hub-stat--yellow { background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%); border-color: #facc15; }
/* La spunta di selezione accanto ai pulsanti della scheda non si allarga. */
.hub-record__actions .form-check { flex: 0 0 auto; margin: 0 .25rem 0 0; }
/* Telefono: le schede dei settori scorrono invece di uscire dallo schermo. */
@media (max-width: 767.98px) {
  .hub-tabs { grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; }
  .hub-tabs::-webkit-scrollbar { display: none; }
  .hub-filters__row .form-select, .hub-filters__row .form-control { min-width: 0; max-width: none; flex: 1 1 45%; }
  .hub-filters__count { margin-left: 0; width: 100%; }
}

/* =========================================================================
   Finestre, card a riga intera e testate per il telefono (ADR-268)
   ========================================================================= */
.hub-modal .modal-content { border: 0; border-radius: 1.25rem; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .25); }
.hub-modal .modal-header { border-bottom: 1px solid #e5e7eb; padding: 1.1rem 1.5rem; }
.hub-modal .modal-title { font-weight: 700; letter-spacing: .02em; }
.hub-modal .modal-body { padding: 1.25rem 1.5rem 1.5rem; }
.hub-modal .modal-body .card { box-shadow: none; }

/* Card a riga intera con la colonna delle azioni a destra (GestioneContratti). */
.hub-rows { display: grid; gap: 1rem; }
.hub-row {
  display: flex; flex-direction: column; gap: 1.25rem;
  background: #fff; border: 2px solid #e5e7eb; border-radius: 1rem; padding: 1.25rem 1.5rem;
  transition: box-shadow .2s ease;
}
.hub-row:hover { box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .15); }
@media (min-width: 1200px) { .hub-row { flex-direction: row; } }
.hub-row__main { flex: 1 1 auto; min-width: 0; display: grid; gap: .85rem; }
.hub-row__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.hub-row__title { font-size: 1.1rem; font-weight: 700; color: #111827; text-decoration: none; }
a.hub-row__title:hover { text-decoration: underline; }
.hub-row__fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem 1.25rem; margin: 0; }
@media (max-width: 991.98px) { .hub-row__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .hub-row__fields { grid-template-columns: 1fr; } }
.hub-row__fields dt { font-size: .74rem; font-weight: 500; color: #6b7280; margin: 0; }
.hub-row__fields dd { font-size: .85rem; font-weight: 600; color: #111827; margin: 0; overflow-wrap: anywhere; }
.hub-row__side { display: flex; flex-direction: column; gap: .5rem; }
@media (min-width: 1200px) { .hub-row__side { flex: 0 0 16rem; } }
.hub-row__side .btn, .hub-row__side form, .hub-row__side form .btn { width: 100%; }
.hub-row__side .hub-row__icons { display: flex; gap: .5rem; }
.hub-row__side .hub-row__icons .btn, .hub-row__side .hub-row__icons form { width: auto; flex: 1 1 0; }
.hub-note { border-radius: .75rem; padding: .75rem 1rem; font-size: .82rem; border: 1px solid; }
.hub-note--red { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.hub-note--green { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.hub-note--amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.hub-note--blue { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.hub-note--purple { background: #faf5ff; border-color: #e9d5ff; color: #6b21a8; }
.hub-note--teal { background: #f0fdfa; border-color: #99f6e4; color: #115e59; }

/* Percorso del contratto nella scheda: Creato → Inviato → Firmato → Documento → Approvato. */
.hub-steps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.hub-steps__item { flex: 1 1 9rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem;
  padding: .6rem .5rem; border-radius: .75rem; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; font-size: .8rem; }
.hub-steps__dot { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; background: #f3f4f6; color: #6b7280; }
.hub-steps__label { font-weight: 600; }
.hub-steps__date { font-size: .72rem; min-height: 1em; }
.hub-steps__item.is-done { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.hub-steps__item.is-done .hub-steps__dot { background: #16a34a; color: #fff; }
.hub-steps__item--danger.is-done { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.hub-steps__item--danger.is-done .hub-steps__dot { background: #dc2626; }
.hub-steps__item.is-current { color: #92400e; border-color: #fbbf24; background: #fffbeb; box-shadow: 0 0 0 2px rgba(251, 191, 36, .25); }
.hub-steps__item.is-current .hub-steps__dot { background: #f59e0b; color: #fff; }
.hub-steps__item--danger.is-current { color: #991b1b; border-color: #f87171; background: #fef2f2; box-shadow: 0 0 0 2px rgba(248, 113, 113, .25); }
.hub-steps__item--danger.is-current .hub-steps__dot { background: #dc2626; }
[data-bs-theme="dark"] .hub-steps__item { background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .1); color: #9ca3af; }
[data-bs-theme="dark"] .hub-steps__item.is-done { background: rgba(22, 101, 52, .2); color: #86efac; }
[data-bs-theme="dark"] .hub-steps__item.is-current { background: rgba(146, 64, 14, .25); color: #fcd34d; }
.hub-tech > summary { cursor: pointer; list-style: none; }
.hub-tech > summary::-webkit-details-marker { display: none; }
.hub-tech > summary::before { content: "\25B8"; margin-right: .4rem; display: inline-block; transition: transform .15s; }
.hub-tech[open] > summary::before { transform: rotate(90deg); }

/* Controllo del documento del titolare sulla card, come il riquadro apribile di HubLEM. */
.hub-docbox { border: 1px solid; border-radius: .75rem; padding: .75rem 1rem; font-size: .82rem; margin-top: .5rem; }
.hub-docbox--green { background: #f0fdf4; border-color: #bbf7d0; }
.hub-docbox--amber { background: #fffbeb; border-color: #fde68a; }
.hub-docbox--red { background: #fef2f2; border-color: #fecaca; }
.hub-docbox > summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; cursor: pointer; list-style: none; }
.hub-docbox > summary::-webkit-details-marker { display: none; }
.hub-docbox > summary::after { content: "\25BE"; color: #6b7280; transition: transform .15s; }
.hub-docbox[open] > summary::after { transform: rotate(180deg); }
.hub-docbox__head { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.hub-docbox__head small { color: #4b5563; font-size: .72rem; }
.hub-docbox__body { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid rgba(0, 0, 0, .06); }
.hub-docbox__todo { background: #fff; border: 1px solid rgba(255, 255, 255, .8); border-radius: .5rem; padding: .6rem .75rem; }
.hub-docbox__todo div { margin-top: .2rem; }
[data-bs-theme="dark"] .hub-docbox--green { background: rgba(22, 101, 52, .18); border-color: rgba(134, 239, 172, .35); }
[data-bs-theme="dark"] .hub-docbox--amber { background: rgba(146, 64, 14, .2); border-color: rgba(253, 230, 138, .35); }
[data-bs-theme="dark"] .hub-docbox--red { background: rgba(153, 27, 27, .2); border-color: rgba(254, 202, 202, .35); }
[data-bs-theme="dark"] .hub-docbox__todo { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); }
[data-bs-theme="dark"] .hub-docbox__head small { color: #9ca3af; }

/* Card statistiche a tinta tenue con bordo colorato (GestioneContratti). */
.hub-stat--soft-gray { background: #fff; border-color: #e5e7eb; }
.hub-stat--soft-orange { background: #fff7ed; border-color: #fed7aa; }
.hub-stat--soft-orange .hub-stat__value { color: #7c2d12; }
.hub-stat--soft-blue { background: #eff6ff; border-color: #bfdbfe; }
.hub-stat--soft-blue .hub-stat__value { color: #1e3a8a; }
.hub-stat--soft-green { background: #f0fdf4; border-color: #bbf7d0; }
.hub-stat--soft-green .hub-stat__value { color: #14532d; }
.hub-stat--soft-purple { background: #faf5ff; border-color: #e9d5ff; }
.hub-stat--soft-purple .hub-stat__value { color: #581c87; }
.hub-stat--soft-amber { background: #fffbeb; border-color: #fde68a; }
.hub-stat--soft-amber .hub-stat__value { color: #78350f; }

/* Badge viola del compenso, come HubLEM. */
.text-bg-purple { background: #f3e8ff !important; color: #6b21a8 !important; }

/* --- Telefono: testata colorata per sezione come i vecchi gestionali ------ */
.hub-mhero { margin: -1.5rem -1rem 1rem; }
.hub-mhero__band {
  padding: 1.5rem 1.25rem 2.5rem; border-radius: 0 0 2rem 2rem; color: #fff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .15);
}
.hub-mhero__title { font-size: 1.5rem; font-weight: 900; margin: 0; color: #fff; }
.hub-mhero__subtitle { font-size: .85rem; opacity: .85; margin: .15rem 0 0; }
.hub-mhero__tiles { display: grid; grid-template-columns: repeat(var(--tiles, 4), minmax(0, 1fr)); gap: .5rem; margin: -1.5rem .75rem 0; position: relative; }
.hub-mhero__tile {
  background: #fff; border: 1px solid #f3f4f6; border-radius: 1.5rem; padding: .7rem .4rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1); text-align: center; display: grid; justify-items: center; gap: .2rem;
}
.hub-mhero__icon { width: 2.5rem; height: 2.5rem; border-radius: 1rem; display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.hub-mhero__tile strong { font-size: 1.15rem; font-weight: 900; color: #111827; line-height: 1; }
.hub-mhero__tile small { font-size: .58rem; font-weight: 900; letter-spacing: .04em; color: #6b7280; }
.hub-grad--fuchsia { background: linear-gradient(90deg, #c026d3, #db2777); }
.hub-grad--amber { background: linear-gradient(90deg, #d97706, #ea580c); }
.hub-grad--emerald { background: linear-gradient(90deg, #059669, #0d9488); }
.hub-grad--violet { background: linear-gradient(90deg, #7c3aed, #9333ea); }
.hub-grad--blue { background: linear-gradient(90deg, #2563eb, #4f46e5); }
.hub-grad--teal { background: linear-gradient(90deg, #0d9488, #0891b2); }
.hub-grad--orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.hub-grad--green { background: linear-gradient(135deg, #4ade80, #16a34a); }
.hub-grad--red { background: linear-gradient(135deg, #f87171, #dc2626); }
.hub-grad--gray { background: linear-gradient(135deg, #9ca3af, #4b5563); }
.hub-grad--purple { background: linear-gradient(135deg, #c084fc, #9333ea); }
.hub-grad--pink { background: linear-gradient(135deg, #f472b6, #db2777); }
.hub-fab {
  position: fixed; right: 1.25rem; bottom: 1.5rem; z-index: 1030; width: 4rem; height: 4rem; border-radius: 1rem;
  display: grid; place-items: center; color: #fff; font-size: 2rem; text-decoration: none;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .35);
}
.hub-fab:hover, .hub-fab:focus { color: #fff; }
.hub-fab:active { transform: scale(.95); }
@media (max-width: 767.98px) {
  .app-content:has(.hub-mhero) .app-page-header { display: none !important; }
  .app-content:has(.hub-mhero) .app-page-header + .flash-stack { margin-top: 0; }
}

/* --- Modulo del contratto come HubLEM (ADR-268) ---------------------------- */
.hub-suggest { position: absolute; z-index: 1060; left: .75rem; right: .75rem; top: 100%; max-height: 18rem; overflow-y: auto; box-shadow: 0 12px 28px -8px rgba(0, 0, 0, .2); }
.hub-suggest .list-group-item { text-align: left; }
.hub-owners { border: 1px solid #bfdbfe; background: rgba(239, 246, 255, .6); border-radius: 1rem; padding: 1rem; }
.hub-owners__list { display: grid; gap: .75rem; margin-top: .75rem; }
.hub-owner { background: #fff; border: 1px solid #e5e7eb; border-radius: .9rem; padding: .85rem; }
.hub-owner.is-primary { box-shadow: 0 0 0 2px #93c5fd; }
.hub-owner__head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.hub-owner__head strong { font-size: .78rem; letter-spacing: .05em; }
.hub-more summary { cursor: pointer; font-weight: 600; font-size: .85rem; color: #4b5563; }

/* --- Contratti come HubLEM (ADR-268): badge, card e pulsanti del telefono --- */
.d-contents { display: contents; }
.text-bg-blue { background-color: #dbeafe !important; color: #1e40af !important; }
.text-bg-orange { background-color: #ffedd5 !important; color: #9a3412 !important; }
.text-bg-green { background-color: #dcfce7 !important; color: #166534 !important; }
.text-bg-red { background-color: #fee2e2 !important; color: #991b1b !important; }
.btn-outline-purple { color: #9333ea; border-color: #d8b4fe; }
.btn-outline-purple:hover { color: #7e22ce; background-color: #faf5ff; border-color: #c084fc; }
.hub-mcards { display: flex; flex-direction: column; gap: .75rem; padding-bottom: 6rem; }
.hub-mcard { background: #fff; border: 2px solid #fae8ff; border-radius: 1.5rem; padding: 1.1rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,.08); }
.hub-mcard__head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .9rem; }
.hub-mcard__icon { width: 3.25rem; height: 3.25rem; flex: 0 0 3.25rem; border-radius: 1rem; display: grid; place-items: center; color: #fff; font-size: 1.5rem; box-shadow: 0 6px 12px -4px rgba(0,0,0,.25); }
.hub-mcard__title { display: block; font-weight: 900; color: #111827; text-decoration: none; overflow-wrap: anywhere; margin-bottom: .2rem; }
.hub-mcard__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .5rem 0 .75rem; }
.hub-mcard__box { border-radius: .75rem; padding: .55rem .7rem; border: 1px solid; min-width: 0; }
.hub-mcard__grid .hub-mcard__box { text-align: center; }
.hub-mcard__box small { display: block; font-size: .6rem; font-weight: 900; }
.hub-mcard__box strong { display: block; font-size: .8rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-mcard__box--purple { background: #faf5ff; border-color: #e9d5ff; color: #581c87; }
.hub-mcard__box--purple small { color: #9333ea; }
.hub-mcard__box--teal { background: #f0fdfa; border-color: #99f6e4; color: #134e4a; }
.hub-mcard__box--teal small { color: #0d9488; }
.hub-mcard__box--blue { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.hub-mcard__box--blue small { color: #2563eb; }
.hub-mcard__box--green { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.hub-mcard__box--green small { color: #16a34a; }
.hub-mcard__box--orange { background: #fff7ed; border-color: #fed7aa; color: #7c2d12; }
.hub-mcard__box--orange small { color: #ea580c; }
.hub-mcard__actions { display: flex; flex-direction: column; gap: .5rem; }
.hub-mcard__actions form { margin: 0; }
.hub-mcard__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.hub-mbtn { display: flex; align-items: center; justify-content: center; gap: .3rem; width: 100%; border-radius: .75rem; padding: .75rem .5rem; font-size: .75rem; font-weight: 900; border: 1px solid transparent; text-decoration: none; background: #f3f4f6; color: #374151; }
.hub-mbtn:disabled { opacity: .5; }
.hub-mbtn--blue { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.hub-mbtn--green { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.hub-mbtn--red { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.hub-mbtn--emerald { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.hub-mbtn--gray { background: #f3f4f6; color: #374151; }
.btn-outline-blue { color: #1d4ed8; border-color: #93c5fd; background: #fff; }
.btn-outline-blue:hover { color: #1d4ed8; background-color: #eff6ff; border-color: #60a5fa; }

/* --- Componenti comuni del restyling (PIANO_RESTYLING, regole 1-3) -----------
   Testate del telefono «da-a» come i gradienti tailwind 600 dei vecchi
   gestionali; i nomi brevi sopra restano per i riquadri. */
.hub-grad--sky-indigo { background: linear-gradient(90deg, #0284c7, #4f46e5); }
.hub-grad--indigo-purple { background: linear-gradient(90deg, #4f46e5, #9333ea); }
.hub-grad--indigo-violet { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.hub-grad--purple-fuchsia { background: linear-gradient(90deg, #9333ea, #c026d3); }
.hub-grad--purple-indigo { background: linear-gradient(90deg, #9333ea, #4f46e5); }
.hub-grad--purple-pink { background: linear-gradient(90deg, #9333ea, #db2777); }
.hub-grad--cyan-blue { background: linear-gradient(90deg, #0891b2, #2563eb); }
.hub-grad--cyan-sky { background: linear-gradient(90deg, #0891b2, #0284c7); }
.hub-grad--blue-cyan { background: linear-gradient(90deg, #2563eb, #0891b2); }
.hub-grad--green-emerald { background: linear-gradient(90deg, #16a34a, #059669); }
.hub-grad--emerald-green { background: linear-gradient(90deg, #059669, #16a34a); }
.hub-grad--green-lime { background: linear-gradient(90deg, #16a34a, #65a30d); }
.hub-grad--teal-cyan { background: linear-gradient(90deg, #0d9488, #0891b2); }
.hub-grad--orange-red { background: linear-gradient(90deg, #ea580c, #dc2626); }
.hub-grad--orange-amber { background: linear-gradient(90deg, #ea580c, #d97706); }
.hub-grad--red-orange { background: linear-gradient(90deg, #dc2626, #ea580c); }
.hub-grad--amber-orange { background: linear-gradient(90deg, #d97706, #ea580c); }
.hub-grad--amber-yellow { background: linear-gradient(90deg, #d97706, #ca8a04); }
.hub-grad--yellow-amber { background: linear-gradient(90deg, #ca8a04, #d97706); }
.hub-grad--pink-rose { background: linear-gradient(90deg, #db2777, #e11d48); }
.hub-grad--slate-zinc { background: linear-gradient(90deg, #334155, #27272a); }
.hub-grad--slate-gray { background: linear-gradient(90deg, #1e293b, #1f2937); }
/* Toni dei riquadri che mancavano. */
.hub-grad--yellow { background: linear-gradient(135deg, #facc15, #ca8a04); }
.hub-grad--teal-tile { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.hub-grad--indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.hub-grad--cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.hub-grad--sky { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.hub-grad--black { background: #111827; }

/* Riquadri colorati che mancavano. */
.hub-note--gray { background: #f9fafb; border-color: #e5e7eb; color: #374151; }
.hub-note--orange { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.hub-note--pink { background: #fdf2f8; border-color: #fbcfe8; color: #9d174d; }
.hub-note--indigo { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.hub-note--yellow { background: #fefce8; border-color: #fef08a; color: #854d0e; }

/* Card dei totali con bordo spesso e fondo tenue che mancavano. */
.hub-stat--soft-red { background: #fef2f2; border-color: #fecaca; }
.hub-stat--soft-red .hub-stat__value { color: #7f1d1d; }
.hub-stat--soft-yellow { background: #fefce8; border-color: #fef08a; }
.hub-stat--soft-yellow .hub-stat__value { color: #713f12; }
.hub-stat--soft-indigo { background: #eef2ff; border-color: #c7d2fe; }
.hub-stat--soft-indigo .hub-stat__value { color: #312e81; }
.hub-stat--soft-teal { background: #f0fdfa; border-color: #99f6e4; }
.hub-stat--soft-teal .hub-stat__value { color: #134e4a; }

/* Badge tenui di HubLEM (bg-*-100 text-*-800). */
.text-bg-yellow { background-color: #fef9c3 !important; color: #854d0e !important; }
.text-bg-gray { background-color: #f3f4f6 !important; color: #1f2937 !important; }
.text-bg-indigo { background-color: #e0e7ff !important; color: #3730a3 !important; }
.text-bg-teal { background-color: #ccfbf1 !important; color: #115e59 !important; }
.text-bg-pink { background-color: #fce7f3 !important; color: #9d174d !important; }

/* Pulsanti delle card come HubLEM. */
.btn-outline-orange { color: #c2410c; border-color: #fdba74; background: #fff; }
.btn-outline-orange:hover { color: #c2410c; background: #fff7ed; border-color: #fb923c; }
.btn-outline-emerald { color: #047857; border-color: #6ee7b7; background: #fff; }
.btn-outline-emerald:hover { color: #047857; background: #ecfdf5; border-color: #34d399; }
.btn-amber { color: #fff; background: #d97706; border-color: #d97706; }
.btn-amber:hover { color: #fff; background: #b45309; border-color: #b45309; }
.btn-red { color: #fff; background: #dc2626; border-color: #dc2626; }
.btn-red:hover { color: #fff; background: #b91c1c; border-color: #b91c1c; }
.btn-green { color: #fff; background: #16a34a; border-color: #16a34a; }
.btn-green:hover { color: #fff; background: #15803d; border-color: #15803d; }
.btn-blue { color: #fff; background: #2563eb; border-color: #2563eb; }
.btn-blue:hover { color: #fff; background: #1d4ed8; border-color: #1d4ed8; }
.btn-indigo { color: #fff; background: #4f46e5; border-color: #4f46e5; }
.btn-indigo:hover { color: #fff; background: #4338ca; border-color: #4338ca; }

/* Miniatura a sinistra nelle righe (stazioni, attrezzature). */
.hub-row__thumb { flex: 0 0 8rem; width: 8rem; height: 8rem; border-radius: .75rem; border: 1px solid #e5e7eb; object-fit: cover; background: #f9fafb; display: grid; place-items: center; color: #9ca3af; font-size: 2rem; }
@media (max-width: 767.98px) { .hub-row__thumb { flex-basis: 5rem; width: 5rem; height: 5rem; } }

/* Telefono: selettore a pillole, riquadri valore e moduli a passi numerati. */
.hub-pills { display: flex; gap: .25rem; background: #f3f4f6; border-radius: .75rem; padding: .25rem; margin-bottom: 1rem; overflow-x: auto; }
.hub-pills a { flex: 1 1 0; text-align: center; padding: .55rem .5rem; border-radius: .6rem; font-size: .7rem; font-weight: 900; color: #6b7280; text-decoration: none; white-space: nowrap; }
.hub-pills a.active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.hub-boxes { display: grid; grid-template-columns: repeat(var(--boxes, 2), minmax(0, 1fr)); gap: .5rem; margin: .5rem 0; }
.hub-box { border: 1px solid; border-radius: .75rem; padding: .5rem .65rem; min-width: 0; text-align: center; }
.hub-box small { display: block; font-size: .6rem; font-weight: 900; opacity: .85; }
.hub-box strong { display: block; font-size: .85rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-box--blue { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.hub-box--purple { background: #faf5ff; border-color: #e9d5ff; color: #581c87; }
.hub-box--green { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.hub-box--orange { background: #fff7ed; border-color: #fed7aa; color: #7c2d12; }
.hub-box--red { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.hub-box--gray { background: #f9fafb; border-color: #e5e7eb; color: #1f2937; }
.hub-box--teal { background: #f0fdfa; border-color: #99f6e4; color: #134e4a; }
.hub-box--yellow { background: #fefce8; border-color: #fef08a; color: #713f12; }
.hub-box--indigo { background: #eef2ff; border-color: #c7d2fe; color: #312e81; }
.hub-box--pink { background: #fdf2f8; border-color: #fbcfe8; color: #831843; }
.hub-step { background: #fff; border: 1px solid #f3f4f6; border-radius: 1.5rem; padding: 1.1rem; margin-bottom: 1rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .08); }
.hub-step__label { display: flex; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 900; color: #6b7280; letter-spacing: .03em; margin-bottom: .75rem; }
.hub-step__num { width: 1.25rem; height: 1.25rem; border-radius: .4rem; display: grid; place-items: center; font-size: .65rem; background: #f3e8ff; color: #9333ea; }
.hub-mbar { position: sticky; bottom: 0; z-index: 1020; display: grid; grid-template-columns: 1fr 2fr; gap: .5rem; padding: .75rem 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 30%); }
.hub-mbar .btn { padding: .9rem; border-radius: 1rem; font-weight: 900; }
.hub-row__subtitle { font-size: .85rem; color: #6b7280; margin: -.25rem 0 .5rem; }
.hub-fab--stack { bottom: calc(1.5rem + var(--fab-index, 0) * 4.75rem); }

/* Titoli nelle fasce colorate: prendono il colore della fascia, non quello
   scuro dei titoli del tema (body.app-body :is(h1...) e' piu' specifico). */
body.app-body :is(.acc-band, .hub-mhero__band, [class*="hub-grad--"]) :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) { color: inherit; }
