/* =========================================================
   Reset e base
   ========================================================= */

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) th,
:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) td {
  white-space: nowrap;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) .giacenze-erogato-column {
  width: 8rem;
  min-width: 8rem;
  max-width: 8rem;
  white-space: normal;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) .giacenze-contabile-column {
  width: 6rem;
  min-width: 6rem;
  max-width: 6rem;
  white-space: normal;
}

.giacenze-column-label {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.carichi-header {
  margin-bottom: 1.5rem;
}

.giacenze-venduto-panel {
  width: max-content;
  max-width: 100%;
}

.giacenze-venduto-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.65rem;
  color: #0f172a;
  background-color: color-mix(in srgb, var(--giacenze-product-color, #64748b) 18%, #fff);
  font-size: 0.875rem;
}

html[data-theme="dark"] .giacenze-venduto-heading {
  color: #0f172a;
  background-color: color-mix(in srgb, var(--giacenze-product-color, #64748b) 18%, #fff);
}

html[data-theme="dark"] .giacenze-venduto-table {
  --rz-grid-stripe-background-color: var(--fa-dark-surface-raised);
  --rz-grid-stripe-odd-background-color: var(--fa-dark-surface);
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table).giacenze-venduto-table {
  width: max-content;
  min-width: 0;
  max-width: 100%;
}

.page-heading-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  flex: 0 0 3rem;
  color: #2563eb;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 1.15rem;
}

.page-heading-copy :is(.nuovo-conteggio-page-title, .page-heading-page-title) {
  margin-bottom: 0.2rem;
}

:is(.accrediti-clienti-page-header--with-icon, .carichi-page-header--with-icon, .conti-page-header--with-icon, .gestione-page-header--with-icon, .giacenze-page-header--with-icon, .impostazioni-page-header--with-icon, .report-page-header--with-icon, .superadmin-dashboard-page-header--with-icon) {
  margin-bottom: 1.5rem;
}

:is(.carichi-panel, .giacenze-panel) {
  background: #fffdf9;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.giacenze-summary {
  padding-bottom: 1rem;
  border-bottom: 1px solid #eef2f7;
}

:is(.carichi-carichi-section, .giacenze-carichi-section) {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eef2f7;
}

.giacenze-carichi-save {
  min-height: 2.35rem;
  color: #fff;
  background: #16803c;
  border-color: #16803c;
}

.giacenze-carichi-save:hover,
.giacenze-carichi-save:focus-visible {
  color: #fff;
  background: #126b32;
  border-color: #126b32;
}

.giacenze-carichi-restore {
  min-height: 2.35rem;
  color: #9a3412;
  background: #fff7ed;
  border-color: #fdba74;
}

.giacenze-carichi-restore:hover,
.giacenze-carichi-restore:focus-visible {
  color: #7c2d12;
  background: #ffedd5;
  border-color: #fb923c;
}

.giacenze-carichi-new {
  min-height: 2.35rem;
}

:is(.carichi-carichi-section, .giacenze-carichi-section) .fa-table-action:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.45;
}

.giacenze-carichi-dirty {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #9a6700;
  font-size: 0.78rem;
  font-weight: 600;
}

.giacenze-carichi-dirty i {
  font-size: 0.45rem;
}

.giacenze-carichi-table-wrap {
  border: 1px solid #e7ded0;
  border-radius: 10px;
}

:is(.carichi-panel, .giacenze-panel) :is(.carichi-carichi-table, .home-carichi-table) {
  min-width: 860px;
}

:is(.carichi-carichi-table, .home-carichi-table) thead th {
  padding: 0.55rem 0.5rem;
}

:is(.carichi-carichi-table, .home-carichi-table) thead th:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) {
  text-align: center;
  vertical-align: middle !important;
}

:is(.carichi-carichi-table, .home-carichi-table) thead th:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  color: #475569;
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

:is(.carichi-carichi-table, .home-carichi-table) tbody td {
  padding: 0.3rem 0.35rem;
}

:is(.carichi-panel, .giacenze-panel) :is(.carichi-carichi-table, .home-carichi-table) tbody td {
  padding: 0.3rem 0.35rem;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) .giacenze-carichi-input {
  width: 100%;
  min-width: 5rem;
  min-height: 1.9rem;
  height: 1.9rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) .giacenze-carichi-input--date {
  min-width: 7.5rem;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) .giacenze-carichi-input--document {
  width: 6.5rem;
  min-width: 0;
}

:is(.carichi-carichi-table, .home-carichi-table) th.giacenze-carichi-document,
:is(.carichi-carichi-table, .home-carichi-table) td.giacenze-carichi-document {
  width: 1%;
  max-width: 7rem;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-document .giacenze-carichi-input {
  width: 6.5rem;
  min-width: 0;
}

:is(.carichi-carichi-table, .home-carichi-table) th.giacenze-carichi-type-column,
:is(.carichi-carichi-table, .home-carichi-table) td.giacenze-carichi-type-column {
  width: 10rem;
  min-width: 10rem;
  max-width: 10rem;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-document .giacenze-carichi-type {
  width: 100%;
  min-width: 0;
  color: #0f172a;
  background-color: #fff;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type.rz-dropdown {
  min-height: 1.9rem;
  height: 1.9rem;
  padding: 0 0.45rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type.rz-dropdown:not(.rz-state-disabled) {
  cursor: pointer;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type.rz-dropdown .rz-dropdown-label {
  flex: 1;
  min-width: 0;
  padding: 0;
  line-height: 1.8rem;
  text-align: center;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type.rz-dropdown .rz-dropdown-trigger {
  width: 1.35rem;
  min-width: 1.35rem;
  align-items: center;
  justify-content: center;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type.rz-dropdown .rz-dropdown-trigger .rzi {
  font-size: 1rem;
  transform: translateY(3px);
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type:is(.rz-state-disabled, :disabled) {
  opacity: 1;
  color: #000;
  background-color: #fff;
  border-color: #ced4da;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type:is(.rz-state-disabled, :disabled) .rz-dropdown-label {
  color: #000;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type:is(.rz-state-disabled, :disabled).rz-dropdown .rz-inputtext {
  color: #000;
}

:is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type:is(.rz-state-disabled, :disabled) .rz-dropdown-trigger {
  display: none;
}

.giacenze-carichi-pagination {
  min-height: 2.35rem;
}

.giacenze-carichi-page-size select {
  width: auto;
  min-width: 4.25rem;
}

.giacenze-carichi-page-controls {
  min-height: 2.35rem;
}

.giacenze-carichi-page-button {
  width: 2.35rem;
  min-width: 2.35rem;
  padding-inline: 0.5rem;
}

.giacenze-carichi-page-input {
  width: 2.75rem;
  min-width: 2.75rem;
  height: 1.8rem;
  min-height: 1.8rem;
  padding: 0.15rem 0.25rem;
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
}

:is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(odd) > td {
  background: #fff;
}

:is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(even) > td {
  background: #f1f5f9;
}

:is(.carichi-carichi-table, .home-carichi-table) tbody tr:hover > td:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  background: #e2e8f0;
}

:is(.carichi-carichi-table, .home-carichi-table) tbody tr:hover > td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) {
  background-color: color-mix(in srgb, var(--giacenze-product-color) 18%, #fff) !important;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) tbody tr:hover > td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) {
  background-color: color-mix(in srgb, var(--giacenze-product-color) 18%, #fff) !important;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) thead th:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  color: var(--fa-dark-text-muted);
  background: var(--fa-dark-surface-raised);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(odd) > td:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface);
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(even) > td:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  color: #dce1e7;
  background: var(--fa-dark-surface-raised);
}

/* I colori dei carichi arrivano dalla palette caricata dal database. */
.carichi-carichi-product--benzina { --giacenze-product-color: var(--carichi-benzina); }
.carichi-carichi-product--gasolio { --giacenze-product-color: var(--carichi-gasolio); }
.carichi-carichi-product--gpl { --giacenze-product-color: var(--carichi-gpl); }

:is(.carichi-carichi-table, .home-carichi-table) td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) .giacenze-carichi-input {
  color: inherit;
  background: transparent;
  border-color: color-mix(in srgb, currentColor 38%, #fff);
}

:is(.carichi-carichi-table, .home-carichi-table) td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) .giacenze-carichi-input:focus {
  background: rgba(255, 255, 255, 0.7);
  border-color: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 22%, transparent);
}

.giacenze-period-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.7rem;
  color: #475569;
  background: #f7f3ec;
  border: 1px solid #e7ded0;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.giacenze-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.giacenze-manual-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  background: #fff8e8;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
}

.giacenze-manual-notice-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  color: #9a6700;
  background: #ffedbf;
  border-radius: 7px;
}

.giacenze-manual-notice-copy {
  min-width: 0;
  flex: 1;
  color: #5f4a20;
  font-size: 0.85rem;
}

.giacenze-manual-notice-copy strong {
  display: block;
  margin-bottom: 0.15rem;
  color: #704f00;
}

.giacenze-manual-reset {
  flex: 0 0 auto;
  align-self: center;
}

.giacenze-filter-toggle {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  color: #24538a;
  background: #eef6ff;
  border: 1px solid #cfe1f5;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.giacenze-filter-toggle:hover,
.giacenze-filter-toggle:focus-visible {
  color: #17416f;
  background: #dbeafe;
  border-color: #9ec5e8;
  outline: none;
}

.giacenze-filters {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
  background: #f7faff;
  border: 1px solid #cfe1f5;
  border-radius: 12px;
}

.giacenze-filter-intro {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #dbe7f2;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
}

.giacenze-filter-intro strong {
  display: block;
  color: #1e3a5f;
  font-size: 0.85rem;
}

.giacenze-filter-intro small {
  display: block;
  margin-top: 0.15rem;
  color: #60748a;
  font-size: 0.72rem;
  font-weight: 400;
}

.giacenze-filter-intro i {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  color: #2563eb;
  background: #e7f0fb;
  border-radius: 7px;
}

.giacenze-filter-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  width: min(100%, 48rem);
}

.giacenze-filter-field {
  min-width: 0;
}

.giacenze-filter-field .rz-datepicker,
.giacenze-filter-field .rz-calendar {
  width: 100%;
}

.giacenze-filter-hint {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dbe7f2;
  color: #64748b;
  font-size: 0.75rem;
  text-align: left;
}

.giacenze-filter-hint i {
  color: #60748a;
}

.giacenze-filter-field :is(.accrediti-clienti-edit-label, .aggiungi-impianto-modal-edit-label, .assegna-impianto-modal-edit-label, .clienti-credito-gestione-edit-label, .clienti-credito-tab-edit-label, .conti-edit-label, .erogatori-tab-edit-label, .giacenze-edit-label, .modifica-impianto-modal-edit-label, .modifica-utente-modal-edit-label, .nuovo-conteggio-edit-label, .operatori-edit-label, .preset-pompe-edit-label, .report-edit-label, .rubrica-email-settings-edit-label, .turni-edit-label) {
  margin-bottom: 0.35rem;
}

.giacenze-filter-field .rz-datepicker {
  min-width: 9.5rem;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) {
  min-width: 980px;
  --bs-table-bg: transparent;
  --bs-table-border-color: #eef2f7;
}

/* Anteprima del carico di riconciliazione: due colonne dentro un popup stretto. */
.carichi-table.giacenze-riconciliazione-table {
  min-width: 0;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) :is(th, td) {
  border-color: #cbd5e1;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) thead th:not(.giacenze-product-color) {
  padding: 0.75rem 0.85rem;
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
  vertical-align: middle;
}

:is(.carichi-table, .home-carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table, .serbatoio-heading) .giacenze-product-color {
  background-color: color-mix(in srgb, var(--giacenze-product-color) 18%, #fff) !important;
  color: #0f172a !important;
  font-weight: 700;
}

.carichi-totale-section td.giacenze-product-color:not(.fw-semibold) {
  font-weight: 400;
}

.carichi-totale-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 32rem);
}

html[data-theme="dark"] .carichi-totale-filters .giacenze-filter-intro {
  color: #cbd5e1;
  border-color: #334155;
}

html[data-theme="dark"] .carichi-totale-filters .giacenze-filter-intro strong {
  color: #e2e8f0;
}

html[data-theme="dark"] .carichi-totale-filters .giacenze-filter-intro small {
  color: #94a3b8;
}

html[data-theme="dark"] .carichi-totale-filters .giacenze-filter-intro i {
  color: #93c5fd;
  background: #1e3a5f;
}

html[data-theme="dark"] .carichi-totale-filters .giacenze-filter-hint {
  color: #aab8ca;
  border-color: #334155;
}

html[data-theme="dark"] .carichi-totale-filters .giacenze-filter-hint i {
  color: #93c5fd;
}

@media (max-width: 600px) {
  .carichi-totale-fields {
    grid-template-columns: minmax(0, 1fr);
  }}

html[data-theme="dark"] :is(.carichi-table, .home-carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table, .serbatoio-heading) .giacenze-product-color {
  background-color: color-mix(in srgb, var(--giacenze-product-color) 18%, #fff) !important;
  color: #0f172a !important;
}

.giacenze-summary-table th,
.giacenze-summary-table td,
.giacenze-serbatoi-table th,
.giacenze-serbatoi-table td {
  border: 1px solid #cbd5e1;
}

.giacenze-summary-table thead th,
.giacenze-serbatoi-table thead th {
  border-color: #e2e8f0;
}

.giacenze-serbatoi-table {
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}

.giacenze-summary-table {
  width: 100%;
  min-width: 1400px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.giacenze-summary-table :is(th, td),
.giacenze-serbatoi-table :is(th, td) {
  border-width: 0 1px 1px 0;
}

.giacenze-summary-table tr > :first-child,
.giacenze-serbatoi-table tr > :first-child {
  border-left-width: 1px;
}

.giacenze-summary-table thead tr:first-child > *,
.giacenze-serbatoi-table thead tr:first-child > * {
  border-top-width: 1px;
}

.giacenze-summary-table tr > :first-child,
.giacenze-serbatoi-table tr > :first-child {
  position: sticky;
  left: 0;
  z-index: 3;
}

.giacenze-summary-table thead th:first-child,
.giacenze-serbatoi-table thead th:first-child {
  z-index: 4;
}

.giacenze-serbatoi-table tbody th {
  background: #fff;
}

html[data-theme="dark"] .giacenze-serbatoi-table tbody th {
  background: var(--fa-dark-surface-raised);
}

.giacenze-summary-table :is(th, td):nth-child(1) {
  width: 7%;
}
.giacenze-summary-table :is(th, td):nth-child(2) {
  width: 8%;
}
.giacenze-summary-table :is(th, td):nth-child(3) {
  width: 7%;
}
.giacenze-summary-table :is(th, td):nth-child(4) {
  width: 7%;
}
.giacenze-summary-table :is(th, td):nth-child(5),
.giacenze-summary-table :is(th, td):nth-child(6) {
  width: 8%;
}
.giacenze-summary-table :is(th, td):nth-child(7) {
  width: 9%;
}
.giacenze-summary-table :is(th, td):nth-child(8) {
  width: 7%;
}
.giacenze-summary-table :is(th, td):nth-child(9) {
  width: 6%;
}
.giacenze-summary-table :is(th, td):nth-child(10) {
  width: 8%;
}
.giacenze-summary-table :is(th, td):nth-child(11) {
  width: 8%;
}
.giacenze-summary-table :is(th, td):nth-child(12) {
  width: 8%;
}
.giacenze-summary-table :is(th, td):nth-child(13) {
  width: 9%;
}

.giacenze-summary-table .giacenze-scatti-column {
  white-space: normal;
}

.giacenze-summary-table .giacenze-iniziale-column {
  white-space: normal;
}

.giacenze-summary-table .giacenze-somma-column {
  white-space: normal;
}

.giacenze-summary-table td.giacenze-somma-column {
  white-space: nowrap;
}

.giacenze-summary-table .giacenze-current-column {
  min-width: 0;
  white-space: normal;
}

.giacenze-summary-table .giacenze-input--manual {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.giacenze-summary-table .giacenze-current-column .giacenze-input--current {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.giacenze-serbatoi-table {
  width: max-content;
  min-width: 0;
  max-width: none;
  table-layout: fixed;
}

.giacenze-serbatoi-table :is(th, td):not(:first-child) {
  width: 6rem;
  padding: 0.85rem 10px;
}

.giacenze-serbatoi-table input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  text-align: end;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody th,
:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody td {
  padding: 1rem 0.85rem;
  color: #334155;
}

.giacenze-carichi-date-cell .rz-datepicker {
  width: 7.25rem !important;
  min-width: 0 !important;
  height: 1.9rem !important;
  min-height: 1.9rem !important;
  --rz-datepicker-trigger-icon-width: 0.9rem;
  --rz-datepicker-trigger-icon-height: 0.9rem;
  --rz-datepicker-line-height: 1.1rem;
}

.giacenze-carichi-date-cell .rz-datepicker .rz-inputtext {
  box-sizing: border-box;
  width: 100% !important;
  height: 1.9rem !important;
  min-height: 1.9rem !important;
  padding: 0.2rem 1.2rem 0.2rem 0.45rem !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
}

.giacenze-carichi-date-cell .giacenze-carichi-date.rz-state-disabled {
  opacity: 1 !important;
}

.giacenze-carichi-date-cell .giacenze-carichi-date .rz-inputtext,
.giacenze-carichi-date-cell .giacenze-carichi-date.rz-state-disabled .rz-inputtext {
  color: inherit !important;
  background-color: transparent !important;
  border-color: color-mix(in srgb, currentColor 28%, transparent) !important;
  opacity: 1 !important;
  -webkit-text-fill-color: currentColor !important;
}

.giacenze-carichi-date-cell .giacenze-carichi-date.rz-state-disabled .rz-datepicker-trigger {
  color: inherit !important;
  opacity: 1 !important;
}

.giacenze-carichi-date-cell .rz-datepicker .rz-datepicker-field-button {
  inset-inline-end: 0.35rem;
}

.giacenze-carichi-date-cell .rz-datepicker .rz-datepicker-trigger {
  width: 0.9rem !important;
  height: 0.9rem !important;
  font-size: 0.9rem !important;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody th {
  color: #0f172a;
  font-weight: 700;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody tr:last-child th,
:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody tr:last-child td {
  border-bottom: 0;
}

.giacenze-summary-table tbody tr:last-child th,
.giacenze-summary-table tbody tr:last-child td,
.giacenze-serbatoi-table tbody tr:last-child th,
.giacenze-serbatoi-table tbody tr:last-child td {
  border-bottom: 1px solid #cbd5e1;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) th,
:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) td,
:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) .text-end {
  text-align: center !important;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) :is(.carichi-input, .giacenze-input) {
  text-align: center !important;
}

.giacenze-result-column {
  border-left: 1px solid #cfe1f5 !important;
  border-right: 1px solid #cfe1f5 !important;
  font-variant-numeric: tabular-nums;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody .giacenze-result-column {
  font-size: 1rem;
}

.giacenze-result {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.2rem;
}

.giacenze-result-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody .giacenze-result--balanced {
  color: #000 !important;
  background: #f0fdf4 !important;
  font-weight: 700;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody .giacenze-result--surplus {
  color: #000 !important;
  background: lightgreen !important;
  font-weight: 700;
}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) tbody .giacenze-result--shortage {
  color: #000 !important;
  background: red !important;
  font-weight: 700;
}

:is(.carichi-input, .giacenze-input) {
  width: 8.25rem;
  min-height: 2.35rem;
  padding-right: 0.7rem;
  color: #0f172a;
  background: #fff;
  border-color: #cbd5e1;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

:is(.carichi-input, .giacenze-input):focus {
  background: #fffdf5;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.giacenze-input--manual {
  background: #fffdf5;
}

.giacenze-input--current {
  width: 6rem;
  background: #f8fafc;
}

.giacenze-current-column {
  width: 6.5rem;
  min-width: 6.5rem;
  white-space: normal !important;
  line-height: 1.15;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

:is(.carichi-panel, .giacenze-panel) .alert {
  border-radius: 10px;
}

@media (max-width: 768px) {
  .page-heading {
    align-items: flex-start !important;
  }

  .page-heading-icon {
    width: 2.65rem;
    height: 2.65rem;
    flex-basis: 2.65rem;
  }

  .giacenze-carichi-header {
    align-items: stretch !important;
  }

  .giacenze-carichi-actions {
    width: 100%;
  }

  .giacenze-carichi-actions .giacenze-carichi-restore,
  .giacenze-carichi-actions .giacenze-carichi-save {
    flex: 1;
    justify-content: center;
  }

  .giacenze-carichi-pagination {
    align-items: stretch !important;
    flex-direction: column;
  }

  .giacenze-carichi-pagination > div {
    width: 100%;
  }

  .giacenze-carichi-pagination .fa-table-action {
    flex: 1;
    justify-content: center;
  }

  .giacenze-manual-notice {
    flex-wrap: wrap;
  }

  .giacenze-manual-reset {
    width: 100%;
    justify-content: center;
  }

  :is(.carichi-panel, .giacenze-panel) {
    padding: 1rem !important;
  }

  .giacenze-filters {
    align-items: stretch;
  }

  .giacenze-filter-intro,
  .giacenze-filter-fields,
  .giacenze-filter-hint {
    width: 100%;
  }

  .giacenze-filter-fields {
    grid-template-columns: 1fr;
  }

  :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) th,
  :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) td {
    padding-inline: 0.7rem;
  }}

:is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) thead th {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

html,
body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  margin: 0;
  padding: 0;
}

html,
body,
.app-main {
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

h1:focus {
  outline: none;
}

/* =========================================================
   Layout applicazione (MainLayout)
   ========================================================= */

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.app-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: #f8fafc;
  min-height: 100vh;
}

.app-main:has(.nc2-layout) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
}

.app-content:has(.nc2-layout) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding-block: 1rem;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 2.5rem;
  color: #7c2d12;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  font-size: 0.86rem;
}

.impersonation-banner__copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.impersonation-banner__copy i {
  flex: 0 0 auto;
}

.impersonation-banner__original {
  color: #9a3412;
}

.impersonation-banner__action {
  flex: 0 0 auto;
  padding: 0.4rem 0.75rem;
  color: #9a3412;
  background: transparent;
  border: 1px solid #fdba74;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.impersonation-banner__action:hover,
.impersonation-banner__action:focus-visible {
  color: #7c2d12;
  background: #ffedd5;
  border-color: #fb923c;
}

.app-content {
  flex: 1;
  padding: 2rem 2.5rem;
}

.app-footer {
  flex: 0 0 auto;
  padding: 0.8rem 2.5rem;
  color: #475569;
  border-top: 1px solid #e2e8f0;
  font-size: 0.8rem;
}

.app-footer-content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 100%;
}

html[data-theme="dark"] .app-footer {
  color: var(--fa-dark-text-muted);
  border-color: var(--fa-dark-border);
}

@media (max-width: 768px) {
  .app-footer {
    padding-inline: 1rem;
  }}

@media (max-width: 480px) {
  .app-footer-content {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }}

.app-content > :not(.page-loader-wrap) {
  animation: page-content-enter 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes page-content-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   Sidebar (NavMenu)
   ========================================================= */

.sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0 0 0;
  overflow: hidden;
  z-index: 100;
  transition:
    width 0.2s ease,
    min-width 0.2s ease;
}

/* ── Sidebar collassata ──────────────────────────────────── */
.sidebar--collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar--collapsed .sidebar-logo {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar--collapsed .sidebar-logo-text {
  display: none;
}

.sidebar--collapsed .impianto-selector {
  width: 38px;
}

.sidebar--collapsed .sidebar-logo-copy {
  display: none;
}

.sidebar--collapsed .nav-item {
  justify-content: center;
  padding: 0.65rem;
  gap: 0;
}

.sidebar--collapsed .nav-item span {
  display: none;
}

.sidebar--collapsed .nav-item i {
  width: auto;
}

.sidebar--collapsed .sidebar-footer {
  flex-direction: column;
  align-items: center;
  padding: 1rem 0;
  gap: 0.5rem;
}

.sidebar--collapsed .sidebar-user {
  flex: 0 0 auto;
  padding: 0.35rem;
  justify-content: center;
  gap: 0;
}

.sidebar--collapsed .user-info {
  display: none;
}

.sidebar--collapsed .sidebar-user-settings-icon {
  display: none;
}

/* ── Bottone collapse ────────────────────────────────────── */
.sidebar-nav-spacer {
  flex: 1;
}

.sidebar-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: auto 0.75rem 0.75rem;
}

.sidebar-toggle-btn {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  margin: 0;
  color: rgba(255, 255, 255, 0.3);
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar-toggle-btn.active {
  background: none !important;
  color: rgba(255, 255, 255, 0.3) !important;
}

/* Impianto attivo */
.sidebar-impianto {
  padding: 0.6rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-impianto-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.3rem;
  padding-left: 0.1rem;
}

.sidebar-impianto-nome {
  color: #cbd5e1;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Radzen dropdown — box chiuso
   La classe sidebar-impianto-select è sul MEDESIMO elemento .rz-dropdown, non su un genitore */
.rz-dropdown.sidebar-impianto-select {
  background: #1d2537 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  width: 100%;
}

.rz-dropdown.sidebar-impianto-select:hover {
  border-color: rgba(255, 255, 255, 0.3) !important;
  background: #1d2537 !important;
}

.rz-dropdown.sidebar-impianto-select .rz-inputtext {
  background: transparent !important;
  color: #cbd5e1 !important;
  font-size: 0.82rem;
}

.rz-dropdown.sidebar-impianto-select .rz-dropdown-trigger {
  color: #64748b !important;
}

.sidebar-impianto-loading {
  min-height: 1.5rem;
  display: flex;
  align-items: center;
}

/* Radzen dropdown — panel popup (overlay, scopato via DropDownCssClass) */
.sidebar-impianto-dropdown-panel {
  background: #1d2537 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.sidebar-impianto-dropdown-panel .rz-dropdown-list {
  background: #1d2537;
}

.sidebar-impianto-dropdown-panel .rz-dropdown-item {
  color: #cbd5e1;
  background: #1d2537;
}

.sidebar-impianto-dropdown-panel .rz-dropdown-item:hover,
.sidebar-impianto-dropdown-panel .rz-dropdown-item.rz-state-hover {
  background: #263448;
  color: #e2e8f0;
}

.sidebar-impianto-dropdown-panel .rz-dropdown-item.rz-state-highlight {
  background: #1e3a5f;
  color: #e2e8f0;
}

/* Font size globale per le option di tutte le dropdown Radzen */
.rz-dropdown-panel .rz-dropdown-list {
  max-height: min(22rem, calc(100vh - 2rem));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rz-dropdown-panel .rz-dropdown-item {
  font-size: var(--fa-dropdown-font-size, 0.8rem);
  line-height: 1.5;
}

.rz-dropdown-panel .rz-dropdown-item.fa-single-result {
  background-color: var(--rz-dropdown-item-hover-background-color);
  color: var(--rz-dropdown-item-hover-color);
}

.sidebar--collapsed .sidebar-impianto {
  display: none;
}

/* Logo */
.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logo-container {
  display: flex;
  padding: 0 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 0.6rem;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-icon svg {
  width: 22px;
  height: 22px;
}
.sidebar-logo-icon i {
  font-size: 1.15rem;
  color: white;
}

.sidebar-logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.2px;
}

/* Voci di navigazione */
.sidebar-nav {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 0.75rem 0 0.75rem;
  overflow-y: auto;
}

.impianto-selector {
  position: relative;
}

.impianto-selector__trigger {
  anchor-name: --impianto-trigger;
  padding: 0;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.impianto-selector__trigger:hover,
.impianto-selector__trigger:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.impianto-selector__trigger:focus-visible,
.impianto-selector__option:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.impianto-selector__trigger .impianto-selector__chevron {
  margin-left: 0.25rem;
  font-size: 0.5rem;
  transition: transform 0.15s ease;
}

.impianto-selector:has(.impianto-selector__menu:popover-open) .impianto-selector__chevron {
  transform: rotate(180deg);
}

.sidebar-logo-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 0.12rem;
}

.impianto-selector__label {
  color: #d6dbe3;
  font-size: 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-logo-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.impianto-selector__menu {
  position: fixed;
  inset: auto;
  position-anchor: --impianto-trigger;
  top: anchor(bottom);
  left: anchor(left);
  width: min(18rem, calc(100vw - 2rem));
  max-height: min(70vh, 30rem);
  margin: 0.5rem 0 0;
  padding: 0.4rem;
  overflow: auto;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  color: #172033;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.impianto-selector__menu:popover-open {
  display: grid;
  gap: 0.25rem;
}

.impianto-selector__option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #172033;
  background: #f7f9fc;
  text-align: left;
  cursor: pointer;
}

.impianto-selector__option:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.impianto-selector__option.is-selected {
  border-color: #60a5fa;
  background: #eff6ff;
}

.impianto-selector__option-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  font-weight: 650;
}

.impianto-selector__current {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Icone FA nella sidebar */
.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.logout-btn i {
  font-size: 0.95rem;
}

/* Selettore azienda: stesso menu del selettore impianto, aperto verso l'alto dal footer. */
.azienda-selector__trigger {
  anchor-name: --azienda-trigger;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 44px;
  padding: 0.4rem 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.azienda-selector__trigger:hover,
.azienda-selector__trigger:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.azienda-selector__trigger:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.azienda-selector__icon {
  width: 20px;
  flex-shrink: 0;
  text-align: center;
}

.azienda-selector__copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 0.12rem;
}

.azienda-selector__name {
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.azienda-selector__chevron {
  font-size: 0.6rem;
  transition: transform 0.15s ease;
}

.azienda-selector:has(.azienda-selector__menu:popover-open) .azienda-selector__chevron {
  transform: rotate(180deg);
}

.impianto-selector__menu.azienda-selector__menu {
  position-anchor: --azienda-trigger;
  top: auto;
  bottom: anchor(top);
  margin: 0 0 0.5rem;
}

.azienda-selector__role {
  display: block;
  margin-top: 0.15rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
}

html[data-theme="dark"] .azienda-selector__role {
  color: var(--fa-dark-text-muted);
}

.sidebar--collapsed .azienda-selector__trigger {
  justify-content: center;
  width: 38px;
  margin-inline: auto;
  padding: 0;
}

.sidebar--collapsed :is(.azienda-selector__copy, .azienda-selector__chevron) {
  display: none;
}

/* Footer: utente + logout */
.sidebar-footer {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-footer-actions--expanded {
  flex-direction: row;
  flex-wrap: nowrap;
}

.sidebar-footer-actions--expanded .logout-btn {
  flex: 0 0 34px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.625rem 0.5rem 0;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
  color: white;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.sidebar-user.active {
  background: rgba(59, 130, 246, 0.15);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-settings-icon {
  width: 20px;
  margin-left: auto;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  text-align: center;
}

.sidebar-user:hover .sidebar-user-settings-icon,
.sidebar-user.active .sidebar-user-settings-icon {
  color: #ffffff;
}

:is(.nav-menu-user-name, .superadmin-dashboard-user-name) {
  font-size: 0.8375rem;
  font-weight: 600;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-form {
  display: flex;
}

.logout-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
  padding: 0;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* =========================================================
   Errore Blazor
   ========================================================= */

#blazor-error-ui {
  color-scheme: light only;
  background: #fef3c7;
  border-top: 1px solid #f59e0b;
  bottom: 0;
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  font-size: 0.875rem;
  color: #92400e;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.blazor-error-boundary {
  background: #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}

/* =========================================================
   Stili comuni pagine applicative
   ========================================================= */

:is(.accrediti-clienti-page-header, .carichi-page-header, .conti-page-header, .gestione-page-header, .giacenze-page-header, .impostazioni-page-header, .nuovo-conteggio-page-header, .report-page-header, .superadmin-dashboard-page-header) {
  margin-bottom: 2rem;
}

:is(.nuovo-conteggio-page-title, .page-heading-page-title) {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.3px;
}

:is(.nuovo-conteggio-page-subtitle, .page-heading-page-subtitle) {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0;
}

:is(.carichi-placeholder-box, .conti-placeholder-box, .erogatori-tab-placeholder-box, .gestione-placeholder-box, .giacenze-placeholder-box, .nuovo-conteggio-placeholder-box, .report-placeholder-box) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem;
  background: white;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
  max-width: 400px;
}

:is(.carichi-placeholder-box, .conti-placeholder-box, .erogatori-tab-placeholder-box, .gestione-placeholder-box, .giacenze-placeholder-box, .nuovo-conteggio-placeholder-box, .report-placeholder-box) svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

:is(.carichi-placeholder-box, .conti-placeholder-box, .erogatori-tab-placeholder-box, .gestione-placeholder-box, .giacenze-placeholder-box, .nuovo-conteggio-placeholder-box, .report-placeholder-box) p {
  margin: 0;
  font-size: 0.95rem;
}

/* =========================================================
   Pagine auth (Login, Register, ConfirmEmail) — layout
   ========================================================= */

:is(.accept-invite-auth-wrapper, .confirm-email-auth-wrapper, .forgot-password-auth-wrapper, .forgot-password-confirmation-auth-wrapper, .invalid-password-reset-auth-wrapper, .login-auth-wrapper, .register-auth-wrapper, .register-confirmation-auth-wrapper, .resend-email-confirmation-auth-wrapper, .reset-password-auth-wrapper, .reset-password-confirmation-auth-wrapper) {
  display: flex;
  min-height: 100vh;
}

.home-button {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 18px;

  &:hover {
    background: white;
    color: #0a1628;
  }
}

.left-container {
  flex-direction: column;
  justify-content: space-between;
  display: flex;
  background: linear-gradient(150deg, #0a1628 0%, #0d2341 40%, #0c3560 75%, #0b4a8a 100%);
  flex: 0 0 48%;
  overflow: hidden;
}

/* Panel sinistro — branding */
.brand-panel {
  padding-top: 0px !important;
  padding: 3.5rem;
  color: white;
  position: relative;
}

/* Cerchi decorativi */
.brand-panel::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.brand-panel::after {
  content: "";
  position: absolute;
  bottom: -160px;
  left: -80px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.brand-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

/* Icona brand */
.brand-icon {
  width: 68px;
  height: 68px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.brand-icon svg {
  width: 36px;
  height: 36px;
}

/* Nome app */
.brand-name {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.75px;
  color: white;
  margin: 0 0 0.875rem 0;
  line-height: 1.1;
}

/* Tagline */
.brand-tagline {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 360px;
  line-height: 1.65;
  margin: 0 0 2.5rem 0;
}

/* Feature list */
.brand-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
}

.feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  flex-shrink: 0;
}

/* Copyright */
.brand-copyright {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
}

/* Panel destro — form */
:is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: #f8fafc;
}

:is(.accept-invite-form-card, .confirm-email-form-card, .forgot-password-confirmation-form-card, .forgot-password-form-card, .login-form-card, .register-confirmation-form-card, .register-form-card, .resend-email-confirmation-form-card, .reset-password-form-card) {
  width: 100%;
  max-width: 420px;
}

/* Report — avviso nessun conteggio */
.report-no-conteggi {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  color: #92400e;
  margin-top: 1rem;
}

.report-no-conteggi i {
  color: #f59e0b;
  margin-top: 2px;
  flex-shrink: 0;
}

.report-layout {
  max-width: 980px;
}

.report-panel {
  display: flex;
  flex-direction: column;
}

.report-panel :is(.carichi-section-title, .giacenze-section-title, .report-section-title) {
  margin-bottom: 1.25rem;
}

.report-panel .report-section-title {
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.report-panel > .text-muted {
  line-height: 1.5;
}

.report-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding-top: 1.25rem;
}

.report-email-name {
    display: flex;
    align-items: center;
    gap: 10px;
    > input {
      margin-top: 0px !important;
    }
}

.report-actions .fa-table-action {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    min-height: 2.75rem;
    justify-content: center;
}

.report-share-status {
  flex-basis: 100%;
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
}

html[data-theme="dark"] .report-share-status {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .prima-nota-panel--blue {
  border-color: #35485b !important;
  background: #202a37 !important;
}

html[data-theme="dark"] .mancati-pagamenti-tab-panel--amber {
  border-color: #4b412e !important;
  background: #2b271f !important;
}

/* Le schede del conteggio restano su una riga e scorrono quando serve. */
.nc2-tab-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.nc2-tab-nav :is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) {
  flex: 0 0 auto;
  white-space: nowrap;
}

.nc2-tab-nav::-webkit-scrollbar {
  display: block;
  height: 6px;
}

.report-panel .fa-table-action--secondary:disabled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
}

.report-actions .fa-table-action:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.report-action-status {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  max-width: 980px;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.85rem;
}

.report-action-status i {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.report-action-status a {
  margin-left: 0.25rem;
  color: inherit;
  font-weight: 700;
}

.report-action-status--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

/* Pagina conferma email */
:is(.forgot-password-confirm-icon, .forgot-password-confirmation-confirm-icon, .register-confirmation-confirm-icon, .resend-email-confirmation-confirm-icon, .reset-password-confirm-icon) {
  font-size: 3rem;
  color: #4f8ef7;
  margin-bottom: 1rem;
}

:is(.forgot-password-confirmation-confirm-hint, .register-confirmation-confirm-hint, .resend-email-confirmation-confirm-hint) {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #f0f4ff;
  border: 1px solid #c7d7fc;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 1.5rem;
}

:is(.forgot-password-confirmation-confirm-hint, .register-confirmation-confirm-hint, .resend-email-confirmation-confirm-hint) i {
  color: #4f8ef7;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Header form */
:is(.accept-invite-form-header, .forgot-password-confirmation-form-header, .forgot-password-form-header, .login-form-header, .register-confirmation-form-header, .register-form-header, .resend-email-confirmation-form-header, .reset-password-form-header) {
  margin-bottom: 2rem;
}

:is(.accept-invite-form-header, .forgot-password-confirmation-form-header, .forgot-password-form-header, .login-form-header, .register-confirmation-form-header, .register-form-header, .resend-email-confirmation-form-header, .reset-password-form-header) h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.375rem 0;
  letter-spacing: -0.3px;
}

:is(.accept-invite-form-header, .forgot-password-confirmation-form-header, .forgot-password-form-header, .login-form-header, .register-confirmation-form-header, .register-form-header, .resend-email-confirmation-form-header, .reset-password-form-header) p {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0;
}

/* Alert */
.alert {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #16a34a;
}

/* Campi */
:is(.accept-invite-field-group, .forgot-password-field-group, .login-field-group, .register-field-group, .resend-email-confirmation-field-group, .reset-password-field-group) {
  margin-bottom: 1.1rem;
}

:is(.accept-invite-field-group, .forgot-password-field-group, .login-field-group, .register-field-group, .resend-email-confirmation-field-group, .reset-password-field-group) label {
  display: block;
  font-size: 0.8375rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.4rem;
}

:is(.accept-invite-field-input, .forgot-password-field-input, .login-field-input, .register-field-input, .resend-email-confirmation-field-input, .reset-password-field-input) {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9375rem;
  color: #0f172a;
  background: white;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}

:is(.accept-invite-field-input, .forgot-password-field-input, .login-field-input, .register-field-input, .resend-email-confirmation-field-input, .reset-password-field-input):focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

:is(.accept-invite-field-input, .forgot-password-field-input, .login-field-input, .register-field-input, .resend-email-confirmation-field-input, .reset-password-field-input)::placeholder {
  color: #94a3b8;
}

:is(.accept-invite-field-error, .forgot-password-field-error, .login-field-error, .register-field-error, .resend-email-confirmation-field-error, .reset-password-field-error) {
  display: block;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 0.3rem;
}

/* Riga Ricordami / Password dimenticata */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.remember-check {
  width: 15px;
  height: 15px;
  accent-color: #3b82f6;
  cursor: pointer;
}

:is(.login-link-subtle, .register-confirmation-link-subtle, .resend-email-confirmation-link-subtle) {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}

:is(.login-link-subtle, .register-confirmation-link-subtle, .resend-email-confirmation-link-subtle):hover {
  color: #3b82f6;
}

/* Wrapper campo password con occhio */
:is(.accept-invite-password-wrapper, .login-password-wrapper, .register-password-wrapper, .reset-password-password-wrapper) {
  position: relative;
  display: flex;
  align-items: center;
}

:is(.accept-invite-password-wrapper, .login-password-wrapper, .register-password-wrapper, .reset-password-password-wrapper) :is(.accept-invite-field-input, .forgot-password-field-input, .login-field-input, .register-field-input, .resend-email-confirmation-field-input, .reset-password-field-input) {
  padding-right: 2.75rem;
}

:is(.accept-invite-eye-btn, .login-eye-btn, .register-eye-btn, .reset-password-eye-btn) {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  line-height: 1;
}

:is(.accept-invite-eye-btn, .login-eye-btn, .register-eye-btn, .reset-password-eye-btn):hover {
  color: #374151;
}

/* Checklist requisiti password */
:is(.accept-invite-pw-rules, .register-pw-rules, .reset-password-pw-rules) {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

:is(.accept-invite-pw-rule, .register-pw-rule, .reset-password-pw-rule) {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

:is(.accept-invite-pw-icon, .register-pw-icon, .reset-password-pw-icon) {
  font-size: 0.75rem;
  font-weight: 700;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.pw-err {
  color: #ef4444;
}
.pw-ok {
  color: #22c55e;
}

/* Bottone submit */
:is(.accept-invite-btn-submit, .forgot-password-btn-submit, .forgot-password-confirmation-btn-submit, .login-btn-submit, .register-btn-submit, .register-confirmation-btn-submit, .resend-email-confirmation-btn-submit, .reset-password-btn-submit) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.875rem 1.5rem;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.18s ease,
    transform 0.1s ease,
    box-shadow 0.18s ease;
  letter-spacing: 0.01em;
  font-family: inherit;
}

:is(.accept-invite-btn-submit, .forgot-password-btn-submit, .forgot-password-confirmation-btn-submit, .login-btn-submit, .register-btn-submit, .register-confirmation-btn-submit, .resend-email-confirmation-btn-submit, .reset-password-btn-submit):hover {
  background: #1e3a5f;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
}

:is(.accept-invite-btn-submit, .forgot-password-btn-submit, .forgot-password-confirmation-btn-submit, .login-btn-submit, .register-btn-submit, .register-confirmation-btn-submit, .resend-email-confirmation-btn-submit, .reset-password-btn-submit):active {
  transform: scale(0.985);
}

:is(.accept-invite-btn-submit, .forgot-password-btn-submit, .forgot-password-confirmation-btn-submit, .login-btn-submit, .register-btn-submit, .register-confirmation-btn-submit, .resend-email-confirmation-btn-submit, .reset-password-btn-submit):disabled {
  opacity: 0.78;
  cursor: wait;
  box-shadow: none;
}

:is(.accept-invite-btn-submit-loading, .register-btn-submit-loading) {
  align-items: center;
  gap: 0.5rem;
}

/* Footer form */
:is(.forgot-password-form-footer, .login-form-footer, .register-form-footer, .resend-email-confirmation-form-footer, .reset-password-form-footer) {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

:is(.forgot-password-form-footer, .login-form-footer, .register-form-footer, .resend-email-confirmation-form-footer, .reset-password-form-footer) a {
  font-size: 0.875rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}

:is(.forgot-password-form-footer, .login-form-footer, .register-form-footer, .resend-email-confirmation-form-footer, .reset-password-form-footer) a:hover {
  color: #0f172a;
}

:is(.forgot-password-form-footer, .login-form-footer, .register-form-footer, .resend-email-confirmation-form-footer, .reset-password-form-footer) strong {
  color: #3b82f6;
  font-weight: 600;
}

/* =========================================================
   ConfirmEmail — esito conferma
   ========================================================= */

:is(.invalid-password-reset-form-card-centered, .reset-password-confirmation-form-card-centered) {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Icona esito */
:is(.confirm-email-result-icon, .invalid-password-reset-result-icon, .reset-password-confirmation-result-icon) {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
}

:is(.confirm-email-result-icon, .invalid-password-reset-result-icon, .reset-password-confirmation-result-icon) svg {
  width: 34px;
  height: 34px;
}

:is(.confirm-email-result-ok, .reset-password-confirmation-result-ok) {
  background: #dcfce7;
  color: #16a34a;
}

:is(.confirm-email-result-err, .invalid-password-reset-result-err) {
  background: #fee2e2;
  color: #dc2626;
}

/* Testi */
:is(.confirm-email-result-title, .invalid-password-reset-result-title, .reset-password-confirmation-result-title) {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.3px;
}

:is(.confirm-email-result-body, .invalid-password-reset-result-body, .reset-password-confirmation-result-body) {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 2rem 0;
}

/* Bottone conferma */
:is(.confirm-email-btn-confirm, .invalid-password-reset-btn-confirm, .reset-password-confirmation-btn-confirm) {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: #0f172a;
  color: white;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
  letter-spacing: 0.01em;
}

:is(.confirm-email-btn-confirm, .invalid-password-reset-btn-confirm, .reset-password-confirmation-btn-confirm):hover {
  background: #1e3a5f;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
  color: white;
}

.btn-confirm-secondary {
  background: #64748b;
}

.btn-confirm-secondary:hover {
  background: #475569;
}

/* =========================================================
   Responsive auth — mobile: solo form
   ========================================================= */

@media (max-width: 820px) {
  .left-container {
    display: none;
  }

  :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) {
    background: white;
    padding: 2rem 1.5rem;
  }}

/* =========================================================
   Home — riepilogo venduto
   ========================================================= */

.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 1rem;
  margin-bottom: 1.5rem;
}

.home-prices-panel {
  width: fit-content;
  flex-basis: 30rem;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #dbe4ec;
  border-radius: 14px;
  overflow: hidden;
}

.home-prices-table {
  width: 100%;
  min-width: 0;
}

.home-prices-panel .home-chart-panel__header {
  padding: 1.25rem 1.5rem 0.9rem;
}

.home-prices-table thead th {
  background: #f6f9f8;
  color: #52645f;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-prices-table tbody td {
  color: #334e5c;
  font-size: 0.85rem;
}

.home-prices-table thead th,
.home-prices-table tbody td {
  text-align: center !important;
  vertical-align: middle;
}

.home-prices-table:is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(odd) > td:not(.giacenze-product-color) {
  background: #ffffff !important;
}

.home-prices-table:is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(even) > td:not(.giacenze-product-color) {
  background: #f1f3f5 !important;
}

.home-prices-empty {
  min-height: 8rem;
  padding: 1.5rem;
}

.home-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.3px;
}

.home-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0;
}

.home-period-picker {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}

.home-period-picker__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.home-period-picker__label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.home-period-picker__input.rz-datepicker {
  width: 142px;
}

.home-period-picker__input.rz-datepicker .rz-inputtext {
  border-color: #cbd8e0;
  color: #0f2d3d;
  font-size: 0.8rem;
  font-weight: 600;
}

.home-dashboard-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.home-dashboard-item {
  flex: 0 1 34rem;
  max-width: 100%;
  min-width: 0;
}

.home-dashboard-item--pie {
  flex-basis: 34rem;
}

.home-dashboard-item--wide {
  flex-basis: 48rem;
}

.home-pie-panel,
.home-chart-panel {
  background: #ffffff;
  border: 1px solid #dbe4ec;
  border-radius: 14px;
  overflow: visible;
}

.home-pie-panel {
  padding: 1.25rem 1.25rem 0.75rem;
}

.home-pie-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.home-pie-panel__header h2 {
  margin: 0;
  color: #0f2d3d;
  font-size: 1.05rem;
  font-weight: 700;
}

.home-pie-panel__header p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.82rem;
}

.home-pie-panel__total {
  color: #0f2d3d;
  font-size: 1.1rem;
  line-height: 1.2;
  white-space: nowrap;
}

.home-pie-panel__total small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 500;
}

.home-pie-chart {
  min-height: 340px;
}

.home-chart-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
  padding: 0.35rem 0.55rem;
  color: #0f6b78;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.home-chart-filter-toggle:hover,
.home-chart-filter-toggle:focus-visible {
  background: #eef8f8;
  border-color: #b9dfe0;
  outline: none;
}

.home-chart-filter-toggle .fa-chevron-down,
.home-chart-filter-toggle .fa-chevron-up {
  font-size: 0.65rem;
}

.home-chart-filter-toggle--line {
  display: inline-flex;
  width: fit-content;
  margin-right: 0;
  margin-left: 1.25rem;
}

.home-chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 0.8rem;
  background: #f6f9f8;
  border: 1px solid #dbe8e5;
  border-radius: 9px;
}

.home-chart-filters--line {
  margin: 0 1.5rem 0.25rem;
}

.home-chart-filter-field {
  display: grid;
  gap: 0.3rem;
  min-width: 9.5rem;
}

.home-chart-filter-field label {
  color: #52645f;
  font-size: 0.72rem;
  font-weight: 700;
}

.home-chart-filter-field .rz-datepicker {
  width: 100%;
}

.home-chart-empty {
  display: grid;
  min-height: 340px;
  place-items: center;
  padding: 1.5rem;
  color: #718391;
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 767.98px) {
  .home-pie-panel__header {
    gap: 0.5rem;
  }

  .home-chart-filter-toggle--line {
    margin-left: 1.25rem;
  }}

.fattura-invio-loader {
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 190px;
  padding: 2rem;
  text-align: center;
}

.fattura-invio-loader p {
  margin: 0;
  font-weight: 600;
}

.fattura-invio-loader-icon {
  color: #3b82f6;
  font-size: 2rem;
}

.home-chart-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem 0.9rem;
  position: relative;
  z-index: 3;
}

.home-chart-panel__header h2 {
  margin: 0;
  color: #0f2d3d;
  font-size: 1.05rem;
  font-weight: 700;
}

.home-chart-panel__header p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.82rem;
}

.home-chart-total {
  text-align: right;
  white-space: nowrap;
}

.home-chart-total--interactive {
  position: relative;
  cursor: help;
  outline: none;
}

.home-chart-total--interactive:focus-visible {
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(15, 107, 120, 0.2);
}

.home-chart-total-tooltip {
  top: calc(100% + 0.75rem) !important;
  bottom: auto;
  right: 0;
  transform: none !important;
  z-index: 4;
  text-align: left;
}

.home-chart-total > span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.home-chart-total > strong {
  display: block;
  color: #0f2d3d;
  font-size: 1.2rem;
  line-height: 1.1;
}

.home-chart-total > strong small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 500;
}

.home-chart {
  position: relative;
  min-height: 280px;
  padding: 0 1rem 0.25rem;
}

.home-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.home-chart__grid {
  stroke: #e8eef3;
  stroke-width: 1;
}

.home-chart__axis {
  stroke: #b7c6d1;
  stroke-width: 1.2;
}

.home-chart__y-label,
.home-chart__x-label {
  fill: #718391;
  font-family: Roboto, sans-serif;
  font-size: 12px;
}

.home-chart__area {
  fill: #0f6b78;
  opacity: 0.09;
}

.home-chart__line {
  fill: none;
  stroke: #0f6b78;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.home-chart__point {
  fill: #0f6b78;
  stroke: #ffffff;
  stroke-width: 2;
  cursor: pointer;
  outline: none;
  transition:
    r 0.15s ease,
    fill 0.15s ease;
}

.home-chart__point:hover,
.home-chart__point:focus,
.home-chart__point.is-active {
  fill: #f59e0b;
  stroke: #0f2d3d;
  outline: none;
}

.home-chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 190px;
  max-width: 240px;
  padding: 0.8rem 0.9rem;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  background: #0f2d3d;
  box-shadow: 0 10px 24px rgba(15, 45, 61, 0.18);
  color: #ffffff;
  pointer-events: none;
  transform: translateY(-100%);
}

.home-chart-tooltip__date {
  margin: 0;
  color: #c5d8df;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.home-chart-tooltip__total {
  margin: 0.2rem 0 0.65rem;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
}

.home-chart-tooltip__total span {
  color: #c5d8df;
  font-size: 0.72rem;
  font-weight: 500;
}

.home-chart-tooltip__products {
  display: grid;
  gap: 0.38rem;
  border-top: 1px solid rgba(197, 216, 223, 0.25);
  padding-top: 0.55rem;
}

.home-chart-tooltip__product {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.77rem;
}

.home-chart-tooltip__product strong {
  font-variant-numeric: tabular-nums;
  font-size: 0.77rem;
}

.home-chart-tooltip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.home-chart-legend {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #edf2f5;
  padding: 0.7rem 1.5rem 0.85rem;
  color: #718391;
  font-size: 0.72rem;
}

.home-chart-legend i {
  color: #0f6b78;
  margin-right: 0.25rem;
}

.home-chart-state {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  border: 1px solid #dbe4ec;
  border-radius: 14px;
  background: #ffffff;
  padding: 1.25rem 1.5rem;
  color: #0f2d3d;
}

.home-chart-state > i {
  color: #0f6b78;
  font-size: 1.1rem;
  margin-top: 0.15rem;
}

.home-chart-state strong {
  display: block;
  font-size: 0.95rem;
}

.home-chart-state p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.85rem;
}

.home-chart-state--error {
  border-color: #f2c7c7;
  background: #fff8f8;
}

.home-chart-state--error > i {
  color: #b91c1c;
}

/* =========================================================
   Superadmin Dashboard — tab, tabelle, paginazione, modali
   ========================================================= */

/* ── Tab Navigation ───────────────────────────────────────── */
:is(.gestione-tabs, .impostazioni-tab-nav, .nuovo-conteggio-tab-nav, .superadmin-dashboard-tab-nav) {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

:is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition:
    color 0.15s,
    background 0.15s;
}

:is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
:is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) i {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.tab-btn--add {
  flex: 1;
  justify-content: flex-end;
  color: #3b82f6;
  font-weight: 600;
  gap: 0.4rem;
}

.tab-btn--add:hover {
  color: #2563eb;
  background: #eff6ff;
  border-bottom-color: #2563eb;
}

:is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn):hover {
  color: #0f172a;
  background: #f8fafc;
  border-bottom-color: #0f172a;
}

:is(.gestione-tab-btn--active, .impostazioni-tab-btn--active, .nuovo-conteggio-tab-btn--active, .superadmin-dashboard-tab-btn--active) {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  line-height: 1.4;
}

:is(.gestione-tab-btn--active, .impostazioni-tab-btn--active, .nuovo-conteggio-tab-btn--active, .superadmin-dashboard-tab-btn--active) .tab-badge {
  background: #dbeafe;
  color: #2563eb;
}
:is(.gestione-tab-nav, .impostazioni-gestione-tab-nav) {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}
:is(.gestione-tab-nav, .impostazioni-gestione-tab-nav) :is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-bottom: 0;
}

/* ── Table Panel ──────────────────────────────────────────── */
:is(.accrediti-clienti-table-panel, .carichi-table-panel, .carte-gestione-table-panel, .clienti-credito-gestione-table-panel, .conti-table-panel, .fortech-gestione-table-panel, .gestione-bandiere-loghi-table-panel, .giacenze-table-panel, .metodi-accredito-catalogo-table-panel, .metodi-accredito-gestione-table-panel, .nuovo-conteggio-table-panel, .operatori-table-panel, .pompe-ed-erogatori-table-panel, .preset-pompe-table-panel, .prodotti-merci-gestione-table-panel, .report-table-panel, .rubrica-email-settings-table-panel, .serbatoi-gestione-table-panel, .sum-up-gestione-table-panel, .superadmin-dashboard-table-panel, .turni-table-panel) {
  background: white;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

:is(.gestione-bandiere-loghi-table-toolbar, .rubrica-email-settings-table-toolbar, .superadmin-dashboard-table-toolbar) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 0.75rem;
}

:is(.rubrica-email-settings-table-info, .superadmin-dashboard-table-info) {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.settings-rubrica-search {
  flex: 1 1 16rem;
  min-width: 0;
}

.settings-rubrica-search :is(.assegna-impianto-modal-ac-input, .gestione-bandiere-loghi-ac-input, .rubrica-email-settings-ac-input, .superadmin-dashboard-ac-input) {
  max-width: 320px;
}

:is(.gestione-bandiere-loghi-table-controls, .rubrica-email-settings-table-controls, .superadmin-dashboard-table-controls) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

:is(.gestione-bandiere-loghi-page-size-label, .rubrica-email-settings-page-size-label, .superadmin-dashboard-page-size-label) {
  font-size: 0.85rem;
  color: #64748b;
}

:is(.gestione-bandiere-loghi-page-size-select, .rubrica-email-settings-page-size-select, .superadmin-dashboard-page-size-select) {
  padding: 0.3rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #0f172a;
  background: #f8fafc;
  cursor: pointer;
  outline: none;
}

:is(.gestione-bandiere-loghi-page-size-select, .rubrica-email-settings-page-size-select, .superadmin-dashboard-page-size-select):focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ── Data Table ───────────────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
}

:is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

:is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) thead {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

:is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.775rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

:is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) th:is(.metodi-accredito-catalogo-th-actions, .rubrica-email-settings-th-actions, .superadmin-dashboard-th-actions) {
  text-align: right;
  padding-right: 1.25rem;
}

:is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) td {
  padding: 0.85rem 1rem;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

:is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) tbody tr:last-child td {
  border-bottom: none;
}

:is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) tbody tr:hover td {
  background: #f8fafc;
}

:is(.report-share-button-td-secondary, .rubrica-email-settings-td-secondary, .superadmin-dashboard-td-secondary) {
  color: #64748b;
}
:is(.gestione-bandiere-loghi-td-strong, .rubrica-email-settings-td-strong, .superadmin-dashboard-td-strong) {
  font-weight: 600;
}
:is(.gestione-bandiere-loghi-td-empty, .report-share-button-td-empty, .superadmin-dashboard-td-empty) {
  text-align: center;
  color: #94a3b8;
  padding: 3rem 1rem;
  font-size: 0.9rem;
}
.td-na {
  color: #cbd5e1;
  font-size: 0.9rem;
}

/* User cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

/* Code chip */
.code-chip {
  display: inline-block;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  background: #f1f5f9;
  color: #475569;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Role badges */
.role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.role-superadmin {
  background: #fef3c7;
  color: #92400e;
}
.role-admin {
  background: #dbeafe;
  color: #1d4ed8;
}
.role-contabile {
  background: #ede9fe;
  color: #5b21b6;
}
.role-operatore {
  background: #dcfce7;
  color: #166534;
}
.role-readonly {
  background: #f1f5f9;
  color: #475569;
}
.role-none {
  background: #f1f5f9;
  color: #94a3b8;
}

/* Table action buttons */
.fa-table-action {
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.fa-table-action:focus-visible {
  outline: 3px solid #0f172a;
  outline-offset: 2px;
}

.sumup-file-input:focus-visible + .sumup-file-label {
  outline: 3px solid #0f172a;
  outline-offset: 2px;
}

.fa-table-action i {
  font-size: 0.8rem;
  flex-shrink: 0;
}
.fa-table-action svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.fa-table-action--primary {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.fa-table-action--primary:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.fa-table-action--primary:disabled,
.fa-table-action--primary:disabled:hover {
  background: #e2e8f0;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 1;
}

.fa-table-action--secondary {
  background: rgb(59, 130, 246);
  color: white;
  border-color: #e2e8f0;
}

.fa-table-action--secondary:hover {
  background: #cbd5e1;
  border-color: #cbd5e1;
  color: rgb(59, 130, 246);
}

.fa-table-action--secondary:disabled,
.fa-table-action--secondary:disabled:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
}

.fa-table-action--danger {
  background: #dc2626;
  color: white;
  border-color: #fecaca;
}

.fa-table-action--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

:is(.metodi-accredito-catalogo-tbl-actions-group, .rubrica-email-settings-tbl-actions-group, .superadmin-dashboard-tbl-actions-group) {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

:is(.metodi-accredito-catalogo-tbl-actions-group, .rubrica-email-settings-tbl-actions-group, .superadmin-dashboard-tbl-actions-group) form {
  display: inline-flex;
}

.utente-actions {
  position: relative;
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

.utente-actions:has(.utente-actions__menu) {
  z-index: 1051;
}

.utente-actions__trigger {
  position: relative;
  z-index: 2;
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #475569;
  background: #fff;
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.utente-actions__impersonate {
  border-color: #c4b5fd;
  color: #6d28d9;
  background: #f5f3ff;
}

.utente-actions__trigger:hover,
.utente-actions__trigger[aria-expanded="true"] {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.utente-actions__impersonate:hover {
  border-color: #8b5cf6;
  color: #fff;
  background: #6d28d9;
}

.utente-actions__trigger:focus-visible,
.utente-actions__item:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.utente-actions__trigger i {
  font-size: 1rem;
}

.utente-actions__menu {
  position: absolute;
  z-index: 1;
  top: calc(100% + 0.35rem);
  right: 0;
  width: 17rem;
  padding: 0.35rem;
  border: 1px solid #dbe2ea;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  text-align: left;
}

.utente-actions__dismiss {
  position: fixed;
  z-index: 0;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

:is(.accrediti-clienti-table-panel, .carichi-table-panel, .carte-gestione-table-panel, .clienti-credito-gestione-table-panel, .conti-table-panel, .fortech-gestione-table-panel, .gestione-bandiere-loghi-table-panel, .giacenze-table-panel, .metodi-accredito-catalogo-table-panel, .metodi-accredito-gestione-table-panel, .nuovo-conteggio-table-panel, .operatori-table-panel, .pompe-ed-erogatori-table-panel, .preset-pompe-table-panel, .prodotti-merci-gestione-table-panel, .report-table-panel, .rubrica-email-settings-table-panel, .serbatoi-gestione-table-panel, .sum-up-gestione-table-panel, .superadmin-dashboard-table-panel, .turni-table-panel):has(.utente-actions__menu),
:is(.accrediti-clienti-table-panel, .carichi-table-panel, .carte-gestione-table-panel, .clienti-credito-gestione-table-panel, .conti-table-panel, .fortech-gestione-table-panel, .gestione-bandiere-loghi-table-panel, .giacenze-table-panel, .metodi-accredito-catalogo-table-panel, .metodi-accredito-gestione-table-panel, .nuovo-conteggio-table-panel, .operatori-table-panel, .pompe-ed-erogatori-table-panel, .preset-pompe-table-panel, .prodotti-merci-gestione-table-panel, .report-table-panel, .rubrica-email-settings-table-panel, .serbatoi-gestione-table-panel, .sum-up-gestione-table-panel, .superadmin-dashboard-table-panel, .turni-table-panel):has(.utente-actions__menu) .table-responsive {
  overflow: visible;
}

.utente-actions__menu form {
  display: block;
}

.utente-actions__item {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 6px;
  color: #1e293b;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.utente-actions__item:hover {
  background: #f1f5f9;
}

.utente-actions__item > i {
  width: 1.1rem;
  color: #475569;
  text-align: center;
  flex: 0 0 auto;
}

.utente-actions__item > span {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.utente-actions__item strong {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
}

.utente-actions__item small {
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.3;
}

.utente-actions__divider {
  height: 1px;
  margin: 0.3rem 0.55rem;
  background: #e2e8f0;
}

.utente-actions__item--danger,
.utente-actions__item--danger > i {
  color: #b91c1c;
}

.utente-actions__item--danger:hover {
  background: #fef2f2;
}

@media (max-width: 767.98px) {
  .utente-actions__menu {
    right: 0;
    width: min(17rem, calc(100vw - 2rem));
  }}

/* ── Skeleton loading ─────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 5px;
}

@keyframes skel-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skel-user {
  height: 34px;
  width: 160px;
  border-radius: 999px;
}
.skel-md {
  height: 14px;
  width: 130px;
}
.skel-sm {
  height: 14px;
  width: 80px;
}
.skel-badge {
  height: 20px;
  width: 80px;
  border-radius: 999px;
}
.skel-btn {
  height: 28px;
  width: 110px;
  border-radius: 7px;
  float: right;
}

/* ── Pagination ───────────────────────────────────────────── */
:is(.gestione-bandiere-loghi-pagination-bar, .rubrica-email-settings-pagination-bar, .superadmin-dashboard-pagination-bar) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 0.75rem;
}

:is(.gestione-bandiere-loghi-pagination-info, .rubrica-email-settings-pagination-info, .superadmin-dashboard-pagination-info) {
  font-size: 0.85rem;
  color: #64748b;
}

:is(.gestione-bandiere-loghi-pagination-controls, .rubrica-email-settings-pagination-controls, .superadmin-dashboard-pagination-controls) {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

:is(.gestione-bandiere-loghi-page-btn, .rubrica-email-settings-page-btn, .superadmin-dashboard-page-btn) {
  min-width: 34px;
  height: 34px;
  padding: 0 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: white;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

:is(.gestione-bandiere-loghi-page-btn, .rubrica-email-settings-page-btn, .superadmin-dashboard-page-btn):hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

:is(.gestione-bandiere-loghi-page-btn--active, .rubrica-email-settings-page-btn--active, .superadmin-dashboard-page-btn--active) {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  font-weight: 600;
}

:is(.gestione-bandiere-loghi-page-btn--active, .rubrica-email-settings-page-btn--active, .superadmin-dashboard-page-btn--active):hover {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: white !important;
}

:is(.gestione-bandiere-loghi-page-btn, .rubrica-email-settings-page-btn, .superadmin-dashboard-page-btn):disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

:is(.gestione-bandiere-loghi-page-ellipsis, .superadmin-dashboard-page-ellipsis) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  color: #94a3b8;
  font-size: 0.875rem;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pdf-preview-close {
  color: #dc2626;
}

.pdf-preview-close:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* Search bar inside modal (Assegna) */
.modal-search-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.modal-search-bar svg {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  flex-shrink: 0;
}

.modal-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: #0f172a;
  background: transparent;
}

.modal-search-input::placeholder {
  color: #94a3b8;
}

.modal-search-clear {
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.modal-search-clear:hover {
  color: #64748b;
}

.modal-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 2rem 0;
}

.modal-counter {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

/* ── Modal conferma eliminazione ──────────────────────────── */
.app-action-confirm-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.app-action-confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff1f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.5rem;
}

.app-action-confirm-icon--success {
  background: #f0fdf4;
  color: #16a34a;
}

.app-action-confirm-message {
  margin: 0;
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.6;
}

.app-action-confirm-warning {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.5;
}

:is(.conferma-abandono-modal-delete-confirm-body, .conferma-report-periodo-modal-delete-confirm-body, .elimina-conteggio-modal-delete-confirm-body, .elimina-impianto-modal-delete-confirm-body, .elimina-utente-modal-delete-confirm-body, .esito-conteggio-modal-delete-confirm-body, .info-modal-delete-confirm-body, .nav-menu-delete-confirm-body) {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

:is(.conferma-abandono-modal-delete-icon, .conferma-report-periodo-modal-delete-icon, .elimina-conteggio-modal-delete-icon, .elimina-impianto-modal-delete-icon, .elimina-utente-modal-delete-icon, .esito-conteggio-modal-delete-icon, .info-modal-delete-icon, .nav-menu-delete-icon) {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff1f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

:is(.conferma-abandono-modal-delete-icon, .conferma-report-periodo-modal-delete-icon, .elimina-conteggio-modal-delete-icon, .elimina-impianto-modal-delete-icon, .elimina-utente-modal-delete-icon, .esito-conteggio-modal-delete-icon, .info-modal-delete-icon, .nav-menu-delete-icon) svg {
  width: 26px;
  height: 26px;
}
:is(.conferma-abandono-modal-delete-icon, .conferma-report-periodo-modal-delete-icon, .elimina-conteggio-modal-delete-icon, .elimina-impianto-modal-delete-icon, .elimina-utente-modal-delete-icon, .esito-conteggio-modal-delete-icon, .info-modal-delete-icon, .nav-menu-delete-icon) i {
  font-size: 1.5rem;
}

:is(.esito-conteggio-modal-esito-icon--success, .info-modal-esito-icon--success) {
  background: #f0fdf4;
  color: #16a34a;
}

:is(.conferma-abandono-modal-delete-confirm-text, .conferma-report-periodo-modal-delete-confirm-text, .elimina-conteggio-modal-delete-confirm-text, .elimina-impianto-modal-delete-confirm-text, .elimina-utente-modal-delete-confirm-text, .esito-conteggio-modal-delete-confirm-text, .info-modal-delete-confirm-text, .nav-menu-delete-confirm-text, .serbatoi-gestione-delete-confirm-text, .sum-up-import-retry-delete-confirm-text) {
  font-size: 0.9rem;
  color: #0f172a;
  margin: 0;
  line-height: 1.6;
}

:is(.conferma-abandono-modal-delete-confirm-warn, .elimina-conteggio-modal-delete-confirm-warn, .elimina-impianto-modal-delete-confirm-warn, .elimina-utente-modal-delete-confirm-warn, .esito-conteggio-modal-delete-confirm-warn, .nav-menu-delete-confirm-warn) {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* ── Lista impianti assegnati (modal Assegna) ─────────────── */
.assigned-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.assigned-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  min-width: 20px;
}

.assigned-empty {
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 1rem 0 1.25rem;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
  margin-bottom: 0.25rem;
}

.assigned-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 0.25rem;
}

.assigned-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  transition: border-color 0.12s;
}

.assigned-item:hover {
  border-color: #cbd5e1;
}

.assigned-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1;
  min-width: 0;
}

.assigned-nome {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assigned-detail {
  font-size: 0.775rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.assigned-remove {
  width: 26px;
  height: 26px;
  border: none;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
  transition:
    background 0.12s,
    color 0.12s;
}

.assigned-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}
.assigned-remove svg {
  width: 12px;
  height: 12px;
}

/* Divider col testo */
.assigned-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.9rem;
  color: #94a3b8;
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.assigned-divider::before,
.assigned-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* Hint sotto l'autocomplete */
.autocomplete-hint {
  font-size: 0.775rem;
  color: #94a3b8;
  margin: 0.45rem 0 0;
}

/* ── Custom autocomplete (Assegna Impianti) ───────────────── */
.ac-section {
  padding: 0 1.5rem;
  flex-shrink: 0;
}

:is(.assegna-impianto-modal-ac-input, .gestione-bandiere-loghi-ac-input, .rubrica-email-settings-ac-input, .superadmin-dashboard-ac-input) {
  width: 100%;
  box-sizing: border-box;
}

.ac-results {
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 220px;
  overflow-y: auto;
  background: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 0.5rem;
}

.ac-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  font-size: 0.875rem;
  transition: background 0.1s;
}

.ac-item:hover {
  background: #f1f5f9;
}
.ac-item:last-child {
  border-bottom: none;
}

.ac-item-id {
  color: #3b82f6;
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.ac-item-name {
  color: #0f172a;
  font-weight: 500;
  flex-shrink: 0;
}

.ac-item-addr {
  color: #64748b;
  font-size: 0.82rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Code chip extra-small */
.code-chip--xs {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
}

/* ── Impianto checklist (modal Assegna) ───────────────────── */
.impianto-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.impianto-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.12s;
  background: white;
}

.impianto-item:hover {
  border-color: #bfdbfe;
  background: #f8fafc;
}

.impianto-item--on {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.impianto-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}

.impianto-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.impianto-item-nome {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.impianto-item-detail {
  font-size: 0.78rem;
  color: #64748b;
}

.impianto-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  background: #dcfce7;
  color: #15803d;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Edit form grid (modal Modifica) ──────────────────────── */
:is(.aggiungi-impianto-modal-edit-grid, .clienti-credito-tab-edit-grid, .modifica-impianto-modal-edit-grid, .modifica-utente-modal-edit-grid) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

:is(.aggiungi-impianto-modal-edit-field, .clienti-credito-gestione-edit-field, .clienti-credito-tab-edit-field, .conteggio-merci-periodo-edit-field, .conti-edit-field, .giacenze-edit-field, .modifica-impianto-modal-edit-field, .modifica-utente-modal-edit-field, .nuovo-conteggio-edit-field, .operatori-edit-field, .preset-pompe-edit-field, .report-edit-field, .turni-edit-field) {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

:is(.aggiungi-impianto-modal-edit-field--full, .modifica-impianto-modal-edit-field--full, .modifica-utente-modal-edit-field--full) {
  grid-column: 1 / -1;
}

:is(.accrediti-clienti-edit-label, .aggiungi-impianto-modal-edit-label, .assegna-impianto-modal-edit-label, .clienti-credito-gestione-edit-label, .clienti-credito-tab-edit-label, .conti-edit-label, .erogatori-tab-edit-label, .giacenze-edit-label, .modifica-impianto-modal-edit-label, .modifica-utente-modal-edit-label, .nuovo-conteggio-edit-label, .operatori-edit-label, .preset-pompe-edit-label, .report-edit-label, .rubrica-email-settings-edit-label, .turni-edit-label) {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

:is(.aggiungi-impianto-modal-req, .clienti-credito-gestione-req, .modifica-impianto-modal-req, .modifica-utente-modal-req, .operatori-req, .preset-pompe-req, .turni-req) {
  color: #ef4444;
}

:is(.accrediti-clienti-edit-input, .aggiungi-impianto-modal-edit-input, .assegna-impianto-modal-edit-input, .clienti-credito-gestione-edit-input, .clienti-credito-tab-edit-input, .erogatori-tab-edit-input, .gestione-bandiere-loghi-edit-input, .metodi-accredito-catalogo-edit-input, .modifica-impianto-modal-edit-input, .modifica-utente-modal-edit-input, .operatori-edit-input, .pompe-ed-erogatori-edit-input, .preset-pompe-edit-input, .rubrica-email-settings-edit-input, .superadmin-dashboard-edit-input, .turni-edit-input) {
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

:is(.accrediti-clienti-edit-input, .aggiungi-impianto-modal-edit-input, .assegna-impianto-modal-edit-input, .clienti-credito-gestione-edit-input, .clienti-credito-tab-edit-input, .erogatori-tab-edit-input, .gestione-bandiere-loghi-edit-input, .metodi-accredito-catalogo-edit-input, .modifica-impianto-modal-edit-input, .modifica-utente-modal-edit-input, .operatori-edit-input, .pompe-ed-erogatori-edit-input, .preset-pompe-edit-input, .rubrica-email-settings-edit-input, .superadmin-dashboard-edit-input, .turni-edit-input):focus {
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1.5rem;
  width: 100%;
  max-width: 1480px;
}

.settings-layout--admin {
  gap: 1.5rem;
}

.settings-layout--profile-only {
  grid-template-columns: minmax(300px, 540px);
  justify-content: end;
}

.settings-users-pane {
  min-width: 0;
}

.settings-sumup-pane {
  min-width: 0;
}

.settings-sumup-pane .sumup-merchant-panel {
  margin-bottom: 0;
  padding: 1.25rem;
  box-shadow: none;
}

.settings-sumup-pane :is(.accrediti-clienti-gestione-section-title, .carte-gestione-gestione-section-title, .clienti-credito-gestione-gestione-section-title, .fortech-gestione-gestione-section-title, .metodi-accredito-catalogo-gestione-section-title, .metodi-accredito-gestione-gestione-section-title, .operatori-gestione-section-title, .pompe-ed-erogatori-gestione-section-title, .preset-pompe-gestione-section-title, .prodotti-merci-gestione-gestione-section-title, .serbatoi-gestione-gestione-section-title, .sum-up-gestione-gestione-section-title, .turni-gestione-section-title) {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.settings-sumup-pane :is(.accrediti-clienti-gestione-section-sub, .carte-gestione-gestione-section-sub, .clienti-credito-gestione-gestione-section-sub, .fortech-gestione-gestione-section-sub, .metodi-accredito-catalogo-gestione-section-sub, .metodi-accredito-gestione-gestione-section-sub, .operatori-gestione-section-sub, .pompe-ed-erogatori-gestione-section-sub, .preset-pompe-gestione-section-sub, .prodotti-merci-gestione-gestione-section-sub, .serbatoi-gestione-gestione-section-sub, .turni-gestione-section-sub) {
  font-size: 0.9rem;
}

.settings-company-card .settings-users-heading { margin-bottom: 1.25rem; }
.settings-company-section { padding-top: 1rem; }
.settings-company-section + .settings-company-section { margin-top: 1.25rem; border-top: 1px solid #e2e8f0; }
.settings-company-section .gestione-section-title { margin-bottom: 0.75rem; }
.settings-company-actions { display: flex; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; }

html[data-theme="dark"] .settings-company-section + .settings-company-section,
html[data-theme="dark"] .settings-company-actions { border-color: var(--fa-dark-border); }

.settings-profile-pane {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  position: sticky;
  top: 1.5rem;
}

.settings-users-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-users-heading h2 {
  margin: 0 0 0.25rem;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.settings-users-heading p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

:is(.rubrica-email-settings-settings-users-card, .utenti-settings-settings-users-card, .settings-company-card) {
  margin-bottom: 1rem;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

:is(.rubrica-email-settings-settings-users-card, .utenti-settings-settings-users-card, .settings-company-card) h3 {
  margin: 0 0 0.25rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

:is(.rubrica-email-settings-settings-users-card, .utenti-settings-settings-users-card, .settings-company-card) .btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (min-width: 1200px) {
  .settings-invite-submit {
    padding-top: 1.75rem;
  }}

.rz-dropdown.settings-access-dropdown {
  min-height: 2.4rem;
  background: #fff;
  border-color: #cbd5e1;
}

.rz-dropdown.settings-access-dropdown:not(.rz-state-disabled):hover,
.rz-dropdown.settings-access-dropdown:not(.rz-state-disabled):focus-within {
  border-color: #315fc5;
}

.settings-access-dropdown .rz-dropdown-label,
.settings-access-dropdown .rz-multiselect-label {
  color: #1e293b;
  font-size: 0.875rem;
}

.settings-access-dropdown--table {
  min-width: 10rem;
}

.settings-access-dropdown-panel {
  --fa-dropdown-font-size: 0.875rem;
}

.rz-dropdown.bandiera-logo-dropdown {
  min-height: 2.4rem;
  background: #fff;
  border-color: #cbd5e1;
}

.bandiera-logo-dropdown .rz-dropdown-label,
.bandiera-logo-dropdown .rz-multiselect-label {
  color: #1e293b;
  font-size: 0.875rem;
}

.bandiera-logo-dropdown-panel {
  --fa-dropdown-font-size: 0.875rem;
}

.bandiera-logo-anteprima {
  width: 120px;
  height: 48px;
  object-fit: contain;
}

html[data-theme="dark"] .rz-dropdown.bandiera-logo-dropdown {
  background: #14171b;
  border-color: #4b5563;
}

html[data-theme="dark"] .bandiera-logo-dropdown .rz-dropdown-label,
html[data-theme="dark"] .bandiera-logo-dropdown .rz-multiselect-label {
  color: #f1f3f5;
}

.settings-user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  white-space: nowrap;
}

.settings-card {
  background: white;
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.settings-card--compact .settings-card-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.settings-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.125rem 0;
}

.settings-card-email {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
}

.settings-alert {
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.settings-alert-ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

.settings-alert-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.settings-field {
  margin-bottom: 1.25rem;
}

.settings-field label {
  display: block;
  font-size: 0.8375rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.4rem;
}

.settings-input {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9375rem;
  color: #0f172a;
  background: white;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}

.settings-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.settings-hint {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.settings-error {
  display: block;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 0.3rem;
}

.settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.18s,
    box-shadow 0.18s;
  font-family: inherit;
}

.settings-btn:hover:not(:disabled) {
  background: #1e3a5f;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.settings-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 1279.98px) {
  .settings-layout,
  .settings-layout--profile-only {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .settings-profile-pane {
    position: static;
  }}

@media (max-width: 575.98px) {
  .settings-users-heading {
    align-items: stretch;
    flex-direction: column;
  }

  :is(.rubrica-email-settings-settings-users-card, .utenti-settings-settings-users-card, .settings-company-card),
  .settings-card {
    padding: 1rem;
  }}

/* =========================================================
   PageLoader — spinner di caricamento pagina
   ========================================================= */

.page-loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: clamp(240px, 42vh, 460px);
  padding: 3rem 1.25rem;
  animation: page-loader-enter 0.22s ease-out;
}

:is(.nuovo-conteggio-page-loader-surface, .page-loader-surface) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.96) 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* Spinner con gradiente conico + maschera circolare */
:is(.nuovo-conteggio-page-loader-icon, .page-loader-icon) {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, #bfdbfe 25%, #3b82f6 100%);
  animation: pl-spin 0.75s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent 63%, black 64%);
  mask: radial-gradient(farthest-side, transparent 63%, black 64%);
}

@keyframes pl-spin {
  to {
    transform: rotate(360deg);
  }
}

:is(.nuovo-conteggio-page-loader-text, .page-loader-text) {
  font-size: 0.875rem;
  color: #94a3b8;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.01em;
  animation: pl-pulse 1.6s ease-in-out infinite;
}

@keyframes pl-pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes page-loader-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-content > :not(.page-loader-wrap),
  .page-loader-wrap,
  :is(.nuovo-conteggio-page-loader-icon, .page-loader-icon),
  :is(.nuovo-conteggio-page-loader-text, .page-loader-text) {
    animation: none !important;
    transform: none !important;
  }}

/* Import report Fortech */
.fortech-import-button--disabled {
  cursor: default;
  opacity: 0.72;
  pointer-events: none;
}
.fortech-import-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.fortech-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(248, 250, 252, 0.82);
  cursor: wait;
}
.fortech-import-overlay :is(.nuovo-conteggio-page-loader-surface, .page-loader-surface) {
  min-width: 260px;
}
.fortech-import-overlay :is(.nuovo-conteggio-page-loader-text, .page-loader-text) {
  color: var(--bs-body-color);
}
.fortech-wizard-heading {
  margin: 0 0 0.4rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}
.fortech-wizard-help {
  margin: 0 0 1rem;
  color: #475569;
  font-size: 0.88rem;
}
.fortech-mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.fortech-mapping-name {
  color: #1e293b;
  font-weight: 600;
}
.fortech-terminal-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.fortech-pump-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-top: 0.55rem;
}
.fortech-pump-option {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.35rem;
  padding: 0.35rem 0.25rem;
  color: #334155;
  font-size: 0.875rem;
  cursor: pointer;
}
.fortech-pump-option input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #1d4ed8;
}
.fortech-pump-option--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.fortech-config-panel {
  --fortech-action: #1d4ed8;
  --fortech-action-hover: #1e40af;
  --fortech-border: #e2e8f0;
  --fortech-muted: #475569;
  border: 0;
  padding-bottom: 1rem;
}

/* ── Tab Importazione Fortech (Gestione) ─────────────────── */
.fortech-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 1.25rem;
  align-items: start;
}

.fortech-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 0;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.fortech-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}

.fortech-section-title i {
  color: var(--fortech-action);
  font-size: 0.85rem;
}

.fortech-section-desc {
  margin: -0.4rem 0 0;
  color: var(--fortech-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.fortech-section-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fortech-payment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: 1px solid var(--fortech-border);
  border-radius: 8px;
}

.fortech-payment-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.9rem;
}
.fortech-payment-card .form-select {
  width: 100%;
  min-height: 2.4rem;
}

.fortech-terminal-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 0.8rem 0.7rem;
  background: #fff;
  border: 1px solid var(--fortech-border);
  border-radius: 8px;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.fortech-terminal-card--ignored {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.fortech-terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fortech-terminal-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.9rem;
}

.fortech-terminal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.report-credit-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fortech-terminal-note {
  margin: 0;
  color: #64748b;
  font-size: 0.78rem;
}

/* Pill checkbox riutilizzabile: checkbox + etichetta in un unico controllo */
:is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill) {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.8rem 0.3rem 0.55rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease;
}

:is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill) input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--fortech-action);
  cursor: pointer;
}

:is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill) i {
  font-size: 0.68rem;
}

:is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill):hover {
  border-color: var(--fortech-action);
}

:is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill):has(input:checked) {
  background: #dbeafe;
  border-color: var(--fortech-action);
  color: #1e40af;
}

.fg-pill--ignore:has(input:checked) {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

:is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill):has(input:focus-visible) {
  outline: 3px solid #0f172a;
  outline-offset: 2px;
}
:is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill) input:focus-visible {
  outline: none;
}

.fg-pill--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.fg-pill--disabled input {
  cursor: not-allowed;
}
.fg-pill--disabled:hover {
  border-color: #cbd5e1;
}

.fortech-config-empty {
  padding: 0.5rem 1.25rem 1.25rem;
  color: var(--fortech-muted);
  font-size: 0.88rem;
}
.fortech-config-panel select:focus-visible,
.gestione-save-bar .fa-table-action:focus-visible {
  outline: 3px solid #0f172a;
  outline-offset: 2px;
  box-shadow: none;
}
.carte-gestione-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr));
  gap: 2rem;
  min-width: 0;
}
.clienti-credito-gestione-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
  min-width: 0;
}
.clienti-credito-gestione-layout > .clienti-credito-gestione-table-panel {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}
.clienti-credito-gestione-table-scroll {
  max-width: 75rem;
  margin: 1rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}
.clienti-credito-gestione-table-scroll:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.clienti-credito-gestione-table {
  width: 100%;
  min-width: 56rem;
  max-width: 75rem;
}
.clienti-credito-gestione-table th:last-child {
  width: 1%;
  white-space: nowrap;
}
.clienti-credito-gestione-td-azioni {
  gap: 0.25rem;
  padding-inline: 0.25rem;
}
.carte-gestione-grid > :is(.accrediti-clienti-table-panel, .carichi-table-panel, .carte-gestione-table-panel, .clienti-credito-gestione-table-panel, .conti-table-panel, .fortech-gestione-table-panel, .gestione-bandiere-loghi-table-panel, .giacenze-table-panel, .metodi-accredito-catalogo-table-panel, .metodi-accredito-gestione-table-panel, .nuovo-conteggio-table-panel, .operatori-table-panel, .pompe-ed-erogatori-table-panel, .preset-pompe-table-panel, .prodotti-merci-gestione-table-panel, .report-table-panel, .rubrica-email-settings-table-panel, .serbatoi-gestione-table-panel, .sum-up-gestione-table-panel, .superadmin-dashboard-table-panel, .turni-table-panel),
.carte-gestione :is(.carte-gestione-split-main, .clienti-credito-gestione-split-main, .metodi-accredito-catalogo-split-main, .operatori-split-main, .preset-pompe-split-main, .superadmin-dashboard-split-main, .turni-split-main),
.carte-gestione :is(.clienti-credito-gestione-split-side, .metodi-accredito-catalogo-split-side, .operatori-split-side, .preset-pompe-split-side, .superadmin-dashboard-split-side, .turni-split-side) {
  min-width: 0;
}
.buoni-gestione-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.25rem 1.25rem;
}
.buoni-list,
.buoni-list-items,
.buoni-list-loading {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.buoni-list-loading .skel {
  height: 2.75rem;
  border-radius: 8px;
}
.buoni-list-items {
  gap: 0.4rem;
}
.buoni-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.65rem 0.45rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.buoni-list-item > .form-control {
  min-width: 0;
  max-width: 32rem;
}
.buoni-list-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-weight: 600;
}
.buoni-list-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.35rem;
}
.buoni-add-card {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}
.buoni-add-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem 0;
}
.buoni-add-header > i {
  color: #2563eb;
  font-size: 1.15rem;
}
.buoni-add-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}
.buoni-add-subtitle {
  margin: 0.2rem 0 0;
  color: #475569;
  font-size: 0.8rem;
}
.buoni-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
}
.buoni-add-form .form-control {
  min-height: 2.75rem;
  background: #fff;
}
.buoni-add-button {
  min-width: 8.5rem;
  justify-content: center;
}
.buoni-feedback {
  margin: 0;
  padding: 0 1.25rem 1rem;
}
@media (max-width: 760px) {
  .fortech-config-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-inline: 1rem;
  }
  .fortech-payment-card {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .carte-gestione-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .clienti-credito-gestione-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .clienti-credito-gestione-layout > .clienti-credito-gestione-table-panel {
    flex: 0 1 auto;
    width: 100%;
  }
  .carte-gestione :is(.carte-gestione-split, .clienti-credito-gestione-split, .metodi-accredito-catalogo-split, .operatori-split, .preset-pompe-split, .superadmin-dashboard-split, .turni-split) {
    flex-direction: column;
  }
  .carte-gestione :is(.clienti-credito-gestione-split-side, .metodi-accredito-catalogo-split-side, .operatori-split-side, .preset-pompe-split-side, .superadmin-dashboard-split-side, .turni-split-side) {
    width: 100%;
  }
  .buoni-add-form {
    grid-template-columns: 1fr;
  }
  .buoni-add-button {
    width: 100%;
  }}
/* =========================================================
   Gestione impianti
   ========================================================= */

.gestione-loader {
  padding: 1.5rem;
}

/* Pannello selettore impianto */
:is(.conti-gestione-selector-panel, .nuovo-conteggio-gestione-selector-panel) {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* Bottone selezione pompa (Nuovo Conteggio step 1) */
.pompa-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.875rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
  line-height: 1.4;
}

.pompa-toggle:hover {
  border-color: #93c5fd;
  background: #f0f9ff;
  color: #1e40af;
}

.pompa-toggle--selected {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.pompa-toggle--selected:hover {
  background: #dbeafe;
  border-color: #2563eb;
}

.pompa-toggle-check {
  width: 15px;
  height: 15px;
  border: 1.5px solid #cbd5e1;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.6rem;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.pompa-toggle--selected .pompa-toggle-check {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

/* Header sezione */
:is(.carte-gestione-gestione-section-header, .clienti-credito-gestione-gestione-section-header, .fortech-gestione-gestione-section-header, .metodi-accredito-catalogo-gestione-section-header, .metodi-accredito-gestione-gestione-section-header, .operatori-gestione-section-header, .pompe-ed-erogatori-gestione-section-header, .preset-pompe-gestione-section-header, .prodotti-merci-gestione-gestione-section-header, .serbatoi-gestione-gestione-section-header, .turni-gestione-section-header) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

:is(.accrediti-clienti-gestione-section-title, .carte-gestione-gestione-section-title, .clienti-credito-gestione-gestione-section-title, .fortech-gestione-gestione-section-title, .metodi-accredito-catalogo-gestione-section-title, .metodi-accredito-gestione-gestione-section-title, .operatori-gestione-section-title, .pompe-ed-erogatori-gestione-section-title, .preset-pompe-gestione-section-title, .prodotti-merci-gestione-gestione-section-title, .serbatoi-gestione-gestione-section-title, .sum-up-gestione-gestione-section-title, .turni-gestione-section-title) {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.2rem;
}

:is(.accrediti-clienti-gestione-section-sub, .carte-gestione-gestione-section-sub, .clienti-credito-gestione-gestione-section-sub, .fortech-gestione-gestione-section-sub, .metodi-accredito-catalogo-gestione-section-sub, .metodi-accredito-gestione-gestione-section-sub, .operatori-gestione-section-sub, .pompe-ed-erogatori-gestione-section-sub, .preset-pompe-gestione-section-sub, .prodotti-merci-gestione-gestione-section-sub, .serbatoi-gestione-gestione-section-sub, .turni-gestione-section-sub) {
  font-size: 0.8rem;
  color: #475569;
  margin: 0;
}

.sumup-products :is(.carte-gestione-gestione-section-header, .clienti-credito-gestione-gestione-section-header, .fortech-gestione-gestione-section-header, .metodi-accredito-catalogo-gestione-section-header, .metodi-accredito-gestione-gestione-section-header, .operatori-gestione-section-header, .pompe-ed-erogatori-gestione-section-header, .preset-pompe-gestione-section-header, .prodotti-merci-gestione-gestione-section-header, .serbatoi-gestione-gestione-section-header, .turni-gestione-section-header) {
  gap: 1rem;
}

.sumup-products-upload {
  flex: 0 1 22rem;
  min-width: min(100%, 16rem);
}

.sumup-products-upload .form-label,
.sumup-products-filter .form-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.sumup-products-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 1.25rem;
}

.sumup-products-body .alert {
  margin-bottom: 0;
}

.sumup-products-filter {
  width: min(100%, 28rem);
}

.sumup-products-filter .form-label {
  margin-bottom: 0.35rem;
}

.sumup-products-toggle-all:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sumup-products .table {
  margin-bottom: 0;
}

.sumup-products-empty {
  max-width: 68ch;
}

html[data-theme="dark"] .sumup-products :is(.carte-gestione-gestione-section-header, .clienti-credito-gestione-gestione-section-header, .fortech-gestione-gestione-section-header, .metodi-accredito-catalogo-gestione-section-header, .metodi-accredito-gestione-gestione-section-header, .operatori-gestione-section-header, .pompe-ed-erogatori-gestione-section-header, .preset-pompe-gestione-section-header, .prodotti-merci-gestione-gestione-section-header, .serbatoi-gestione-gestione-section-header, .turni-gestione-section-header) {
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .sumup-products-toggle-all {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

html[data-theme="dark"] .sumup-products-toggle-all:hover:not(:disabled) {
  background: #1d4ed8;
}

html[data-theme="dark"] .sumup-products-toggle-all:focus-visible {
  outline-color: #f8fafc;
}

@media (max-width: 767.98px) {
  .sumup-products :is(.carte-gestione-gestione-section-header, .clienti-credito-gestione-gestione-section-header, .fortech-gestione-gestione-section-header, .metodi-accredito-catalogo-gestione-section-header, .metodi-accredito-gestione-gestione-section-header, .operatori-gestione-section-header, .pompe-ed-erogatori-gestione-section-header, .preset-pompe-gestione-section-header, .prodotti-merci-gestione-gestione-section-header, .serbatoi-gestione-gestione-section-header, .turni-gestione-section-header) {
    align-items: stretch;
    flex-direction: column;
    padding: 1rem;
  }

  .sumup-products-upload {
    flex-basis: auto;
    width: 100%;
  }

  .sumup-products-body {
    padding: 1rem;
  }}

/* Corpo con le pompe — grid responsiva */
.gestione-pompe-body {
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* ≥ 2200px */
  gap: 16px;
}

@media (max-width: 2199px) {
  .gestione-pompe-body {
    grid-template-columns: repeat(3, 1fr);
  }}

@media (max-width: 1599px) {
  .gestione-pompe-body {
    grid-template-columns: repeat(2, 1fr);
  }}

@media (max-width: 999px) {
  .gestione-pompe-body {
    grid-template-columns: 1fr;
  }}

/* Card singola pompa */
.pompa-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

/* Intestazione pompa */
.pompa-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

/* Tile per aggiungere la pompa successiva */
:is(.pompa-add-card, .serbatoi-gestione-add-card) {
  min-height: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

:is(.pompa-add-icon, .serbatoi-gestione-add-icon) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  font-size: 1rem;
}

:is(.pompa-add-title, .serbatoi-gestione-add-title) {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
}

:is(.pompa-add-copy, .serbatoi-gestione-add-copy) {
  max-width: 27ch;
  margin: 0.35rem auto 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

:is(.pompa-add-actions, .serbatoi-gestione-add-actions) {
  width: 100%;
  margin-top: 0.35rem;
}

:is(.pompa-add-action, .serbatoi-gestione-add-action) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

:is(.pompa-add-action--primary, .serbatoi-gestione-add-action--primary) {
  background: #2563eb;
  color: #fff;
}

:is(.pompa-add-action--primary, .serbatoi-gestione-add-action--primary):hover {
  background: #1d4ed8;
}

:is(.pompa-add-action--secondary, .serbatoi-gestione-add-action--secondary) {
  border-color: #bfdbfe;
  background: #fff;
  color: #2563eb;
}

:is(.pompa-add-action--secondary, .serbatoi-gestione-add-action--secondary):hover {
  border-color: #2563eb;
  background: #eff6ff;
}

:is(.pompa-add-action, .serbatoi-gestione-add-action):focus-visible {
  outline: 3px solid #0f172a;
  outline-offset: 2px;
}

:is(.pompa-add-action, .serbatoi-gestione-add-action):disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pompa-nome-input {
  flex: 1;
  max-width: 320px;
  font-weight: 500;
}

/* Lista erogatori nella card */
.erogatori-list {
  padding: 0.875rem 1rem;
}

/* Riga intestazione colonne */
.erogatori-header-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr 1fr 2.25rem;
  gap: 0.5rem;
  padding: 0 0 0.4rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

/* Riga singolo erogatore */
.erogatore-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr 1fr 2.25rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

/* Badge numero erogatore */
.erogatore-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Pulsante rimuovi erogatore (×) */
:is(.clienti-credito-gestione-btn-erog-remove, .operatori-btn-erog-remove, .pompe-ed-erogatori-btn-erog-remove, .preset-pompe-btn-erog-remove, .turni-btn-erog-remove, .turno-card-btn-erog-remove) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

:is(.clienti-credito-gestione-btn-erog-remove, .operatori-btn-erog-remove, .pompe-ed-erogatori-btn-erog-remove, .preset-pompe-btn-erog-remove, .turni-btn-erog-remove, .turno-card-btn-erog-remove):hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

/* Pulsante aggiungi erogatore */
.btn-add-erogatore {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add-erogatore:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

.gestione-save-bar {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  max-width: calc(100vw - 3rem);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  flex-wrap: wrap;
}

:is(.gestione-tab-content, .impostazioni-gestione-tab-content) {
  padding-bottom: 7rem;
}

.gestione-save-feedback {
  min-width: 0;
  max-width: min(38rem, 55vw);
  text-align: right;
}

@media (max-width: 760px) {
  :is(.gestione-tab-content, .impostazioni-gestione-tab-content) {
    padding-bottom: 10rem;
  }
  .gestione-save-bar {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
  }
  .gestione-save-feedback {
    max-width: none;
  }
  .gestione-save-bar .fa-table-action {
    width: 100%;
    justify-content: center;
  }}

/* Messaggi feedback salvataggio */
:is(.accrediti-clienti-gestione-msg, .carte-gestione-gestione-msg, .clienti-credito-gestione-gestione-msg, .metodi-accredito-catalogo-gestione-msg, .operatori-gestione-msg, .preset-pompe-gestione-msg, .turni-gestione-msg) {
  font-size: 0.85rem;
  font-weight: 500;
}

:is(.carte-gestione-gestione-msg--ok, .clienti-credito-gestione-gestione-msg--ok, .operatori-gestione-msg--ok, .preset-pompe-gestione-msg--ok, .turni-gestione-msg--ok) {
  color: #16a34a;
}

:is(.accrediti-clienti-gestione-msg--error, .carte-gestione-gestione-msg--error, .clienti-credito-gestione-gestione-msg--error, .operatori-gestione-msg--error, .preset-pompe-gestione-msg--error, .turni-gestione-msg--error) {
  color: #dc2626;
}

/* ── Operatori — layout split ─────────────────────────── */

:is(.carte-gestione-split, .clienti-credito-gestione-split, .metodi-accredito-catalogo-split, .operatori-split, .preset-pompe-split, .superadmin-dashboard-split, .turni-split) {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.5rem 1.5rem;
  align-items: flex-start;
}

:is(.carte-gestione-split-main, .clienti-credito-gestione-split-main, .metodi-accredito-catalogo-split-main, .operatori-split-main, .preset-pompe-split-main, .superadmin-dashboard-split-main, .turni-split-main) {
  flex: 1;
  min-width: 0;
}

:is(.clienti-credito-gestione-split-side, .metodi-accredito-catalogo-split-side, .operatori-split-side, .preset-pompe-split-side, .superadmin-dashboard-split-side, .turni-split-side) {
  width: 25%;
  flex-shrink: 0;
}

/* Card form "Nuovo operatore" */
:is(.clienti-credito-gestione-side-card, .metodi-accredito-catalogo-side-card, .operatori-side-card, .preset-pompe-side-card, .superadmin-dashboard-side-card, .turni-side-card) {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

:is(.clienti-credito-gestione-side-header, .metodi-accredito-catalogo-side-header, .operatori-side-header, .preset-pompe-side-header, .superadmin-dashboard-side-header, .turni-side-header) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

:is(.clienti-credito-gestione-side-header, .metodi-accredito-catalogo-side-header, .operatori-side-header, .preset-pompe-side-header, .superadmin-dashboard-side-header, .turni-side-header) i {
  color: #3b82f6;
  font-size: 0.8rem;
}

:is(.clienti-credito-gestione-side-body, .metodi-accredito-catalogo-side-body, .operatori-side-body, .preset-pompe-side-body, .superadmin-dashboard-side-body, .turni-side-body) {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

:is(.clienti-credito-gestione-side-btn, .metodi-accredito-catalogo-side-btn, .operatori-side-btn, .preset-pompe-side-btn, .turni-side-btn) {
  width: 100%;
  justify-content: center;
}

/* Tabella operatori */
:is(.accrediti-storico-base-table, .clienti-credito-gestione-table, .operatori-table, .preset-pompe-table, .turni-table) {
  width: 100%;
  border-collapse: collapse;
}

:is(.accrediti-storico-base-table, .clienti-credito-gestione-table, .operatori-table, .preset-pompe-table, .turni-table) thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 0 0.5rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

:is(.accrediti-storico-base-table, .clienti-credito-gestione-table, .operatori-table, .preset-pompe-table, .turni-table) tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

:is(.accrediti-storico-base-table, .clienti-credito-gestione-table, .operatori-table, .preset-pompe-table, .turni-table) tbody tr:last-child {
  border-bottom: none;
}

:is(.accrediti-storico-base-table, .clienti-credito-gestione-table, .operatori-table, .preset-pompe-table, .turni-table) tbody tr:hover td {
  background: #f8fafc;
}

:is(.clienti-credito-gestione-td-nome, .operatori-td-nome, .preset-pompe-td-nome, .turni-td-nome) {
  padding: 0.65rem 0.5rem;
  font-size: 0.9rem;
  color: #0f172a;
}

:is(.clienti-credito-gestione-td-azioni, .operatori-td-azioni, .preset-pompe-td-azioni, .turni-td-azioni) {
  padding: 0.5rem 0;
  text-align: right;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* Feedback barra (edit/remove) */
:is(.operatori-feedback-bar, .preset-pompe-feedback-bar, .turni-feedback-bar) {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
}

/* Form modifica inline nella tabella */
:is(.clienti-credito-gestione-form-inline, .operatori-form-inline, .preset-pompe-form-inline, .turni-form-inline) {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.875rem 1rem;
}

:is(.clienti-credito-gestione-form-row, .operatori-form-row, .preset-pompe-form-row, .turni-form-row) {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

:is(.clienti-credito-gestione-form-actions, .operatori-form-actions, .preset-pompe-form-actions, .turni-form-actions) {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
  padding-bottom: 0.35rem;
}

/* Banner avviso modifica sostanziale */
.addetti-warn-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.5;
}

.addetti-warn-banner i {
  margin-right: 0.3rem;
  color: #d97706;
}

/* Responsivo: sotto 800px la colonna destra si sposta sotto */
@media (max-width: 800px) {
  :is(.carte-gestione-split, .clienti-credito-gestione-split, .metodi-accredito-catalogo-split, .operatori-split, .preset-pompe-split, .superadmin-dashboard-split, .turni-split) {
    flex-direction: column;
  }
  :is(.clienti-credito-gestione-split-side, .metodi-accredito-catalogo-split-side, .operatori-split-side, .preset-pompe-split-side, .superadmin-dashboard-split-side, .turni-split-side) {
    width: 100%;
  }}

/* Badge orario fascia turno */
.slot-orario-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.slot-orario-badge i {
  color: #94a3b8;
  font-size: 0.75rem;
}

/* =========================================================
   ReconnectModal (Blazor Server)
   ========================================================= */

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation {
  display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
  display: block;
}

#components-reconnect-modal {
  background-color: white;
  width: 20rem;
  margin: 20vh auto;
  padding: 2rem;
  border: 0;
  border-radius: 0.5rem;
  box-shadow: 0 3px 6px 2px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition:
    display 0.5s allow-discrete,
    overlay 0.5s allow-discrete;
  animation: components-reconnect-modal-fadeOutOpacity 0.5s both;
}

#components-reconnect-modal[open] {
  animation:
    components-reconnect-modal-slideUp 1.5s cubic-bezier(0.05, 0.89, 0.25, 1.02) 0.3s,
    components-reconnect-modal-fadeInOpacity 0.5s ease-in-out 0.3s;
  animation-fill-mode: both;
}

#components-reconnect-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
  animation: components-reconnect-modal-fadeInOpacity 0.5s ease-in-out;
  opacity: 1;
}

@keyframes components-reconnect-modal-slideUp {
  0% {
    transform: translateY(30px) scale(0.95);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes components-reconnect-modal-fadeInOpacity {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes components-reconnect-modal-fadeOutOpacity {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.components-reconnect-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#components-reconnect-modal p {
  margin: 0;
  text-align: center;
}

#components-reconnect-modal button {
  border: 0;
  background-color: #6b9ed2;
  color: white;
  padding: 4px 24px;
  border-radius: 4px;
}

#components-reconnect-modal button:hover {
  background-color: #3b6ea2;
}

#components-reconnect-modal button:active {
  background-color: #6b9ed2;
}

.components-rejoining-animation {
  position: relative;
  width: 80px;
  height: 80px;
}

.components-rejoining-animation div {
  position: absolute;
  border: 3px solid #0087ff;
  opacity: 1;
  border-radius: 50%;
  animation: components-rejoining-animation 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.components-rejoining-animation div:nth-child(2) {
  animation-delay: -0.5s;
}

@keyframes components-rejoining-animation {
  0% {
    top: 40px;
    left: 40px;
    width: 0;
    height: 0;
    opacity: 0;
  }
  4.9% {
    top: 40px;
    left: 40px;
    width: 0;
    height: 0;
    opacity: 0;
  }
  5% {
    top: 40px;
    left: 40px;
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    top: 0;
    left: 0;
    width: 80px;
    height: 80px;
    opacity: 0;
  }
}

/* =========================================================
   Conti — turni di cassa
   ========================================================= */
.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  color: white;
  background: #2a4076;
  border: 1px solid #2a4076;
  border-radius: 0.5rem;
  margin-bottom: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.filter-button:hover,
.filter-button:focus-visible {
  color: white;
  background: #20325f;
  border-color: #20325f;
  outline: none;
  transform: translateY(-1px);
}

.filter-button--active {
  background: #1e5aa8;
  border-color: #1e5aa8;
}

.filter-button--new {
  background: #2f7d46;
  border-color: #2f7d46;
}

.filter-button--new:hover,
.filter-button--new:focus-visible {
  background: #256238;
  border-color: #256238;
}

.conti-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.conti-giornata {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Card turno */
.conti-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.conti-card-header {
  padding: 0.7rem;
}

.conti-card-skeleton {
  color: transparent;
}

.conti-card-skeleton .conti-card-incassi {
  min-height: 3.25rem;
}

.conti-card-skeleton-line {
  display: block;
  height: 1.65rem;
  border-radius: 6px;
  background: #e2e8f0;
  animation: conti-skeleton-pulse 1.4s ease-in-out infinite;
}

.conti-card-skeleton-line--turno { width: 12rem; }
.conti-card-skeleton-line--operatore { width: 10rem; }
.conti-card-skeleton-line--pompe { width: 7rem; }
.conti-card-skeleton-line--importo { width: 5.5rem; height: 2rem; }
.conti-card-skeleton-line--wide { width: 6.5rem; }
.conti-card-skeleton-line--azione { width: 5.5rem; height: 2rem; margin-left: auto; }

@keyframes conti-skeleton-pulse {
  50% { opacity: 0.48; }
}

@media (prefers-reduced-motion: reduce) {
  .conti-card-skeleton-line { animation: none; }}

.conti-card-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.conti-card-titolo {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  flex-direction: column;
}

.conti-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 6px;
  padding: 2.8px 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}

.conti-slot-orario {
  font-size: 0.875rem;
  color: #64748b;
}

.conti-pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.conti-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 6px;
  padding: 0 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.9;
}

.conti-pill i {
  color: inherit;
  opacity: 0.7;
}

.conti-pill--addetto {
  background: transparent;
  color: #334155;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.conti-pill--pompa {
  background: #dcfce7;
  color: #14532d;
}

.conti-pill--pompa-primo-preset {
  background: #fee2e2;
  color: #991b1b;
}

.conti-pill--pompa-secondo-preset {
  background: #fef3c7;
  color: #92400e;
}

html[data-theme="dark"] .conti-card-skeleton-line {
  background: #475569;
}

.conti-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.conti-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.875rem;
  color: #475569;
}

.conti-card-incassi {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  width: 100%;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.6rem;
}

.conti-incasso-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.conti-incasso-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  text-align: center;
}

.conti-incasso-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
}

.conti-incasso-item--sep {
  width: 1px;
  background: #e2e8f0;
  align-self: stretch;
  margin: 0 0.25rem;
}

.conti-chiusure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: auto;
}

.conti-chiusure-badge--ok {
  background: #dcfce7;
  color: #15803d;
}

.conti-chiusure-badge--warn {
  background: #fef9c3;
  color: #92400e;
}

/* Corpo form modifica card */
.conti-card-edit-body {
  border-top: 1px solid #e2e8f0;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #f8fafc;
}

.conti-edit-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.conti-edit-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 600;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e2e8f0;
}

/* Tabella letture */
.conti-letture-wrap {
  overflow-x: auto;
}

.conti-letture-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.conti-letture-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 0.4rem 0.75rem;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.conti-letture-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #374151;
}

.conti-num-input {
  width: 110px;
  padding: 0.3rem 0.5rem !important;
  font-size: 0.875rem;
}

.conti-litri-cell {
  color: #475569;
  font-size: 0.875rem;
  text-align: right;
}

/* Tag modalità erogazione */
.conti-modalita-tag {
  display: inline-block;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 0.3rem;
}

.conti-modalita-tag--servito {
  background: #dbeafe;
  color: #1d4ed8;
}

.conti-modalita-tag--self {
  background: #fef3c7;
  color: #92400e;
}

/* Prezzi grid */
.conti-prezzi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.conti-prezzo-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 160px;
}

/* Incassi grid */
.conti-incassi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

/* Addetti checkboxes */
.conti-addetti-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.conti-addetto-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.conti-addetto-check:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.conti-addetto-check input[type="checkbox"] {
  accent-color: #6366f1;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Footer form */
.conti-edit-footer {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

/* Pannello nuovo conteggio */
.conti-nuovo-panel {
  margin-top: 0.5rem;
}

.conti-nuovo-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Pompe checkboxes */
.conti-pompe-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.conti-pompa-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition:
    border-color 0.15s,
    background 0.15s;
  max-width: 520px;
}

.conti-pompa-check:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.conti-pompa-check input[type="checkbox"] {
  accent-color: #6366f1;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.conti-pompa-nome {
  font-weight: 600;
  color: #1e293b;
  min-width: 80px;
}

.conti-pompa-detail {
  color: #64748b;
  font-size: 0.8rem;
}

/* Riga filtri conti */
:is(.conti-filtri-row, .nuovo-conteggio-conti-filtri-row) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 1rem;
}

.conti-filter-panel {
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 0;
}

.conti-filter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eef2f7;
}

.conti-filter-header h2 {
  margin: 0 0 0.2rem;
  color: #1e293b;
  font-size: 0.95rem;
  font-weight: 700;
}

.conti-filter-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}

.conti-filter-field {
  min-width: 0;
}

.conti-filter-field .rz-datepicker,
.conti-filter-field .rz-dropdown {
  width: 100%;
  min-width: 0;
}

.rz-dropdown:is(.nuovo-conteggio-dropdown, .operatore-nuovo-conteggio-dropdown),
.rz-dropdown:is(.nuovo-conteggio-dropdown, .operatore-nuovo-conteggio-dropdown) .rz-inputtext,
.rz-dropdown:is(.nuovo-conteggio-dropdown, .operatore-nuovo-conteggio-dropdown) .rz-dropdown-label,
.rz-dropdown:is(.nuovo-conteggio-dropdown, .operatore-nuovo-conteggio-dropdown) .rz-multiselect-label {
  font-size: 1rem;
}

.rz-dropdown.operator-product-dropdown--selected.rz-state-disabled .rz-dropdown-label {
  color: #1e293b !important;
  opacity: 1;
}

.rz-dropdown.operator-sequenced-dropdown .rz-dropdown-label,
.rz-dropdown.operator-product-dropdown .rz-dropdown-label {
  background-color: transparent !important;
}

.operator-form .rz-dropdown.operator-sequenced-dropdown.rz-state-disabled,
.operator-form .rz-dropdown.operator-product-dropdown.rz-state-disabled:not(.operator-product-dropdown--selected) {
  background-color: #e9ecef !important;
}

.operator-form .rz-dropdown.operator-product-dropdown--selected.rz-state-disabled {
  background-color: #fff !important;
}

html[data-theme="dark"] .rz-dropdown.operator-product-dropdown--selected.rz-state-disabled .rz-dropdown-label {
  color: #dce5ef !important;
}

html[data-theme="dark"] .operator-form .rz-dropdown.operator-sequenced-dropdown.rz-state-disabled .rz-dropdown-label,
html[data-theme="dark"] .operator-form .rz-dropdown.operator-product-dropdown.rz-state-disabled:not(.operator-product-dropdown--selected) .rz-dropdown-label,
html[data-theme="dark"] #operatore-litri:disabled,
html[data-theme="dark"] #operatore-cliente:disabled {
  color: #9ba4b0 !important;
}

html[data-theme="dark"] .operator-form .rz-dropdown.operator-sequenced-dropdown.rz-state-disabled,
html[data-theme="dark"] .operator-form .rz-dropdown.operator-product-dropdown.rz-state-disabled:not(.operator-product-dropdown--selected),
html[data-theme="dark"] .operator-form .rz-dropdown.operator-product-dropdown--selected.rz-state-disabled,
html[data-theme="dark"] #operatore-cliente:disabled {
  background-color: #14171b !important;
}

.conti-filtri-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  min-height: 2.35rem;
}

/* Pannello filtri con animazione */
.filtri-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
}

.filtri-panel--open {
  max-height: 500px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* ── Conti page layout ─────────────────────────────────────── */
.conti-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.conti-layout--ripristino {
  visibility: hidden;
}

.conti-fixed-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  padding-bottom: 0.5rem;
}

.conti-fixed-top :is(.accrediti-clienti-page-header, .carichi-page-header, .conti-page-header, .gestione-page-header, .giacenze-page-header, .impostazioni-page-header, .nuovo-conteggio-page-header, .report-page-header, .superadmin-dashboard-page-header) {
  margin-bottom: 1rem;
}

/* Panel storico turni */
.conti-storico-panel {
  background: white;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.conti-storico-header {
  flex-shrink: 0;
  padding: 1.1rem 1.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: white;
}

.conti-storico-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}

.conti-storico-scroll {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.conti-storico-sentinel {
  min-height: 1px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
  .conti-card-header {
    padding: 0.875rem 1rem;
  }

  .conti-card-edit-body {
    padding: 1rem;
  }

  .conti-incassi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .conti-chiusure-badge {
    margin-left: 0;
  }}

@media (max-width: 1100px) {
  :is(.conti-filtri-row, .nuovo-conteggio-conti-filtri-row) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conti-filtri-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }}

@media (max-width: 640px) {
  .conti-toolbar {
    align-items: stretch;
  }

  .conti-toolbar .filter-button {
    flex: 1;
    justify-content: center;
  }

  :is(.conti-filtri-row, .nuovo-conteggio-conti-filtri-row) {
    grid-template-columns: 1fr;
  }

  .conti-filtri-actions {
    grid-column: auto;
  }}

/* =========================================================
   Nuovo Conteggio — Step 2
   ========================================================= */

/* Layout flex column a tutta altezza (come conti-layout) */
.nc2-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.nc2-top {
  flex-shrink: 0;
}

/* Card header con riepilogo + prezzi + differenza */
.nc2-header-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  overflow: hidden;
}

/* Pulsante toggle — sempre visibile */
.nc2-header-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.35rem 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nc2-header-toggle:hover {
  color: #475569;
}

.nc2-header-toggle i {
  transition: transform 0.18s ease;
}

.nc2-header-toggle--open i {
  transform: rotate(180deg);
}

/* Chip riepilogo (giorno, turno, operatori) */
.nc2-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: #334155;
  max-width: 100%;
}

.nc2-chip i {
  color: #64748b;
  font-size: 0.75rem;
}

/* Riga prezzi editabili */
.nc2-prezzi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 200px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 0.18s ease,
    opacity 0.15s ease,
    margin-top 0.18s ease;
}

.nc2-header-card--collapsed .nc2-prezzi-row {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.nc2-header-card--collapsed .nc2-header-summary-row {
  margin-bottom: 0 !important;
}

.nc2-operatori-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 400px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-width 0.18s ease,
    opacity 0.15s ease;
}

.nc2-header-card--collapsed .nc2-operatori-wrap {
  max-width: 0;
  min-width: 0;
  opacity: 0;
}

.nc2-prezzo-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.3rem 0.65rem;
}

:is(.carte-tab-nc2-prezzo-label, .clienti-credito-tab-nc2-prezzo-label, .mancati-pagamenti-tab-nc2-prezzo-label, .nuovo-conteggio-nc2-prezzo-label, .prima-nota-tab-nc2-prezzo-label, .versamenti-tab-nc2-prezzo-label) {
  font-size: 0.78rem;
  color: #475569;
  white-space: nowrap;
}

/* Specchietto differenza turno */
.nc2-differenza-card {
  flex-shrink: 0;
  min-width: 170px;
  max-width: 400px;
  max-height: 300px;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid;
  text-align: center;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 0.18s ease,
    opacity 0.15s ease,
    min-width 0.18s ease,
    max-width 0.18s ease,
    padding 0.18s ease;
}

.nc2-header-card--collapsed .nc2-differenza-card {
  display: none;
  max-height: 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  opacity: 0;
}

.nc2-differenza-card--pos {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #15803d;
}

.nc2-differenza-card--neg {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}

.nc2-differenza-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 0.2rem;
}

.nc2-differenza-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.nc2-differenza-sub {
  font-size: 0.68rem;
  opacity: 0.6;
  margin-top: 0.3rem;
  line-height: 1.5;
}

/* Mini card differenza (visibile quando header collassato) */
.nc2-differenza-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nc2-differenza-mini--pos {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #15803d;
}

.nc2-differenza-mini--neg {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}

.nc2-differenza-mini-label {
  font-weight: 500;
  opacity: 0.7;
}

.nc2-differenza-mini-value {
  font-weight: 700;
  font-size: 0.9rem;
}

/* Tab bar */
.nc2-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-top: 1rem;
}

.nc2-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.nc2-tab-btn:hover:not(:disabled) {
  color: #1e293b;
}

.nc2-tab-btn--active {
  color: #0f172a;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}

.nc2-tab-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.nc2-tab-btn i {
  font-size: 0.8rem;
}

/* Area scrollabile contenuto tab */
.nc2-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: white;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 0.75rem 0.75rem;
}

.sumup-import-region {
  position: relative;
  min-height: 100%;
}

.sumup-import-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 100%;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  color: #1e293b;
  font-weight: 600;
}

html[data-theme="dark"] .sumup-import-overlay {
  background: rgba(15, 23, 42, 0.94);
  color: #e2e8f0;
}

/* Tabella erogatori */
:is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.nc2-table--clienti-credito .nc2-col-left { text-align: left; }
.nc2-table--clienti-credito .nc2-col-center { text-align: center; }
.nc2-table--clienti-credito .nc2-col-right { text-align: right; }

.nc2-col-cliente {
    width: 25%;
}

.nc2-col-targa {
    width: 15%;
}

.nc2-col-buono {
    width: 12%;
}

.nc2-col-fattura {
    width: 9%;
}

.nc2-col-prodotto {
    width: 7%;
}

.nc2-col-modalita {
    width: 5%;
}

.nc2-col-importo {
    width: 9%;
}

.nc2-table--clienti-credito .nc2-col-azioni {
    width: 1%;
    white-space: nowrap;
}

:is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table) thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 0.4rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1;
}

.clienti-credito-tab {
  padding: 0.75rem;
}

:is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table) tbody td {
  padding: 0.2rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  vertical-align: middle;
  font-size: 0.95rem;
}

:is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table) tbody td.versamenti-tabella-importo {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

:is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table) tbody tr:last-child td {
  border-bottom: none;
}

.nc2-tfoot-totale td {
  padding: 0.35rem 0.75rem;
  border-top: 2px solid #cbd5e1;
  font-size: 1rem;
  color: #1e293b;
  background: #f8fafc;
}

/* Letture e riepilogo vendite affiancati; il riepilogo va a capo quando lo spazio non basta */
.erogatori-tab-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
}

.erogatori-tab-letture {
  flex: 999 1 47rem;
  min-width: 0;
}

/* Larghezze fisse: la tabella non si ridimensiona quando cambiano letture o differenze.
   Tutte le colonne hanno una larghezza, così lo spazio in più si divide in proporzione. */
.erogatori-tab-letture > table {
  table-layout: fixed;
  min-width: 47rem;
}

.erogatori-tab-letture thead th {
  white-space: nowrap;
}

.erogatori-tab-col-erogatore { width: 10rem; }
.erogatori-tab-col-lettura { width: 7rem; }
.erogatori-tab-col-scatti { width: 8rem; }
.erogatori-tab-col-differenza { width: 8rem; }
.erogatori-tab-col-prezzo { width: 7rem; }

/* Affiancato alle letture resta visibile durante lo scroll, allineato alla loro intestazione.
   Quando va a capo è l'ultimo elemento del layout, quindi sticky non ha effetto. */
.erogatori-tab-riepilogo {
  flex: 1 1 29rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.erogatori-tab-riepilogo :is(th, td) {
  padding-inline: 0.6rem;
}

@media (max-width: 575.98px) {
  .erogatori-tab-riepilogo :is(th, td) {
    padding-inline: 0.35rem;
  }
}

/* Righe alte quanto quelle con gli input delle letture */
.erogatori-tab-riepilogo tbody td {
  height: 2.45rem;
}

.erogatori-tab-riepilogo :is(tbody, tfoot) td:not(:first-child) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Da 576px larghezze fisse: "Totale complessivo" si estende nella cella vuota di Modalità */
@media (min-width: 576px) {
  .erogatori-tab-riepilogo > table {
    table-layout: fixed;
    min-width: 29rem;
  }

  .erogatori-tab-riepilogo tfoot td:first-child {
    white-space: nowrap;
    overflow: visible;
  }

  .erogatori-tab-col-prodotto { width: 6rem; }
  .erogatori-tab-col-modalita { width: 5.5rem; }
  .erogatori-tab-col-prezzo-riepilogo { width: 5rem; }
  .erogatori-tab-col-litri { width: 5rem; }
  .erogatori-tab-col-totale { width: 7.5rem; }
}

/* Prima colonna: etichetta erogatore su riga singola */
.nc2-erog-label {
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
}

/* Colonna differenza e prezzo */
.nc2-diff {
  color: #334155;
  font-variant-numeric: tabular-nums;
}
.nc2-prezzo-col {
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* Input prezzo (sostituisce RadzenNumeric) */
:is(.carte-tab-nc2-prezzo-input, .clienti-credito-tab-nc2-prezzo-input, .nuovo-conteggio-nc2-prezzo-input, .prima-nota-tab-nc2-prezzo-input, .versamenti-tab-nc2-prezzo-input) {
  width: 80px;
  height: 30px;
  padding: 0 0.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: right;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  font-family: inherit;
}

:is(.carte-tab-nc2-prezzo-input, .clienti-credito-tab-nc2-prezzo-input, .nuovo-conteggio-nc2-prezzo-input, .prima-nota-tab-nc2-prezzo-input, .versamenti-tab-nc2-prezzo-input):focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

:is(.carte-tab-nc2-prezzo-input, .clienti-credito-tab-nc2-prezzo-input, .nuovo-conteggio-nc2-prezzo-input, .prima-nota-tab-nc2-prezzo-input, .versamenti-tab-nc2-prezzo-input) input[type="number"] {
  -moz-appearance: textfield;
}

:is(.carte-tab-nc2-prezzo-input, .clienti-credito-tab-nc2-prezzo-input, .nuovo-conteggio-nc2-prezzo-input, .prima-nota-tab-nc2-prezzo-input, .versamenti-tab-nc2-prezzo-input) input[type="number"]::-webkit-outer-spin-button,
:is(.carte-tab-nc2-prezzo-input, .clienti-credito-tab-nc2-prezzo-input, .nuovo-conteggio-nc2-prezzo-input, .prima-nota-tab-nc2-prezzo-input, .versamenti-tab-nc2-prezzo-input) input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Input lettura finale */
.nc2-input-lettura {
  width: 110px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  text-align: right;
  background: white;
  color: #0f172a;
  -moz-appearance: textfield;
}

.nc2-input-lettura--totalizzatore {
  width: 85px;
}

.nc2-input-lettura::-webkit-outer-spin-button,
.nc2-input-lettura::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.nc2-input-lettura:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ── Carte Petrolifere ───────────────────────────────────────── */
.conteggio-movimento-input {
  padding-block: 5px;
}

:is(.mancati-pagamenti-tab-layout, .prima-nota-layout) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  align-items: start;
}

.versamenti-panel {
  margin: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  min-width: 0;
}

html[data-theme="dark"] .versamenti-panel {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .versamenti-panel .versamenti-tab-nc2-prezzo-label,
html[data-theme="dark"] .versamenti-panel .text-muted {
  color: var(--fa-dark-text-muted) !important;
}

:is(.mancati-pagamenti-tab-panel, .prima-nota-panel) {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  min-width: 0;
}

.mancati-pagamenti-tab-form {
  flex-wrap: nowrap;
}

@media (max-width: 1199.98px) {
  .mancati-pagamenti-tab-form {
    flex-wrap: wrap;
  }
}

.prima-nota-panel--blue {
  border-color: #d8e5f2;
  background: #f5f9fd;
}

.mancati-pagamenti-tab-panel--amber {
  border-color: #f0dfbb;
  background: #fff9ed;
}

.carte-petrolifere-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

:is(.carte-tab-carte-section, .clienti-credito-tab-carte-section) {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
}

.carte-entry-row {
  row-gap: 0.75rem !important;
}

.carte-section--petrolifere {
  background: var(--carte-section-bg);
  border-color: #e0f2fe;
}

.carte-section--buoni {
  background: var(--carte-section-bg);
  border-color: #fde68a;
}

.carte-section--clienti-credito {
  background: #f5f3ff;
  max-width: 1300px;
  border-color: #ddd6fe;
}

.carte-section--circuiti {
  background: var(--carte-section-bg);
  border-color: #bbf7d0;
}

.theme-mode-toggle {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.theme-mode-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-mode-toggle:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.theme-mode-toggle i {
  grid-area: 1 / 1;
  font-size: 1rem;
  opacity: 0;
  transform: scale(0.75) rotate(-25deg);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.theme-mode-toggle i.is-active {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.conti-incasso-val--positive {
  color: green;
  font-weight: 800;
}

.conti-incasso-val--negative {
  color: red;
  font-weight: 800;
}

:is(.carte-tab-carte-section-total, .clienti-credito-tab-carte-section-total) {
  padding-top: 0.4rem;
  border-top: 1px solid black;
  color: #1e293b;
  font-size: 0.9rem;
}

.versamenti-section-total {
  padding-top: 0.4rem;
  border-top: 1px solid black;
  color: #1e293b;
  font-size: 0.9rem;
}

.prima-nota-descrizione {
  font-size: 0.875rem;
}

.conteggio-movimento-valore {
  color: #000;
  font-variant-numeric: tabular-nums;
}

:is(.mancati-pagamenti-tab-riepilogo, .prima-nota-riepilogo) {
  padding-top: 0.5rem;
  border-top: 1px solid black;
  font-size: 0.875rem;
}

:is(.mancati-pagamenti-tab-entrate, .prima-nota-entrate),
:is(.mancati-pagamenti-tab-uscite, .prima-nota-uscite) {
  font-weight: 600;
}

:is(.mancati-pagamenti-tab-entrate, .prima-nota-entrate) {
  color: #16a34a;
}

:is(.mancati-pagamenti-tab-uscite, .prima-nota-uscite) {
  color: #dc2626;
}

.clienti-credito-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.clienti-credito-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.42fr);
  gap: 0.75rem;
  align-items: end;
}

.clienti-credito-row--cliente-targa {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1fr);
}

.clienti-credito-row--dettaglio {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
}

.clienti-credito-add {
  display: flex;
  align-items: end;
}

.clienti-credito-field {
  min-width: 0;
}

.rz-dropdown.clienti-credito-modalita-dropdown .rz-dropdown-label {
  color: #000 !important;
  opacity: 1;
}

.clienti-credito-importo {
  min-width: 0;
}

@media (max-width: 767px) {
  .clienti-credito-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }}

@media (max-width: 520px) {
  .clienti-credito-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .clienti-credito-add .fa-table-action {
    width: 100%;
  }}

/* ── Gestione metodi di accredito ─────────────────────────── */
.metodi-accredito-section {
  margin-top: 2.5rem;
}

/* ── Accrediti clienti ────────────────────────────────────── */
.accrediti-clienti-panel {
  overflow: hidden;
}

.accrediti-clienti-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.accrediti-clienti-panel-header :is(.accrediti-clienti-gestione-section-title, .carte-gestione-gestione-section-title, .clienti-credito-gestione-gestione-section-title, .fortech-gestione-gestione-section-title, .metodi-accredito-catalogo-gestione-section-title, .metodi-accredito-gestione-gestione-section-title, .operatori-gestione-section-title, .pompe-ed-erogatori-gestione-section-title, .preset-pompe-gestione-section-title, .prodotti-merci-gestione-gestione-section-title, .serbatoi-gestione-gestione-section-title, .sum-up-gestione-gestione-section-title, .turni-gestione-section-title) {
  margin: 0;
}

.accrediti-clienti-panel-header :is(.accrediti-clienti-gestione-section-sub, .carte-gestione-gestione-section-sub, .clienti-credito-gestione-gestione-section-sub, .fortech-gestione-gestione-section-sub, .metodi-accredito-catalogo-gestione-section-sub, .metodi-accredito-gestione-gestione-section-sub, .operatori-gestione-section-sub, .pompe-ed-erogatori-gestione-section-sub, .preset-pompe-gestione-section-sub, .prodotti-merci-gestione-gestione-section-sub, .serbatoi-gestione-gestione-section-sub, .turni-gestione-section-sub) {
  margin: 0.3rem 0 0;
}

.accrediti-clienti-table-wrap {
  overflow-x: auto;
}

.accrediti-clienti-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.accrediti-clienti-table th {
  padding: 0.7rem 1.5rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.accrediti-clienti-table td {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eef2f7;
  color: #334155;
  vertical-align: middle;
}

.accrediti-clienti-table tbody tr {
  transition: background 0.15s ease;
}

.accrediti-clienti-table tbody tr:hover {
  background: #f8fafc;
}

.accrediti-clienti-nome {
  color: #0f172a !important;
  font-weight: 700;
}

.accrediti-data {
  color: #64748b !important;
  font-size: 0.875rem;
}

.accrediti-stato {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.accrediti-stato--attivo {
  background: #dcfce7;
  color: #166534;
}

.accrediti-stato--disattivato {
  background: #e2e8f0;
  color: #475569;
}

.accrediti-saldo {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.accrediti-saldo--positivo {
  color: #15803d;
}
.accrediti-saldo--negativo {
  color: #b91c1c;
}
.accrediti-saldo--zero {
  color: #64748b;
}

.accrediti-clienti-empty {
  padding: 2.5rem 1.5rem;
  color: #64748b;
  text-align: center;
}

.accrediti-clienti-form {
  padding: 1.25rem 1.5rem;
  background: #fafcff;
}

.accrediti-clienti-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.accrediti-clienti-field {
  min-width: 0;
}

.accrediti-clienti-field :is(.accrediti-clienti-edit-label, .aggiungi-impianto-modal-edit-label, .assegna-impianto-modal-edit-label, .clienti-credito-gestione-edit-label, .clienti-credito-tab-edit-label, .conti-edit-label, .erogatori-tab-edit-label, .giacenze-edit-label, .modifica-impianto-modal-edit-label, .modifica-utente-modal-edit-label, .nuovo-conteggio-edit-label, .operatori-edit-label, .preset-pompe-edit-label, .report-edit-label, .rubrica-email-settings-edit-label, .turni-edit-label) {
  display: block;
  margin-bottom: 0.3rem;
}

.accrediti-clienti-submit {
  display: flex;
  align-items: end;
}

.accrediti-clienti-submit .fa-table-action {
  min-height: 38px;
  white-space: nowrap;
}

.accrediti-storico-modal {
  display: flex;
  flex-direction: column;
  max-width: min(68rem, calc(100vw - 2rem));
  max-height: min(46rem, calc(100vh - 2rem));
}

.accrediti-storico-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.accrediti-storico-filtri {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
}

.accrediti-storico-data-field :is(.accrediti-clienti-edit-label, .aggiungi-impianto-modal-edit-label, .assegna-impianto-modal-edit-label, .clienti-credito-gestione-edit-label, .clienti-credito-tab-edit-label, .conti-edit-label, .erogatori-tab-edit-label, .giacenze-edit-label, .modifica-impianto-modal-edit-label, .modifica-utente-modal-edit-label, .nuovo-conteggio-edit-label, .operatori-edit-label, .preset-pompe-edit-label, .report-edit-label, .rubrica-email-settings-edit-label, .turni-edit-label) {
  display: block;
  margin-bottom: 0.45rem;
}

.accrediti-storico-list {
  flex: 1 1 auto;
  min-height: 10rem;
  max-height: min(24rem, 45vh);
  text-align: center;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}

.accrediti-storico-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.accrediti-storico-col-data {
  width: 8.5rem;
}

.accrediti-storico-col-importo {
  width: 10.5rem;
}

.accrediti-storico-col-azioni {
  width: 9rem;
}

.accrediti-storico-table thead th {
  position: sticky;
  top: 0;
  padding: 0.5rem;
  z-index: 1;
  background: #f8fafc;
}

.accrediti-storico-table th,
.accrediti-storico-table td {
  padding: 0.9rem 1.25rem;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
}

.accrediti-storico-table th {
  padding: 0;
}

.accrediti-storico-table th:first-child,
.accrediti-storico-table td:first-child {
  text-align: center;
}

.accrediti-storico-table td:nth-child(3) {
  padding-right: 2rem;
}

.accrediti-storico-azioni {
  white-space: nowrap;
  text-align: right;
  padding-left: 1.5rem !important;
}

.accrediti-storico-azioni > div {
  display: inline-flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

@media (max-width: 520px) {
  .accrediti-clienti-panel-header,
  .accrediti-clienti-form {
    padding: 1rem;
  }

  .accrediti-clienti-panel-header {
    flex-direction: column;
    gap: 1rem;
  }

  .accrediti-clienti-panel-header > :is(.fa-table-action, .filter-button) {
    align-self: flex-start;
  }

  .accrediti-clienti-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .accrediti-clienti-submit {
    grid-column: auto;
    justify-content: stretch;
  }

  .accrediti-clienti-submit .fa-table-action {
    width: 100%;
  }

  .accrediti-storico-modal {
    max-height: calc(100vh - 1rem);
  }

  .accrediti-storico-filtri {
    align-items: stretch;
  }}

:is(.carte-gestione-check-row, .metodi-accredito-gestione-check-row) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #1e293b;
  background: #f8fafc;
  transition: background 0.15s;
}

:is(.carte-gestione-check-row, .metodi-accredito-gestione-check-row):hover {
  background: #f1f5f9;
}

:is(.carte-gestione-check-row, .metodi-accredito-gestione-check-row) input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
  cursor: pointer;
}

:is(.metodi-accredito-catalogo-empty-state-inline, .metodi-accredito-gestione-empty-state-inline, .superadmin-dashboard-empty-state-inline) {
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 1rem 0;
}

.form-error {
  color: #ef4444;
  font-size: 0.8125rem;
}

.form-success {
  color: #22c55e;
  font-size: 0.8125rem;
}

/* =========================================================
   Responsive — elementi mobile nascosti per default
   ========================================================= */

.mobile-topbar {
  display: none;
}
.mobile-backdrop {
  display: none;
}

/* =========================================================
   Responsive — Tablet (769px – 1024px)
   Sidebar auto-collassata a icone-only
   ========================================================= */

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 64px;
    min-width: 64px;
  }

  .sidebar--collapsed .sidebar-logo {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar--collapsed .sidebar-logo-text {
    display: none;
  }

  .sidebar--collapsed .nav-item {
    justify-content: center;
    padding: 0.65rem;
    gap: 0;
  }

  .sidebar--collapsed .nav-item span {
    display: none;
  }

  .sidebar--collapsed .nav-item i {
    width: auto;
  }

  .sidebar--collapsed .sidebar-footer {
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 0.5rem;
  }

  .sidebar--collapsed .sidebar-user {
    flex: 0 0 auto;
    padding: 0.35rem 0;
    justify-content: center;
    gap: 0;
  }

  .sidebar--collapsed .user-info {
    display: none;
  }
  .sidebar--collapsed .sidebar-impianto {
    display: none;
  }

  .sidebar:not(.sidebar--collapsed) {
    width: 260px;
    min-width: 260px;
  }

  .sidebar .theme-mode-toggle,
  .sidebar .sidebar-user-settings-icon {
    display: none;
  }

  .sidebar:not(.sidebar--collapsed) .theme-mode-toggle {
    display: grid;
  }

  .sidebar:not(.sidebar--collapsed) .sidebar-user-settings-icon {
    display: inline-block;
  }

  .app-content {
    padding: 1.5rem 2rem;
  }}

/* =========================================================
   Responsive — Mobile (≤ 768px)
   Sidebar come drawer, topbar fissa, contenuto compatto
   ========================================================= */

@media (max-width: 768px) {
  .impersonation-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
  }

  .impersonation-banner__copy {
    flex-wrap: wrap;
  }

  .impersonation-banner__original {
    flex-basis: 100%;
    padding-left: 1.35rem;
  }

  /* --- Sidebar: drawer fisso off-screen --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 260px !important;
    min-width: 260px !important;
    transform: translateX(-260px);
    transition: transform 0.25s ease;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Ripristina stile espanso nel drawer (override --collapsed via CSS) */
  .sidebar .sidebar-logo {
    justify-content: flex-start;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .sidebar .sidebar-logo-text {
    display: block !important;
  }

  .sidebar .nav-item {
    justify-content: flex-start;
    padding: 0.65rem 0.875rem;
    gap: 0.75rem;
  }

  .sidebar .nav-item span {
    display: inline !important;
  }

  .sidebar .nav-item i {
    width: 20px;
  }

  .sidebar .impianto-selector {
    width: auto;
    padding: 0;
  }

  .sidebar .sidebar-footer {
    flex-direction: row;
    align-items: center;
    padding: 1rem 0.75rem;
    gap: 0.5rem;
  }

  .sidebar .sidebar-user {
    flex: 1;
    padding: 0.5rem 0.625rem 0.5rem 0;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .sidebar .user-info {
    display: flex !important;
  }
  .sidebar .sidebar-impianto {
    display: block !important;
  }
  .sidebar-toggle-btn {
    display: none;
  }

  /* Drawer aperto */
  .sidebar--mobile-open {
    transform: translateX(0);
  }

  /* Backdrop scuro */
  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 999;
    animation: modal-fade-in 0.2s ease;
  }

  /* --- Mobile topbar --- */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1rem;
    z-index: 998;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .mobile-hamburger {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background 0.15s;
  }

  .mobile-hamburger:hover {
    background: #f1f5f9;
  }

  .mobile-topbar-logo {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
  }

  .mobile-topbar-logo__label {
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.1;
  }

  .mobile-topbar-logo strong {
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* --- App shell e main --- */
  .app-main {
    padding-top: 56px;
  }
  .app-content {
    padding: 1.25rem 1rem;
  }

  /* --- Tipografia compatta --- */
  :is(.nuovo-conteggio-page-title, .page-heading-page-title) {
    font-size: 1.35rem;
  }
  :is(.nuovo-conteggio-page-subtitle, .page-heading-page-subtitle) {
    font-size: 0.875rem;
  }
  .home-title {
    font-size: 1.35rem;
  }
  .home-subtitle {
    font-size: 0.875rem;
  }
  .home-chart-panel__header {
    padding: 1.1rem 1rem 0.8rem;
  }
  .home-period-picker {
    align-items: stretch;
    flex-direction: row;
    gap: 0.35rem;
  }
  .home-period-picker__field {
    flex: 1;
  }
  .home-chart {
    padding: 0 0.35rem 0.25rem;
  }
  .home-chart-legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 1rem 0.75rem;
  }
  :is(.accrediti-clienti-page-header, .carichi-page-header, .conti-page-header, .gestione-page-header, .giacenze-page-header, .impostazioni-page-header, .nuovo-conteggio-page-header, .report-page-header, .superadmin-dashboard-page-header) {
    margin-bottom: 1.25rem;
  }

  /* --- Form: colonna singola --- */
  :is(.aggiungi-impianto-modal-edit-grid, .clienti-credito-tab-edit-grid, .modifica-impianto-modal-edit-grid, .modifica-utente-modal-edit-grid) {
    grid-template-columns: 1fr !important;
  }

  /* --- Tab nav: scroll orizzontale --- */
  :is(.gestione-tabs, .impostazioni-tab-nav, .nuovo-conteggio-tab-nav, .superadmin-dashboard-tab-nav) {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  :is(.gestione-tabs, .impostazioni-tab-nav, .nuovo-conteggio-tab-nav, .superadmin-dashboard-tab-nav)::-webkit-scrollbar {
    display: none;
  }
  :is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nc2-tab-nav :is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) {
    gap: 0.35rem;
    padding-inline: 0.65rem;
  }

  /* --- Filtri e toolbar --- */
  :is(.conti-filtri-row, .nuovo-conteggio-conti-filtri-row) {
    gap: 1rem;
  }
  .gestione-toolbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }}

/* =========================================================
   Responsive — Small mobile (≤ 480px)
   ========================================================= */

@media (max-width: 480px) {
  .app-content {
    padding: 1rem 0.75rem;
  }
  .home-chart-panel__header {
    align-items: stretch;
    flex-direction: column;
  }
  .home-period-picker {
    width: 100%;
  }
  .home-period-picker__input.rz-datepicker {
    width: 100%;
  }
  .home-chart-tooltip {
    min-width: 170px;
  }}

/* =========================================================
   Utenti: layout mobile
   ========================================================= */
@media (max-width: 767.98px) {
  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table) thead {
    display: none;
  }

  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table),
  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table) tbody,
  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table) tr,
  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table) td {
    display: block;
    width: 100%;
  }

  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table) tr {
    padding: 0.5rem 0;
  }

  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table) td {
    display: grid;
    grid-template-columns: minmax(5rem, 0.35fr) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.55rem 0;
    border: 0;
    text-align: left !important;
  }

  :is(.utenti-settings-inviti-table, .utenti-settings-utenti-table) td::before {
    content: attr(data-label);
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    font-weight: 600;
  }}

/* =========================================================
   Inserimento Operatore
   ========================================================= */
.operator-page {
  max-width: 980px;
  margin: 0 auto;
}

.operator-layout {
  min-height: 100dvh;
  padding: 2rem 1.5rem 6rem;
}

.operator-account {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 3rem);
}

/* Nel layout operatore il selettore azienda sta su fondo chiaro, non sulla sidebar scura. */
.operator-account .azienda-selector__trigger {
  width: min(18rem, calc(100vw - 9rem));
  border-color: #cbd5e1;
  color: #172033;
  background: #fff;
  box-shadow: 0 3px 12px rgb(15 23 42 / 18%);
}

.operator-account .azienda-selector__trigger:hover,
.operator-account .azienda-selector__trigger:focus-visible {
  background: #f1f5f9;
}

/* Il trigger sta a destra di Esci: il menu si allinea al bordo destro per restare nel viewport mobile. */
.operator-account .impianto-selector__menu.azienda-selector__menu {
  left: auto;
  right: anchor(right);
}

.operator-account .impianto-selector__label {
  color: #64748b;
}

html[data-theme="dark"] .operator-account .azienda-selector__trigger {
  border-color: var(--fa-dark-border);
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface);
}

html[data-theme="dark"] .operator-account .azienda-selector__trigger:hover,
html[data-theme="dark"] .operator-account .azienda-selector__trigger:focus-visible {
  background: var(--fa-dark-surface-muted);
}

html[data-theme="dark"] .operator-account .impianto-selector__label {
  color: var(--fa-dark-text-muted);
}

.operator-logout .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 3px 12px rgb(15 23 42 / 18%);
}

.operator-targa-category {
  display: block;
  padding: 0.2rem 0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

html[data-theme="dark"] .operator-targa-category {
  color: #cbd5e1;
}

@media (max-width: 575.98px) {
  .operator-layout {
    padding: 1rem 1rem 5.5rem;
  }

  .operator-account {
    left: 1rem;
    bottom: 1rem;
    max-width: calc(100vw - 2rem);
  }}

.operator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.operator-context {
  margin: 0 0 0.35rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.operator-header h1,
.operator-success h2,
.operator-surface h1 {
  margin: 0;
  color: #172033;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.operator-lede {
  margin: 0.55rem 0 0;
  color: #64748b;
}

.operator-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.operator-status > i {
  color: #176b87;
  font-size: 1rem;
}
.operator-status strong {
  color: #172033;
  font-variant-numeric: tabular-nums;
}

.operator-form,
.operator-success,
.operator-surface {
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  background: #fff;
}

.operator-form {
  padding: 1.5rem;
}
.operator-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 1rem;
}

.operator-field {
  min-width: 0;
}
.operator-field--wide {
  grid-column: span 2;
}
.operator-field label {
  display: block;
  margin-bottom: 0.4rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}
html[data-theme="dark"] .operator-field label {
  color: var(--fa-dark-text-muted);
}
.operator-field label span {
  color: #94a3b8;
  font-weight: 500;
}
.operator-field .form-control,
.operator-field .form-select {
  min-height: 2.7rem;
  border-color: #cbd5e1;
}
.operator-field .form-control:focus,
.operator-field .form-select:focus {
  border-color: #176b87;
  box-shadow: 0 0 0 0.2rem rgba(23, 107, 135, 0.14);
}
.operator-input-prefix {
  position: relative;
}
.operator-input-prefix > span {
  position: absolute;
  top: 50%;
  left: 0.8rem;
  z-index: 1;
  color: #64748b;
  transform: translateY(-50%);
}
.operator-input-prefix .form-control {
  padding-left: 2rem;
}

.operator-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid #e8edf2;
}
.operator-form__footer p {
  margin: 0;
  color: #64748b;
  font-size: 0.82rem;
}
.operator-form__footer p i {
  margin-right: 0.35rem;
  color: #176b87;
}
.operator-submit {
  min-width: 11rem;
}
.operator-submit > * + * {
  margin-left: 0.45rem;
}
.operator-feedback {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.operator-success {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-color: #b8dfcf;
  background: #f6fcf9;
}
.operator-success__mark {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #198754;
  color: #fff;
}
.operator-success__body {
  min-width: 0;
  flex: 1;
}
.operator-success h2 {
  font-size: 1.25rem;
}
.operator-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0 1.35rem;
}
.operator-summary div {
  min-width: 0;
}
.operator-summary dt {
  color: #64748b;
  font-size: 0.76rem;
}
.operator-summary dd {
  margin: 0.18rem 0 0;
  color: #172033;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.operator-surface {
  display: flex;
  gap: 0.9rem;
  padding: 1.5rem;
}
.operator-surface--history {
  padding: 1rem 0;
  display: block;
}
html[data-theme="dark"] .operator-surface--history {
  border-color: var(--fa-dark-border);
  background: var(--fa-dark-surface);
  color: var(--fa-dark-text);
}
.operator-ristampe-table .mud-table-body .mud-table-row:nth-child(even) {
  background-color: #f0f2f4;
}
.operator-ristampe-table .mud-table-body .mud-table-row:nth-child(odd) {
  background-color: #fff;
}
html[data-theme="dark"] .operator-ristampe-table .mud-table-body .mud-table-row:nth-child(even) {
  background-color: var(--fa-dark-surface-muted);
}
html[data-theme="dark"] .operator-ristampe-table .mud-table-body .mud-table-row:nth-child(odd) {
  background-color: var(--fa-dark-surface);
}
html[data-theme="dark"] .mud-popover:has(.mud-picker-container),
html[data-theme="dark"] .mud-picker-container {
  background: var(--fa-dark-surface);
  color: var(--fa-dark-text);
}
.operator-surface > i {
  color: #b02a37;
  font-size: 1.2rem;
}
.operator-surface p {
  margin: 0.45rem 0 0;
  color: #64748b;
}

.operator-print-receipt {
  display: none;
}

.operator-print-brand-logo {
  display: block;
  max-width: 160px;
  max-height: 72px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
}

@media print {
  .sidebar {
    display: none !important;
  }
  .impersonation-banner {
    display: none !important;
  }
  body:has(.operator-layout) nav,
  body:has(.operator-layout) [role="navigation"],
  body:has(.operator-layout) .operator-account {
    display: none;
  }
  body:has(.operator-layout) * {
    visibility: hidden;
  }
  .operator-layout .operator-print-receipt,
  .operator-layout .operator-print-receipt * {
    visibility: visible;
  }
  .operator-layout .operator-print-receipt {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    color: #000;
    background: #fff;
    font-family: "Times New Roman", Times, serif;
  }
  .operator-layout .operator-print-company__address,
  .operator-layout .operator-print-company__detail {
    margin: 0.1rem 0;
    font-size: 8pt;
  }
  .operator-layout .operator-print-receipt__row--product {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .operator-layout .operator-print-receipt__row--product > div:first-child { text-align: left; }
  .operator-layout .operator-print-receipt__row--product > div:last-child { text-align: right; }
  .operator-layout .operator-print-receipt__row--vehicle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .operator-layout .operator-print-receipt__row--vehicle > div:first-child { text-align: left; }
  .operator-layout .operator-print-receipt__row--vehicle > div:last-child { text-align: right; }
  .operator-layout .operator-print-receipt__row--wide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .operator-layout .operator-print-receipt__row--wide > div:nth-child(1) { text-align: left; }
  .operator-layout .operator-print-receipt__row--wide > div:nth-child(2) { text-align: center; }
  .operator-layout .operator-print-receipt__row--wide > div:nth-child(3) { text-align: right; }
  .operator-layout .operator-print-signature {
    margin-top: 1rem;
    text-align: center;
  }
  .operator-layout .operator-print-signature__label { margin: 0 0 0.8rem; }
  .operator-layout .operator-print-signature__line {
    height: 0.55rem;
    border-bottom: 1px dotted #000;
  }
  .operator-layout .operator-print-signature__blank-lines {
    display: grid;
    gap: 1.5mm;
    margin-top: 2mm;
  }
  .operator-layout .operator-print-signature__blank-line {
    height: 5mm;
    border-bottom: 1px dotted #fff;
  }}

@media (max-width: 640px) {
  .operator-header {
    flex-direction: column;
    gap: 1rem;
  }
  .operator-status {
    width: 100%;
  }
  .operator-form {
    padding: 1rem;
  }
  .operator-form__grid {
    grid-template-columns: 1fr;
  }
  .operator-field--wide {
    grid-column: auto;
  }
  .operator-form__footer {
    align-items: stretch;
    flex-direction: column;
  }
  .operator-submit {
    width: 100%;
  }
  .operator-success {
    padding: 1rem;
  }
  .operator-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }}

/* =========================================================
   Tema chiaro/scuro
   ========================================================= */

@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar-controls {
    gap: 0.2rem;
  }

  .sidebar .sidebar-footer-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }}

.vendite-merci-panel,
:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) {
  max-width: 400px;
}

.vendite-merci-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 1.25rem;
}

.vendite-merci-content {
  gap: 3rem;
}

.vendite-merci-content > .vendite-merci-panel {
  flex: 0 1 400px;
  margin: 0;
}

.vendite-merci-content > .vendite-merci-panel--split {
  flex: 1 1 42rem;
  max-width: none;
}

.vendite-merci-panel--split :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) {
  width: 100%;
  max-width: none;
}

.vendite-merci-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.vendite-merci-panel
  :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table)
  .rz-grid-table-striped
  tbody
  > tr.rz-data-row.vendite-merci-total
  > * {
  --bs-table-bg-type: #e0f2fe;
  border-top: 2px solid #0284c7;
  color: #0c4a6e;
  background-color: #e0f2fe;
  font-weight: 700;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table)
  tbody
  > tr:nth-child(odd):not(.vendite-merci-total)
  > * {
  background-color: var(--rz-grid-stripe-odd-background-color, var(--bs-tertiary-bg));
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table)
  tbody
  > tr:nth-child(even):not(.vendite-merci-total)
  > * {
  background-color: var(--rz-grid-stripe-background-color, var(--bs-body-bg));
}

.vendite-merci-panel--split input.form-control {
  min-width: 5rem;
}

@media (max-width: 760px) {
  .vendite-merci-breakdown {
    grid-template-columns: minmax(0, 1fr);
  }}

.vendite-merci-prodotti {
  flex: 1 1 34rem;
  min-width: min(100%, 34rem);
  max-width: 100%;
}

.vendite-merci-prodotti :is(.fortech-vendite-tab-sales, .sumup-sales) {
  min-width: 0;
}

:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) .rz-grid-table {
  table-layout: auto;
}

.merci-new-row .form-select {
  min-width: 10rem;
}

:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) :is(.fortech-vendite-tab-merci-iva-column, .nuova-vendita-merce-riga-merci-iva-column, .sum-up-vendite-tab-merci-iva-column) {
  width: 1%;
  padding-inline: 0.5rem;
  font-size: 0.75rem;
}

.merci-new-row :is(.fortech-vendite-tab-merci-iva-column, .nuova-vendita-merce-riga-merci-iva-column, .sum-up-vendite-tab-merci-iva-column) .form-select {
  width: 7.5rem;
  min-width: 7.5rem;
  padding-left: 0.375rem;
  padding-right: 1.25rem;
  font-size: inherit;
  background-position: right 0.375rem center;
  background-size: 0.65rem 0.5rem;
}

.merci-new-row input.form-control {
  min-width: 6rem;
}

:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) .rz-grid-table thead th:first-child,
:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) .rz-grid-table tbody td:first-child {
  width: 100%;
}

:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) .rz-grid-table thead th:not(:first-child),
:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) .rz-grid-table tbody td:not(:first-child) {
  white-space: nowrap;
}

:is(.fortech-vendite-tab-sales, .sumup-sales) .rz-data-grid .rz-grid-table tbody > tr:is(.fortech-vendite-tab-sales-total, .sumup-sales-total) > * {
  background-color: var(--bs-tertiary-bg);
}

html[data-theme="dark"] :is(.fortech-vendite-tab-sales, .sumup-sales) {
  --rz-grid-stripe-background-color: var(--fa-dark-surface-raised);
  --rz-grid-stripe-odd-background-color: var(--fa-dark-surface);
}

html[data-theme="dark"] :is(.fortech-vendite-tab-sales, .sumup-sales) .rz-data-grid .rz-grid-table tbody > tr:is(.fortech-vendite-tab-sales-total, .sumup-sales-total) > * {
  background-color: var(--fa-dark-surface-muted);
  color: var(--fa-dark-text);
}

:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) .rz-grid-table-striped tbody > tr.rz-data-row.vendite-merci-total > * {
  --bs-table-bg-type: #e0f2fe;
  border-top: 2px solid #0284c7;
  color: #0c4a6e;
  background-color: #e0f2fe;
  font-weight: 700;
}

html[data-theme="dark"] :is(.fortech-vendite-tab-sales-table, .sumup-sales-table) .rz-grid-table-striped tbody > tr.rz-data-row.vendite-merci-total > * {
  --bs-table-bg-type: #12304a;
  border-color: #38bdf8;
  color: #bae6fd;
  background-color: #12304a;
}

@media (max-width: 575.98px) {
  :is(.fortech-vendite-tab-sales, .sumup-sales) .rz-grid-table {
    min-width: 42rem;
  }}

.nuovo-conteggio-selector-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem;
}

.nuovo-conteggio-selector-row > :is(.aggiungi-impianto-modal-edit-field, .clienti-credito-gestione-edit-field, .clienti-credito-tab-edit-field, .conteggio-merci-periodo-edit-field, .conti-edit-field, .giacenze-edit-field, .modifica-impianto-modal-edit-field, .modifica-utente-modal-edit-field, .nuovo-conteggio-edit-field, .operatori-edit-field, .preset-pompe-edit-field, .report-edit-field, .turni-edit-field) {
  flex: 1 1 190px;
  min-width: 0;
}

.nuovo-conteggio-selector-row > .nuovo-conteggio-merci-periodo {
  flex: 2 1 320px;
  min-width: 0;
}

.nuovo-conteggio-selector-row :is(.nuovo-conteggio-dropdown, .operatore-nuovo-conteggio-dropdown) {
  width: 100%;
}

.nuovo-conteggio-merci-periodo__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.nuovo-conteggio-merci-periodo__time {
  display: flex;
  flex: 1 1 8rem;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.nuovo-conteggio-selector-row .nuovo-conteggio-time-picker {
  width: 100%;
  min-width: 0;
}

.nuovo-conteggio-merci-periodo__intera {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  white-space: nowrap;
}

.vendite-merci-panel {
  margin-left: 0.75rem;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.vendite-merci-col-iva {
  width: 50%;
}

.vendite-merci-col-lordo,
.vendite-merci-col-imponibile {
  width: 25%;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) thead th,
:is(.fortech-vendite-tab-sales-table, .sumup-sales-table) thead th {
  padding: 0.55rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tbody td,
:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tbody th {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #cbd5e1;
  vertical-align: middle;
  font-size: 0.85rem;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) .vendite-merci-iva-cell {
  border-right: 1px solid #cbd5e1;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) .vendite-merci-total-label {
  border-right: 1px solid #cbd5e1;
}

html[data-theme="dark"] :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) .vendite-merci-iva-cell {
  border-right-color: var(--fa-dark-border);
}

html[data-theme="dark"] :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) .vendite-merci-total-label {
  border-right-color: var(--fa-dark-border);
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tbody tr:last-child td,
:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tbody tr:last-child th {
  border-bottom: none;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tfoot th,
:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tfoot td {
  padding: 0.45rem 0.5rem;
  border-top: 2px solid #0284c7;
  color: #0c4a6e;
  background: #e0f2fe;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

:is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) input.form-control {
  height: 32px;
  min-height: 32px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 0.4rem;
}

.sidebar--collapsed .sidebar-controls {
  gap: 0.2rem;
  margin-inline: 0.2rem;
}

.sidebar--collapsed .sidebar-footer-actions {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .sidebar .sidebar-footer {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0.75rem;
    gap: 0.75rem;
  }

  .sidebar .sidebar-footer-actions {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }}

html[data-theme="dark"] {
  color-scheme: dark;
  --rz-base-900: var(--mud-palette-background);
  --rz-base-800: var(--mud-palette-surface);
  --rz-base-700: var(--mud-palette-background-gray);
  --rz-base-600: var(--mud-palette-table-striped);
  --rz-base-500: var(--mud-palette-lines-default);
  --rz-base-400: var(--mud-palette-lines-inputs);
  --rz-base-300: #667085;
  --rz-base-200: #8c96a3;
  --rz-base-100: var(--mud-palette-text-secondary);
  --rz-base-50: var(--mud-palette-text-primary);
  --fa-dark-canvas: var(--mud-palette-background);
  --fa-dark-surface: var(--mud-palette-surface);
  --fa-dark-surface-raised: var(--mud-palette-background-gray);
  --fa-dark-surface-muted: var(--mud-palette-table-striped);
  --fa-dark-border: var(--mud-palette-lines-default);
  --fa-dark-border-strong: var(--mud-palette-lines-inputs);
  --fa-dark-text: var(--mud-palette-text-primary);
  --fa-dark-text-muted: var(--mud-palette-text-secondary);
  --bs-body-color: var(--fa-dark-text);
  --bs-body-color-rgb: var(--mud-palette-text-primary-rgb);
  --bs-body-bg: var(--fa-dark-canvas);
  --bs-emphasis-color: #ffffff;
  --bs-secondary-color: var(--fa-dark-text-muted);
  --bs-secondary-color-rgb: var(--mud-palette-text-secondary-rgb);
  --bs-border-color: var(--fa-dark-border);
  --bs-tertiary-bg: var(--fa-dark-surface-raised);
  --rz-base-background-color: var(--fa-dark-surface);
  --rz-panel-background-color: var(--fa-dark-surface);
  --rz-text-color: var(--fa-dark-text);
  --rz-text-secondary-color: var(--fa-dark-text-muted);
  --rz-border-color: var(--fa-dark-border);
  --rz-input-background-color: #14171b;
  --rz-input-border: var(--fa-dark-border-strong);
  scrollbar-color: #59616c var(--fa-dark-canvas);
}

html[data-theme="dark"] .superadmin-utenti-table .superadmin-dashboard-user-name {
  color: var(--fa-dark-text);
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(0 0 0 / 18%), 0 4px 12px rgb(0 0 0 / 8%);
}

.mud-dialog.page-change-confirm-dialog {
  width: min(31.25rem, calc(100vw - 2rem));
  max-width: min(31.25rem, calc(100vw - 2rem));
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-overlay .mud-overlay-scrim {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(3px);
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title .mud-icon-button {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  color: #ef2929;
  background: #f1f4f8;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title .app-dialog-close svg {
  width: 1.5rem;
  height: 1.5rem;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title .mud-icon-button:hover {
  background: #e9eef5;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions > .mud-button-root {
  min-width: 0;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  box-shadow: none;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions > .mud-button-text {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions > .mud-button-filled-primary {
  background: #3b82f6;
  color: #fff;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions > .mud-button-filled-error {
  background: #dc2626;
  color: #fff;
}

html[data-theme="dark"]
  :where(
    :is(.carichi-panel, .giacenze-panel),
    .mud-dialog,
    .home-chart-panel,
    .home-chart-state,
    :is(.accrediti-clienti-table-panel, .carichi-table-panel, .carte-gestione-table-panel, .clienti-credito-gestione-table-panel, .conti-table-panel, .fortech-gestione-table-panel, .gestione-bandiere-loghi-table-panel, .giacenze-table-panel, .metodi-accredito-catalogo-table-panel, .metodi-accredito-gestione-table-panel, .nuovo-conteggio-table-panel, .operatori-table-panel, .pompe-ed-erogatori-table-panel, .preset-pompe-table-panel, .prodotti-merci-gestione-table-panel, .report-share-button-table-panel, .report-table-panel, .rubrica-email-settings-table-panel, .serbatoi-gestione-table-panel, .sum-up-gestione-table-panel, .superadmin-dashboard-table-panel, .turni-table-panel),
    :is(.accrediti-clienti-modal-dialog, .aggiungi-impianto-modal-modal-dialog, .assegna-impianto-modal-modal-dialog, .clienti-credito-gestione-modal-dialog, .clienti-credito-tab-modal-dialog, .conferma-abandono-modal-modal-dialog, .conferma-report-periodo-modal-modal-dialog, .elimina-conteggio-modal-modal-dialog, .elimina-impianto-modal-modal-dialog, .elimina-utente-modal-modal-dialog, .erogatori-tab-modal-dialog, .esito-conteggio-modal-modal-dialog, .info-modal-modal-dialog, .modifica-impianto-modal-modal-dialog, .modifica-utente-modal-modal-dialog, .nav-menu-modal-dialog, .nuovo-conteggio-modal-dialog, .operatore-modal-dialog, .report-modal-dialog, .report-share-button-modal-dialog, .serbatoi-gestione-modal-dialog, .sum-up-connessione-modal-modal-dialog, .sum-up-import-retry-modal-dialog),
    :is(.rubrica-email-settings-settings-users-card, .utenti-settings-settings-users-card, .settings-company-card),
    .settings-card,
    .fortech-payment-card,
    .fortech-terminal-card,
    .buoni-list-item,
    .conti-card,
    .conti-filter-panel,
    .conti-storico-panel,
    .conti-storico-header,
    .filtri-panel,
    :is(.conti-gestione-selector-panel, .nuovo-conteggio-gestione-selector-panel),
    .nc2-header-card,
    .nc2-scroll-area,
    :is(.mancati-pagamenti-tab-panel, .prima-nota-panel),
    .report-panel,
    .accrediti-clienti-panel,
    .fortech-config-panel,
    :is(.clienti-credito-gestione-side-card, .metodi-accredito-catalogo-side-card, .operatori-side-card, .preset-pompe-side-card, .superadmin-dashboard-side-card, .turni-side-card),
    .buoni-add-card,
    .pompa-card,
    :is(.nuovo-conteggio-page-loader-surface, .page-loader-surface),
    .home-chart-tooltip,
    .home-chart-total-tooltip,
    .operator-form,
    .operator-surface,
    :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel),
    :is(.carichi-placeholder-box, .conti-placeholder-box, .erogatori-tab-placeholder-box, .gestione-placeholder-box, .giacenze-placeholder-box, .nuovo-conteggio-placeholder-box, .report-placeholder-box),
    .rz-dialog,
    .rz-popup,
    .rz-dropdown-panel
  ) {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface) !important;
  border-color: var(--fa-dark-border) !important;
}

html[data-theme="dark"]
  :where(
    .giacenze-filters,
    .giacenze-period-badge,
    :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) thead th:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)),
    :is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(even) > td:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)),
    :is(.accept-invite-pw-rules, .register-pw-rules, .reset-password-pw-rules),
    :is(.gestione-bandiere-loghi-page-size-select, .rubrica-email-settings-page-size-select, .superadmin-dashboard-page-size-select),
    :is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .report-share-button-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) thead,
    :is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .report-share-button-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table) tbody tr:hover td,
    .code-chip,
    .role-readonly,
    .role-none,
    :is(.accrediti-clienti-modal-close, .aggiungi-impianto-modal-modal-close, .assegna-impianto-modal-modal-close, .clienti-credito-gestione-modal-close, .clienti-credito-tab-modal-close, .conferma-abandono-modal-modal-close, .conferma-report-periodo-modal-modal-close, .elimina-conteggio-modal-modal-close, .elimina-impianto-modal-modal-close, .elimina-utente-modal-modal-close, .erogatori-tab-modal-close, .modifica-impianto-modal-modal-close, .modifica-utente-modal-modal-close, .nav-menu-modal-close, .nuovo-conteggio-modal-close, .operatore-modal-close, .report-modal-close, .report-share-button-modal-close, .sum-up-connessione-modal-modal-close),
    .assigned-item,
    .ac-item:hover,
    .impianto-item:hover,
    .fortech-section,
    .fortech-terminal-card--ignored,
    .pompa-card-header,
    :is(.pompa-add-card, .serbatoi-gestione-add-card),
    :is(.clienti-credito-gestione-side-header, .metodi-accredito-catalogo-side-header, .operatori-side-header, .preset-pompe-side-header, .superadmin-dashboard-side-header, .turni-side-header),
    :is(.accrediti-storico-base-table, .clienti-credito-gestione-table, .operatori-table, .preset-pompe-table, .turni-table) tbody tr:hover td,
    :is(.clienti-credito-gestione-form-inline, .operatori-form-inline, .preset-pompe-form-inline, .turni-form-inline),
    .conti-pill--addetto,
    .conti-card-edit-body,
    .conti-letture-table th,
    .conti-addetto-check,
    .conti-addetto-check:hover,
    .conti-pompa-check,
    .conti-pompa-check:hover,
    .conti-fixed-top,
    .nc2-chip,
    .nc2-prezzo-item,
    :is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table) thead th,
    .nc2-tfoot-totale td,
    .accrediti-clienti-table th,
    .accrediti-clienti-table tbody tr:hover,
    .accrediti-storico-filtri,
    .accrediti-storico-table thead th,
    :is(.carte-gestione-check-row, .metodi-accredito-gestione-check-row),
    :is(.carte-gestione-check-row, .metodi-accredito-gestione-check-row):hover,
    .operator-status
  ) {
  color: #dce1e7;
  background: transparent !important;
  border-color: #3d444e !important;
}

html[data-theme="dark"]
  :where(
    :is(.carichi-carichi-table, .home-carichi-table) tbody tr:nth-child(odd) > td:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)),
    :is(.gestione-bandiere-loghi-page-btn, .rubrica-email-settings-page-btn, .superadmin-dashboard-page-btn),
    :is(.aggiungi-impianto-modal-btn-modal-cancel, .assegna-impianto-modal-btn-modal-cancel, .clienti-credito-tab-btn-modal-cancel, .conferma-abandono-modal-btn-modal-cancel, .conferma-report-periodo-modal-btn-modal-cancel, .elimina-conteggio-modal-btn-modal-cancel, .elimina-impianto-modal-btn-modal-cancel, .elimina-utente-modal-btn-modal-cancel, .erogatori-tab-btn-modal-cancel, .esito-conteggio-modal-btn-modal-cancel, .info-modal-btn-modal-cancel, .modifica-impianto-modal-btn-modal-cancel, .modifica-utente-modal-btn-modal-cancel, .nav-menu-btn-modal-cancel, .nuovo-conteggio-btn-modal-cancel, .operatore-btn-modal-cancel, .report-share-button-btn-modal-cancel, .serbatoi-gestione-btn-modal-cancel, .sum-up-connessione-modal-btn-modal-cancel, .sum-up-import-retry-btn-modal-cancel),
    .assigned-remove,
    .ac-results,
    .impianto-item,
    :is(.pompa-add-action--secondary, .serbatoi-gestione-add-action--secondary),
    .mobile-topbar
  ) {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface) !important;
  border-color: var(--fa-dark-border) !important;
}

html[data-theme="dark"]
  :where(
    input:not([type="checkbox"]):not([type="radio"]):not(.nc2-prezzo-input--prodotto):not(
        .giacenze-carichi-input
      ),
    textarea,
    select,
    .form-control,
    .form-select,
    :is(.accept-invite-field-input, .forgot-password-field-input, .login-field-input, .register-field-input, .resend-email-confirmation-field-input, .reset-password-field-input),
    :is(.carichi-input, .giacenze-input),
    :is(.accrediti-clienti-edit-input, .aggiungi-impianto-modal-edit-input, .assegna-impianto-modal-edit-input, .clienti-credito-gestione-edit-input, .clienti-credito-tab-edit-input, .erogatori-tab-edit-input, .gestione-bandiere-loghi-edit-input, .metodi-accredito-catalogo-edit-input, .modifica-impianto-modal-edit-input, .modifica-utente-modal-edit-input, .operatori-edit-input, .pompe-ed-erogatori-edit-input, .preset-pompe-edit-input, .rubrica-email-settings-edit-input, .superadmin-dashboard-edit-input, .turni-edit-input),
    .settings-input,
    .nc2-input-lettura,
    .rz-dropdown,
    .rz-datepicker,
    .rz-numeric,
    .rz-inputtext
  ) {
  color: #f4f5f7 !important;
  background-color: #14171b !important;
  border-color: var(--fa-dark-border-strong) !important;
}

html[data-theme="dark"] :where(input, textarea)::placeholder {
  color: #9ba4b0 !important;
  opacity: 1;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) .giacenze-carichi-input {
  color: inherit !important;
  background: transparent !important;
  border-color: color-mix(in srgb, currentColor 38%, #fff) !important;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) .giacenze-carichi-input:focus {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: currentColor !important;
}

html[data-theme="dark"]
  :where(
    :is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .report-share-button-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table),
    :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table),
    .conti-letture-table,
    :is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table),
    .accrediti-clienti-table,
    .accrediti-storico-table,
    .table
  ) {
  --bs-table-bg: transparent;
  --bs-table-color: var(--fa-dark-text);
  --bs-table-border-color: var(--fa-dark-border);
  color: var(--fa-dark-text);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"]
  :where(
    :is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .report-share-button-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table),
    :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table),
    .conti-letture-table,
    :is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table),
    .accrediti-clienti-table,
    .accrediti-storico-table,
    .table
  )
  :where(td, th):not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  color: inherit;
  border-color: var(--fa-dark-border);
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-content {
  padding: 1.25rem 1.5rem;
}

.mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions {
  padding: 0.75rem 1.5rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}

html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog {
  border-color: var(--fa-dark-border);
  background: var(--fa-dark-surface);
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions > .mud-button-text {
  border-color: var(--fa-dark-border);
  background: var(--fa-dark-surface-raised);
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title .mud-icon-button {
  color: #ef4444;
  background: var(--fa-dark-surface-raised);
}

html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title .mud-icon-button:hover {
  background: var(--fa-dark-border);
}

html[data-theme="dark"] .app-action-confirm-message {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .app-action-confirm-warning {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .conferma-abandono-modal-delete-confirm-text {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .conferma-abandono-modal-delete-confirm-warn {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title,
html[data-theme="dark"] .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions {
  border-color: var(--fa-dark-border);
}

@media (max-width: 600px) {
  .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-title,
  .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-content,
  .mud-dialog-container:has(> .fa-app-dialog) > .mud-dialog .mud-dialog-actions {
    padding-inline: 1rem;
  }
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-main {
  color: var(--fa-dark-text);
  background: var(--fa-dark-canvas);
}

html[data-theme="dark"] .app-main :where(h1, h2, h3, h4, h5, h6, label, dt, dd),
html[data-theme="dark"] .app-main th:not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)),
html[data-theme="dark"] :where(.rz-dialog) :where(h1, h2, h3, h4, h5, h6, label, th, dt, dd) {
  color: var(--fa-dark-text);
}

html[data-theme="dark"]
  .app-main
  :where(
    .text-muted,
    :is(.nuovo-conteggio-page-subtitle, .page-heading-page-subtitle),
    .operator-context,
    .operator-lede,
    .operator-form__footer p,
    .operator-summary dt,
    .operator-surface p
  ),
html[data-theme="dark"] :where(.rz-dialog) :where(.text-muted, p) {
  color: var(--fa-dark-text-muted) !important;
}

html[data-theme="dark"]
  :where(
    input:not([type="checkbox"]):not([type="radio"]):not(.nc2-prezzo-input--prodotto):not(
        .giacenze-carichi-input
      ),
    textarea,
    select,
    .form-control,
    .form-select,
    :is(.accept-invite-field-input, .forgot-password-field-input, .login-field-input, .register-field-input, .resend-email-confirmation-field-input, .reset-password-field-input),
    :is(.carichi-input, .giacenze-input),
    :is(.accrediti-clienti-edit-input, .aggiungi-impianto-modal-edit-input, .assegna-impianto-modal-edit-input, .clienti-credito-gestione-edit-input, .clienti-credito-tab-edit-input, .erogatori-tab-edit-input, .gestione-bandiere-loghi-edit-input, .metodi-accredito-catalogo-edit-input, .modifica-impianto-modal-edit-input, .modifica-utente-modal-edit-input, .operatori-edit-input, .pompe-ed-erogatori-edit-input, .preset-pompe-edit-input, .rubrica-email-settings-edit-input, .superadmin-dashboard-edit-input, .turni-edit-input),
    .settings-input,
    .nc2-input-lettura,
    .rz-dropdown,
    .rz-datepicker,
    .rz-numeric,
    .rz-inputtext
  ) {
  color: #f4f5f7 !important;
  background-color: #14171b !important;
  border-color: var(--fa-dark-border-strong) !important;
}

html[data-theme="dark"] :where(input, textarea)::placeholder {
  color: #9ba4b0 !important;
  opacity: 1;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) .giacenze-carichi-input {
  color: inherit !important;
  background: transparent !important;
  border-color: color-mix(in srgb, currentColor 38%, #fff) !important;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) td:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) .giacenze-carichi-input:focus {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: currentColor !important;
}

html[data-theme="dark"]
  :where(
    :is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table),
    :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table),
    .conti-letture-table,
    :is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table),
    .accrediti-clienti-table,
    .accrediti-storico-table,
    .table
  ) {
  --bs-table-bg: transparent;
  --bs-table-color: var(--fa-dark-text);
  --bs-table-border-color: var(--fa-dark-border);
  color: var(--fa-dark-text);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"]
  :where(
    :is(.gestione-bandiere-loghi-data-table, .metodi-accredito-catalogo-data-table, .rubrica-email-settings-data-table, .superadmin-carte-table, .superadmin-circuiti-table, .superadmin-impianti-table, .superadmin-utenti-table),
    :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table),
    .conti-letture-table,
    :is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table),
    .accrediti-clienti-table,
    .accrediti-storico-table,
    .table
  )
  :where(td, th):not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  color: inherit;
  border-color: var(--fa-dark-border);
}

.clienti-credito-gestione-required-note,
.clienti-credito-gestione-localita-status {
  margin: 0.5rem 0 0;
  color: #64748b;
  font-size: 0.6rem;
  line-height: 1.5;
}

.credito-cliente-dialog .clienti-credito-gestione-label {
  color: #334155;
  font-weight: 600;
}

.clienti-credito-gestione-field-note {
  color: #64748b;
  font-size: 0.6rem;
  line-height: 1.5;
}

.clienti-credito-gestione-side-header.mt-3 {
  font-size: 0.6rem;
}

body:has(.credito-cliente-dialog) .rz-dropdown-panel.rz-popup.rz-open {
  overflow: hidden !important;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(15 23 42 / 14%);
}

body:has(.credito-cliente-dialog) .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-items-wrapper {
  max-height: min(14rem, 32vh) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body:has(.credito-cliente-dialog) .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-list {
  max-height: none !important;
  overflow: visible !important;
}

.clienti-credito-tab-targa-dropdown-panel.rz-dropdown-panel.rz-popup.rz-open {
  overflow: hidden !important;
}

.clienti-credito-tab-targa-dropdown-panel.rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-items-wrapper {
  max-height: min(14rem, 32vh) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

.clienti-credito-tab-targa-dropdown-panel.rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-list {
  max-height: none !important;
  overflow: visible !important;
}

body:has(:is(.ct-cc-dropdown, .ct-buono-dropdown, .ct-cb-dropdown)) .rz-dropdown-panel.rz-popup.rz-open {
  overflow: hidden !important;
}

body:has(:is(.ct-cc-dropdown, .ct-buono-dropdown, .ct-cb-dropdown)) .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-items-wrapper {
  max-height: min(14rem, 32vh) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

body:has(:is(.ct-cc-dropdown, .ct-buono-dropdown, .ct-cb-dropdown)) .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-list {
  max-height: none !important;
  overflow: visible !important;
}

html[data-theme="dark"] .clienti-credito-gestione-required-note,
html[data-theme="dark"] .clienti-credito-gestione-localita-status {
  color: #cbd5e1;
}

html[data-theme="dark"] .credito-cliente-dialog .clienti-credito-gestione-label {
  color: #e2e8f0;
}

html[data-theme="dark"] .clienti-credito-gestione-field-note {
  color: #cbd5e1;
}

html[data-theme="dark"] body:has(.credito-cliente-dialog) .rz-dropdown-panel.rz-popup.rz-open {
  background: #1e293b !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] body:has(.credito-cliente-dialog) .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-item {
  color: var(--fa-dark-text) !important;
}

html[data-theme="dark"] body:has(.credito-cliente-dialog) .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-item:hover,
html[data-theme="dark"] body:has(.credito-cliente-dialog) .rz-dropdown-panel.rz-popup.rz-open .rz-state-highlight {
  background: #334155;
}

html[data-theme="dark"] .app-main table {
  color: var(--fa-dark-text);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .giacenze-summary-table .giacenze-carichi-product {
  color: var(--fa-dark-text);
  background-color: var(--fa-dark-surface);
}

html[data-theme="dark"] .app-main table :where(td, th):not(:is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product)) {
  color: inherit;
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .app-main :is(.carichi-table, .giacenze-serbatoi-table, .giacenze-summary-table) :is(.carichi-carichi-product, .giacenze-carichi-product, .home-carichi-product) {
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .gestione-save-bar {
  color: var(--fa-dark-text);
  background: rgba(25, 28, 32, 0.98);
  border-color: var(--fa-dark-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.serbatoi-config {
  overflow: hidden;
}
.serbatoi-list {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.serbatoio-config-item {
  flex: 0 1 350px;
  max-width: 350px;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.serbatoio-add-card {
  flex: 0 1 350px;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type {
  color: #f4f5f7 !important;
  background-color: #14171b !important;
  border-color: var(--fa-dark-border-strong) !important;
  color-scheme: dark;
}

html[data-theme="dark"] :is(.carichi-carichi-table, .home-carichi-table) .giacenze-carichi-type.rz-state-disabled {
  opacity: 1;
}
.serbatoio-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.serbatoio-heading h3 {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
}
.serbatoio-fields {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.serbatoio-fields label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}
.serbatoio-table-scroll {
  height: 360px;
  margin-top: 0.9rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.serbatoio-table-scroll::-webkit-scrollbar:vertical {
  display: none;
}
.serbatoio-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.serbatoio-table th:first-child {
  width: 38%;
}
.serbatoio-table th,
.serbatoio-table td {
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}
.serbatoio-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
}
.serbatoio-table tbody th {
  color: #475569;
  font-size: 0.8rem;
  font-weight: 500;
}
.serbatoio-litri-input {
  max-width: 14rem;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .serbatoi-list {
    padding-inline: 0.85rem;
  }
  .serbatoi-config :is(.carte-gestione-gestione-section-header, .clienti-credito-gestione-gestione-section-header, .fortech-gestione-gestione-section-header, .metodi-accredito-catalogo-gestione-section-header, .metodi-accredito-gestione-gestione-section-header, .operatori-gestione-section-header, .pompe-ed-erogatori-gestione-section-header, .preset-pompe-gestione-section-header, .prodotti-merci-gestione-gestione-section-header, .serbatoi-gestione-gestione-section-header, .turni-gestione-section-header) {
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0.85rem;
  }
  .serbatoi-config .serbatoio-fields {
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    gap: 0.5rem;
  }}

html[data-theme="dark"] .serbatoio-config-item {
  border-color: var(--fa-dark-border);
  background: var(--fa-dark-surface);
}
html[data-theme="dark"] .serbatoio-add-card {
  border-color: var(--fa-dark-border);
  background: var(--fa-dark-surface);
}
html[data-theme="dark"] .serbatoio-table-scroll,
html[data-theme="dark"] .serbatoio-table th,
html[data-theme="dark"] .serbatoio-table td {
  border-color: var(--fa-dark-border);
}
html[data-theme="dark"] .serbatoio-fields label,
html[data-theme="dark"] .serbatoio-table tbody th {
  color: var(--fa-dark-text-muted);
}
html[data-theme="dark"] .serbatoio-table thead th {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface-muted);
}
html[data-theme="dark"] .serbatoio-litri-input,
html[data-theme="dark"] .serbatoio-fields .form-control,
html[data-theme="dark"] .serbatoio-fields .form-select {
  color: var(--fa-dark-text);
  background-color: var(--fa-dark-surface);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .mobile-topbar {
  border-color: var(--fa-dark-border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .mobile-hamburger,
html[data-theme="dark"] .mobile-topbar-logo {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .mobile-hamburger:hover {
  background: var(--fa-dark-surface-muted);
}

html[data-theme="dark"] .home-chart-total > span,
html[data-theme="dark"] .home-chart-total > strong small,
html[data-theme="dark"] .home-chart-panel__header p,
html[data-theme="dark"] .home-chart-legend {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .home-chart-total > strong {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .home-chart__grid {
  stroke: var(--fa-dark-border);
}

html[data-theme="dark"] .home-chart__axis {
  stroke: #77808c;
}

html[data-theme="dark"] .home-chart__y-label,
html[data-theme="dark"] .home-chart__x-label {
  fill: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .home-chart__point {
  stroke: var(--fa-dark-text);
}

html[data-theme="dark"] .home-chart-legend {
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] :where(.rz-dropdown-item, .rz-calendar, .rz-datepicker-calendar, .rz-dialog-content) {
  color: var(--fa-dark-text);
  background-color: var(--fa-dark-surface);
}

html[data-theme="dark"] .role-contabile {
  background: #3b2c57;
  color: #ddd6fe;
}

html[data-theme="dark"] .role-operatore {
  background: #14532d;
  color: #bbf7d0;
}

html[data-theme="dark"] .utente-actions__trigger {
  color: var(--fa-dark-text-muted);
  border-color: var(--fa-dark-border);
  background: var(--fa-dark-surface);
}

html[data-theme="dark"] .utente-actions__impersonate {
  border-color: #6d5ca7;
  color: #ddd6fe;
  background: #30264a;
}

html[data-theme="dark"] .utente-actions__trigger:hover,
html[data-theme="dark"] .utente-actions__trigger[aria-expanded="true"] {
  color: #bfdbfe;
  background: #1e3a5f;
  border-color: #31577c;
}

html[data-theme="dark"] .utente-actions__impersonate:hover {
  border-color: #a78bfa;
  color: #fff;
  background: #6d28d9;
}

html[data-theme="dark"] .utente-actions__menu {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface);
  border-color: var(--fa-dark-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .impianto-selector__menu {
  border-color: var(--fa-dark-border);
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .impianto-selector__option {
  color: var(--fa-dark-text);
}
html[data-theme="dark"] .impianto-selector__option {
  background: var(--fa-dark-surface-muted);
}

html[data-theme="dark"] .pdf-preview-close {
  color: #fca5a5;
}

html[data-theme="dark"] .pdf-preview-close:hover {
  background: #450a0a;
  color: #fecaca;
}

html[data-theme="dark"] .impianto-selector__option:hover,
html[data-theme="dark"] .impianto-selector__option.is-selected {
  border-color: #3b82f6;
  background: #1e3a5f;
}

html[data-theme="dark"] .impianto-selector__current {
  color: #bfdbfe;
}

html[data-theme="dark"] .utente-actions__item {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .utente-actions__item:hover {
  background: var(--fa-dark-surface-muted);
}

/* Storico email dei report */
.report-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.report-history-trigger {
  flex: 0 0 auto;
}

.pdf-preview-header {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
}

.pdf-preview-header > h2 {
  min-width: 0;
}

.pdf-preview-email {
  justify-self: center;
}

.pdf-preview-email .fa-table-action {
  width: 9.5rem;
  justify-content: center;
  white-space: nowrap;
}

.pdf-preview-close {
  justify-self: end;
}

.email-history-dialog {
  max-width: 1080px;
  height: min(78vh, 760px);
}

.email-history-header {
  align-items: center;
  padding: 1rem 1.25rem;
}

.email-history-subtitle {
  margin: 0.15rem 0 0;
  color: #64748b;
  font-size: 0.875rem;
}

.email-history-body {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
}

.email-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eceef0;
}

.email-history-filter-toggle,
.email-history-reset-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid #d7dce1;
  border-radius: 0.45rem;
  background: #fff;
  color: #343a40;
  font-size: 0.85rem;
}

.email-history-filter-toggle:hover,
.email-history-reset-filter:hover,
.email-history-filter-toggle--active {
  background: #f3f5f6;
}

.email-history-filters {
  padding: 0.9rem 1rem 1rem;
  border-bottom: 1px solid #eceef0;
  background: #f8f9fa;
}

.email-history-filter-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr)) auto;
  align-items: end;
  gap: 0.85rem;
}

.email-history-filter-field {
  min-width: 0;
}

.email-history-filter-field label {
  display: block;
  margin-bottom: 0.35rem;
  color: #5f6670;
  font-size: 0.8rem;
  font-weight: 600;
}

.email-history-filter-field .rz-datepicker,
.email-history-filter-field .rz-inputtext {
  width: 100%;
}

body:has(.rz-calendar-month-dropdown[aria-expanded="true"])
    .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-items,
body:has(.rz-calendar-year-dropdown[aria-expanded="true"])
    .rz-dropdown-panel.rz-popup.rz-open .rz-dropdown-items,
body:has(.rz-datepicker-popup-container.rz-open)
    .rz-dropdown-panel.rz-popup.rz-close .rz-dropdown-items {
  overflow: visible !important;
}

.email-history-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.email-history-filter-error {
  margin: 0.65rem 0 0;
  color: #a12622;
  font-size: 0.85rem;
}

.email-history-table-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  padding-inline: 0.5rem;
}

.email-history-skeleton {
  display: flex;
  flex: 1;
  min-height: 0;
}

.email-history-skeleton .email-history-table-scroll,
.email-history-skeleton-table {
  height: 100%;
}

.email-history-skeleton-table tbody {
  height: calc(100% - 42px);
}

.email-history-skeleton-row {
  height: 10%;
}

.email-history-skeleton-row span {
  display: block;
  width: 72%;
  height: 0.8rem;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, #e8ebef 25%, #f3f4f6 50%, #e8ebef 75%);
  background-size: 200% 100%;
  animation: email-history-skeleton-shimmer 1.4s ease-in-out infinite;
}

.email-history-skeleton-row td:nth-child(2) span { width: 4.5rem; }
.email-history-skeleton-row td:last-child span { width: 2.35rem; height: 2.35rem; }

@keyframes email-history-skeleton-shimmer {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .email-history-skeleton-row span { animation: none; }
}

.email-history-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.9rem;
}

.email-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #dfe3e8;
  background: #f8f9fa;
  color: #5f6670;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
}

.email-history-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eceef0;
  color: #252a31;
  vertical-align: middle;
}

.email-history-table th:first-child,
.email-history-table td:first-child { width: 30%; }
.email-history-table th:nth-child(2),
.email-history-table td:nth-child(2) { width: 12%; }
.email-history-table th:nth-child(3),
.email-history-table td:nth-child(3) { width: 34%; }
.email-history-table th:nth-child(4),
.email-history-table td:nth-child(4) { width: 18%; white-space: nowrap; }
.email-history-table th:last-child,
.email-history-table td:last-child { width: 6%; padding-inline: 0.35rem; }

.email-history-recipients,
.email-history-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-history-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.15rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.email-history-status--success { background: #e8f5ed; color: #187344; }
.email-history-status--sent { background: #edf0f2; color: #4b5563; }
.email-history-status--warning { background: #fff4d6; color: #855b00; }
.email-history-status--error { background: #fde9e8; color: #a12622; }

.email-history-open {
  width: 2.35rem;
  min-width: 2.35rem;
  height: 2.35rem;
  padding: 0.55rem;
  justify-content: center;
}

.email-history-filter-actions .fa-table-action--primary {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.email-history-filter-actions .fa-table-action--primary:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}

.email-history-filter-actions .fa-table-action--primary:disabled {
  background: #e2e8f0;
  color: #64748b;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

.email-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #eceef0;
  color: #66717d;
  font-size: 0.8rem;
}

.email-history-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #eceef0;
}

.email-history-pagination-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #66717d;
  font-size: 0.85rem;
}

.email-history-pagination-summary .superadmin-dashboard-page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.email-history-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.email-history-page-button {
  padding: 0.35rem 0.65rem;
  border: 1px solid #d7dce1;
  border-radius: 0.45rem;
  background: #fff;
  color: #343a40;
  font-size: 0.8rem;
}

.email-history-page-button:hover:not(:disabled) { background: #f3f5f6; }
.email-history-page-button:disabled { opacity: 0.45; cursor: not-allowed; }

.email-history-state {
  display: grid;
  flex: 1;
  min-height: 230px;
  place-content: center;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  color: #5f6670;
  text-align: center;
}

.email-history-state p { margin: 0; }

html[data-theme="dark"] .email-history-subtitle { color: #a9b2bd; }
html[data-theme="dark"] .email-history-toolbar,
html[data-theme="dark"] .email-history-filters,
html[data-theme="dark"] .email-history-pagination-bar { border-color: #30343a; }
html[data-theme="dark"] .email-history-filters { background: #1b1e22; }
html[data-theme="dark"] .email-history-filter-toggle,
html[data-theme="dark"] .email-history-reset-filter {
  border-color: #424850;
  background: #1c2024;
  color: #e1e5e9;
}
html[data-theme="dark"] .email-history-filter-toggle:hover,
html[data-theme="dark"] .email-history-reset-filter:hover,
html[data-theme="dark"] .email-history-filter-toggle--active { background: #2a3036; }
html[data-theme="dark"] .email-history-filter-field label,
html[data-theme="dark"] .email-history-pagination-summary { color: #aeb7c1; }
html[data-theme="dark"] .email-history-filter-field .form-control {
  border-color: #424850;
  background: #15181b;
  color: #e2e5e9;
}
html[data-theme="dark"] .email-history-filter-error { color: #ff918b; }
html[data-theme="dark"] .email-history-table th {
  border-color: #30343a;
  background: #1b1e22;
  color: #aeb6c0;
}
html[data-theme="dark"] .email-history-table td {
  border-color: #262a2f;
  color: #e2e5e9;
}
html[data-theme="dark"] .email-history-skeleton-row span {
  background: linear-gradient(90deg, #30343a 25%, #3b4149 50%, #30343a 75%);
  background-size: 200% 100%;
}
html[data-theme="dark"] .email-history-status--success { background: #0d2d1c; color: #6bd397; }
html[data-theme="dark"] .email-history-status--sent { background: #292d32; color: #c1c8d0; }
html[data-theme="dark"] .email-history-status--warning { background: #382d12; color: #f0c85f; }
html[data-theme="dark"] .email-history-status--error { background: #3b1d1d; color: #ff918b; }
html[data-theme="dark"] .email-history-filter-actions .fa-table-action--primary {
  color: #fff;
  background: #2563eb;
  border-color: #3b82f6;
}
html[data-theme="dark"] .email-history-filter-actions .fa-table-action--primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #3b82f6;
}
html[data-theme="dark"] .email-history-filter-actions .fa-table-action--primary:disabled {
  color: var(--fa-dark-text-muted);
  background: var(--fa-dark-surface-muted);
  border-color: var(--fa-dark-border);
}
html[data-theme="dark"] .email-history-pagination { border-color: #30343a; color: #aeb7c1; }
html[data-theme="dark"] .email-history-page-button { border-color: #424850; background: #1c2024; color: #e1e5e9; }
html[data-theme="dark"] .email-history-page-button:hover:not(:disabled) { background: #2a3036; }
html[data-theme="dark"] .email-history-state { color: #b6bec8; }

@media (max-width: 640px) {
  .report-header-row { align-items: flex-start; flex-direction: column; }
  .email-history-dialog { height: min(82vh, 760px); }
  .email-history-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .email-history-filter-actions { grid-column: 1 / -1; }
  .email-history-filter-actions > button { flex: 1; }
  .email-history-pagination-bar { align-items: flex-start; flex-direction: column; }
  .email-history-pagination-summary { width: 100%; justify-content: space-between; }
  .email-history-pagination-controls { align-self: flex-end; }}

@media (max-width: 420px) {
  .email-history-filter-fields { grid-template-columns: minmax(0, 1fr); }
  .email-history-filter-actions { grid-column: auto; }
  .email-history-pagination-summary { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
  .pdf-preview-header { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .pdf-preview-header > h2 { grid-column: 1 / -1; }
  .pdf-preview-email { grid-column: 2; justify-self: center; }
  .pdf-preview-close { grid-column: 3; justify-self: end; }}

html[data-theme="dark"] .utente-actions__item > i {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .utente-actions__item small {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .utente-actions__divider {
  background: var(--fa-dark-border);
}

html[data-theme="dark"] .utente-actions__item--danger,
html[data-theme="dark"] .utente-actions__item--danger > i {
  color: #fca5a5;
}

html[data-theme="dark"] .utente-actions__item--danger:hover {
  background: #3b2024;
}

html[data-theme="dark"]
  :where(.rz-dropdown-item:hover, .rz-dropdown-item.rz-state-hover, .rz-state-highlight) {
  color: #eff6ff;
  background-color: #1e3a5f !important;
}

/* Le sezioni Carte conservano i propri colori identificativi anche nel tema scuro. */
html[data-theme="dark"] :is(.carte-tab-carte-section, .clienti-credito-tab-carte-section) {
  color: #e8edf5;
}

html[data-theme="dark"] .carte-section--petrolifere {
  background: #14232d;
  border-color: #2d566a;
}

html[data-theme="dark"] .carte-section--buoni {
  background: #282315;
  border-color: #67551f;
}

html[data-theme="dark"] .carte-section--clienti-credito {
  background: #211c2d;
  border-color: #514273;
}

html[data-theme="dark"] .carte-section--circuiti {
  background: #15261d;
  border-color: #2e6142;
}

html[data-theme="dark"] :is(.carte-tab-carte-section, .clienti-credito-tab-carte-section) :where(:is(.carte-tab-nc2-prezzo-label, .clienti-credito-tab-nc2-prezzo-label, .mancati-pagamenti-tab-nc2-prezzo-label, .nuovo-conteggio-nc2-prezzo-label, .prima-nota-tab-nc2-prezzo-label, .versamenti-tab-nc2-prezzo-label), td, :is(.carte-tab-carte-section-total, .clienti-credito-tab-carte-section-total)) {
  color: #edf2f7;
}

html[data-theme="dark"] :is(.carte-tab-carte-section, .clienti-credito-tab-carte-section) .text-muted {
  color: #b5c0ce !important;
}

html[data-theme="dark"] :is(.carte-tab-carte-section, .clienti-credito-tab-carte-section) :is(.carte-tab-carte-section-total, .clienti-credito-tab-carte-section-total) {
  border-color: rgba(226, 232, 240, 0.22);
}

html[data-theme="dark"] .versamenti-section-total {
  color: var(--fa-dark-text);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tfoot th,
html[data-theme="dark"] :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) tfoot td {
  color: #bae6fd;
  background: #12304a;
  border-color: #38bdf8;
}

html[data-theme="dark"] :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table) thead th,
html[data-theme="dark"] :is(.fortech-vendite-tab-sales-table, .sumup-sales-table) thead th {
  color: var(--fa-dark-text-muted);
  background: var(--fa-dark-surface-raised);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"]
  .vendite-merci-panel
  :is(.giacenze-vendite-merci-table, .vendite-merci-tab-vendite-merci-table, .vendite-merci-altri-table, .vendite-merci-iva-table, .vendite-merci-tracciati-table)
  .rz-grid-table-striped
  tbody
  > tr.rz-data-row.vendite-merci-total
  > * {
  --bs-table-bg-type: #12304a;
  border-color: #38bdf8;
  color: #bae6fd;
  background-color: #12304a;
}

html[data-theme="dark"] .nuovo-conteggio-merci-periodo :is(.accrediti-clienti-edit-label, .aggiungi-impianto-modal-edit-label, .assegna-impianto-modal-edit-label, .clienti-credito-gestione-edit-label, .clienti-credito-tab-edit-label, .conti-edit-label, .erogatori-tab-edit-label, .giacenze-edit-label, .modifica-impianto-modal-edit-label, .modifica-utente-modal-edit-label, .nuovo-conteggio-edit-label, .operatori-edit-label, .preset-pompe-edit-label, .report-edit-label, .rubrica-email-settings-edit-label, .turni-edit-label) {
  color: var(--fa-dark-text-muted);
}

@media (max-width: 480px) {
  .vendite-merci-layout {
    padding: 0.75rem;
  }

  .vendite-merci-content {
    gap: 1rem;
  }}

html[data-theme="dark"] .conteggio-movimento-valore {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] :is(.mancati-pagamenti-tab-riepilogo, .prima-nota-riepilogo) {
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] :is(.mancati-pagamenti-tab-entrate, .prima-nota-entrate) {
  color: #4ade80;
}

html[data-theme="dark"] :is(.mancati-pagamenti-tab-uscite, .prima-nota-uscite) {
  color: #fb7185;
}

html[data-theme="dark"] :is(.carte-tab-carte-section, .clienti-credito-tab-carte-section) :is(.carte-tab-buoni-table, .carte-tab-credito-table, .carte-tab-petrolifere-table, .clienti-credito-tab-nc2-table, .erogatori-tab-nc2-table, .mancati-pagamenti-tab-nc2-table, .prima-nota-tab-nc2-table, .versamenti-tab-nc2-table) tbody td {
  border-color: rgba(226, 232, 240, 0.18);
}

html[data-theme="dark"] :is(.carte-tab-carte-section, .clienti-credito-tab-carte-section) :where(.rz-dropdown-label, .rz-placeholder) {
  color: #dce5ef !important;
}

html[data-theme="dark"] .operator-status strong,
html[data-theme="dark"] .operator-summary dd,
html[data-theme="dark"] .operator-header h1,
html[data-theme="dark"] .operator-surface h1 {
  color: #eef2f7;
}

html[data-theme="dark"]
  :where(
    .conti-incasso-val,
    :is(.accrediti-clienti-gestione-section-title, .carte-gestione-gestione-section-title, .clienti-credito-gestione-gestione-section-title, .fortech-gestione-gestione-section-title, .metodi-accredito-catalogo-gestione-section-title, .metodi-accredito-gestione-gestione-section-title, .operatori-gestione-section-title, .pompe-ed-erogatori-gestione-section-title, .preset-pompe-gestione-section-title, .prodotti-merci-gestione-gestione-section-title, .serbatoi-gestione-gestione-section-title, .sum-up-gestione-gestione-section-title, .turni-gestione-section-title),
    .buoni-list-name,
    .buoni-add-title,
    .accrediti-clienti-nome
  ) {
  color: var(--fa-dark-text) !important;
}

html[data-theme="dark"]
  :where(
    :is(.accrediti-clienti-gestione-section-sub, .carte-gestione-gestione-section-sub, .clienti-credito-gestione-gestione-section-sub, .fortech-gestione-gestione-section-sub, .metodi-accredito-catalogo-gestione-section-sub, .metodi-accredito-gestione-gestione-section-sub, .operatori-gestione-section-sub, .pompe-ed-erogatori-gestione-section-sub, .preset-pompe-gestione-section-sub, .prodotti-merci-gestione-gestione-section-sub, .serbatoi-gestione-gestione-section-sub, .turni-gestione-section-sub),
    .slot-orario-badge,
    :is(.pompa-add-copy, .serbatoi-gestione-add-copy),
    .btn-add-erogatore,
    .buoni-add-subtitle,
    .fortech-config-empty,
    .accrediti-data,
    .settings-users-heading p
  ) {
  color: var(--fa-dark-text-muted) !important;
}

html[data-theme="dark"] .conti-incasso-val--positive {
  color: #4ade80 !important;
}

html[data-theme="dark"] .conti-incasso-val--negative,
html[data-theme="dark"] .accrediti-saldo--negativo {
  color: #fb7185 !important;
}

html[data-theme="dark"] .accrediti-saldo--positivo {
  color: #4ade80 !important;
}

html[data-theme="dark"] .accrediti-saldo--zero {
  color: var(--fa-dark-text-muted) !important;
}

html[data-theme="dark"] .accrediti-clienti-form {
  background: var(--fa-dark-surface-raised) !important;
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .nc2-prezzo-item > :is(.carte-tab-nc2-prezzo-label, .clienti-credito-tab-nc2-prezzo-label, .mancati-pagamenti-tab-nc2-prezzo-label, .nuovo-conteggio-nc2-prezzo-label, .prima-nota-tab-nc2-prezzo-label, .versamenti-tab-nc2-prezzo-label) {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .nc2-header-toggle:hover {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] :is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn) {
  color: #aeb7c3;
}

html[data-theme="dark"] :is(.gestione-tab-btn, .impostazioni-tab-btn, .nuovo-conteggio-tab-btn, .superadmin-dashboard-tab-btn):hover {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface-raised);
  border-bottom-color: #6b7280;
}

html[data-theme="dark"] :is(.gestione-tab-btn--active, .impostazioni-tab-btn--active, .nuovo-conteggio-tab-btn--active, .superadmin-dashboard-tab-btn--active) {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

html[data-theme="dark"] .fa-table-action--secondary,
html[data-theme="dark"] .gestione-save-bar .fa-table-action--primary {
  color: #ffffff;
  background: #2563eb;
  border-color: #3b82f6;
}

html[data-theme="dark"] .fa-table-action--secondary:hover,
html[data-theme="dark"] .gestione-save-bar .fa-table-action--primary:hover {
  color: #ffffff;
  background: #1d4ed8;
  border-color: #3b82f6;
}

html[data-theme="dark"] .fa-table-action--secondary:disabled,
html[data-theme="dark"] .fa-table-action--secondary:disabled:hover {
  color: #aeb7c3;
  background: var(--fa-dark-surface-muted);
  border-color: var(--fa-dark-border);
  cursor: not-allowed;
  opacity: 1;
}

html[data-theme="dark"] .sumup-merchant-panel .fa-table-action--primary:not(:disabled) {
  color: #ffffff;
  background: #2563eb;
  border-color: #3b82f6;
}

html[data-theme="dark"] .sumup-merchant-panel .fa-table-action--primary:not(:disabled):hover {
  background: #1d4ed8;
  border-color: #3b82f6;
}

html[data-theme="dark"] .sumup-merchant-panel .fa-table-action--primary:disabled {
  color: var(--fa-dark-text-muted);
  background: var(--fa-dark-surface-muted);
  border-color: var(--fa-dark-border);
  cursor: not-allowed;
}

html[data-theme="dark"] .fa-table-action--primary:disabled,
html[data-theme="dark"] .fa-table-action--primary:disabled:hover {
  color: var(--fa-dark-text-muted);
  background: var(--fa-dark-surface-muted);
  border-color: var(--fa-dark-border);
  cursor: not-allowed;
  opacity: 1;
}

html[data-theme="dark"] .sumup-merchant-panel .fa-table-action:focus-visible {
  outline-color: #93c5fd;
}

html[data-theme="dark"] .sumup-file-input:focus-visible + .sumup-file-label {
  outline-color: #93c5fd;
}

html[data-theme="dark"] :where(.btn-outline-primary, .settings-user-actions .btn-outline-primary) {
  color: #60a5fa !important;
  border-color: #60a5fa !important;
}

html[data-theme="dark"] :where(.btn-outline-danger, .settings-user-actions .btn-outline-danger) {
  color: #fb7185 !important;
  border-color: #fb7185 !important;
}

html[data-theme="dark"] .report-panel .fa-table-action--secondary:disabled {
  color: #aeb7c3;
  background: var(--fa-dark-surface-muted);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) :where(:is(.accept-invite-form-header, .forgot-password-confirmation-form-header, .forgot-password-form-header, .login-form-header, .register-confirmation-form-header, .register-form-header, .resend-email-confirmation-form-header, .reset-password-form-header) h2, :is(.accept-invite-field-group, .forgot-password-field-group, .login-field-group, .register-field-group, .resend-email-confirmation-field-group, .reset-password-field-group) label, .remember-label) {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) :where(:is(.accept-invite-form-header, .forgot-password-confirmation-form-header, .forgot-password-form-header, .login-form-header, .register-confirmation-form-header, .register-form-header, .resend-email-confirmation-form-header, .reset-password-form-header) p, :is(.login-link-subtle, .register-confirmation-link-subtle, .resend-email-confirmation-link-subtle), :is(.forgot-password-form-footer, .login-form-footer, .register-form-footer, .resend-email-confirmation-form-footer, .reset-password-form-footer) a) {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) :where(:is(.login-link-subtle, .register-confirmation-link-subtle, .resend-email-confirmation-link-subtle), :is(.forgot-password-form-footer, .login-form-footer, .register-form-footer, .resend-email-confirmation-form-footer, .reset-password-form-footer) a):hover,
html[data-theme="dark"] :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) :is(.accept-invite-eye-btn, .login-eye-btn, .register-eye-btn, .reset-password-eye-btn):hover {
  color: #60a5fa;
}

html[data-theme="dark"] :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) :is(.accept-invite-btn-submit, .forgot-password-btn-submit, .forgot-password-confirmation-btn-submit, .login-btn-submit, .register-btn-submit, .register-confirmation-btn-submit, .resend-email-confirmation-btn-submit, .reset-password-btn-submit) {
  background: #2563eb;
}

html[data-theme="dark"] :is(.accept-invite-form-panel, .confirm-email-form-panel, .forgot-password-confirmation-form-panel, .forgot-password-form-panel, .invalid-password-reset-form-panel, .login-form-panel, .register-confirmation-form-panel, .register-form-panel, .resend-email-confirmation-form-panel, .reset-password-confirmation-form-panel, .reset-password-form-panel) :is(.accept-invite-btn-submit, .forgot-password-btn-submit, .forgot-password-confirmation-btn-submit, .login-btn-submit, .register-btn-submit, .register-confirmation-btn-submit, .resend-email-confirmation-btn-submit, .reset-password-btn-submit):hover {
  background: #1d4ed8;
}

html[data-theme="dark"]
  :where(.fortech-payment-name, .fortech-terminal-name, .fortech-wizard-heading, .fortech-mapping-name, .assigned-nome, .ac-item-name, .impianto-item-nome, .conti-pompa-nome, .conti-filter-header h2, .settings-card-title) {
  color: var(--fa-dark-text);
}

html[data-theme="dark"]
  :where(.fortech-terminal-note, .fortech-wizard-help, .fortech-section-desc, .assigned-detail, .ac-item-addr, .impianto-item-detail, .settings-card-email, .conti-slot-orario, .conti-card-meta, .conti-filter-header p, .conti-pompa-detail, .accrediti-clienti-empty) {
  color: var(--fa-dark-text-muted) !important;
}

html[data-theme="dark"] .fortech-import-overlay {
  background: rgba(16, 18, 20, 0.86);
}

html[data-theme="dark"] .fortech-mapping-row,
html[data-theme="dark"] .fortech-terminal-row {
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .fortech-pump-option {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] :is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill) {
  color: #dce1e7;
  background: var(--fa-dark-surface-muted);
  border-color: var(--fa-dark-border-strong);
}

html[data-theme="dark"] :is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill):has(input:checked) {
  color: #bfdbfe;
  background: #17243a;
  border-color: #3b82f6;
}

html[data-theme="dark"] .fg-pill--ignore:has(input:checked) {
  color: #fecaca;
  background: #2a171a;
  border-color: #ef4444;
}

html[data-theme="dark"] :is(.clienti-credito-pills-fg-pill, .fortech-gestione-fg-pill):has(input:focus-visible) {
  outline-color: #60a5fa;
}

html[data-theme="dark"] :where(.assigned-divider::before, .assigned-divider::after) {
  background: var(--fa-dark-border);
}

html[data-theme="dark"] .impianto-item--on {
  background: #17243a !important;
  border-color: #3b82f6 !important;
}

html[data-theme="dark"] .report-no-conteggi {
  color: #fde68a;
  background: #282315;
  border-color: #67551f;
}

html[data-theme="dark"] .report-action-status {
  color: #bfdbfe;
  background: #17243a;
  border-color: #345b8a;
}

html[data-theme="dark"] .report-action-status--error,
html[data-theme="dark"] :where(.alert-danger, .settings-alert-err) {
  color: #fecaca;
  background: #2a171a;
  border-color: #7f1d1d;
}

html[data-theme="dark"] .alert-warning {
  color: #f5d98c;
  background: #332a17;
  border-color: #8a6d2f;
}

html[data-theme="dark"] :where(.alert-success, .settings-alert-ok) {
  color: #bbf7d0;
  background: #13281d;
  border-color: #21664e;
}

html[data-theme="dark"] .conti-slot-badge {
  color: #bfdbfe;
  background: #17243a;
}

html[data-theme="dark"] .conti-pill--pompa {
  color: #bbf7d0;
  background: #14281c;
}

html[data-theme="dark"] .conti-pill--pompa-primo-preset {
  color: #fca5a5;
  background: #36191a;
}

html[data-theme="dark"] .conti-pill--pompa-secondo-preset {
  color: #fde68a;
  background: #33290f;
}

html[data-theme="dark"] :where(.nc2-differenza-card--pos, .nc2-differenza-mini--pos) {
  color: #86efac;
  background: #13281d;
  border-color: #22c55e;
}

html[data-theme="dark"] :where(.nc2-differenza-card--neg, .nc2-differenza-mini--neg) {
  color: #fda4af;
  background: #2a171a;
  border-color: #ef4444;
}

html[data-theme="dark"] .pompa-toggle {
  color: #dce1e7;
  background: var(--fa-dark-surface-raised);
  border-color: var(--fa-dark-border-strong);
}

html[data-theme="dark"] .pompa-toggle:hover,
html[data-theme="dark"] .pompa-toggle--selected {
  color: #bfdbfe;
  background: #17243a;
  border-color: #3b82f6;
}

@media (max-width: 480px) {
  .carte-petrolifere-container {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.5rem;
  }}

html[data-theme="dark"] .operator-success {
  color: #d1fae5;
  background: #10261f;
  border-color: #21664e;
}

html[data-theme="dark"] .impersonation-banner {
  color: #fed7aa;
  background: #2b1b12;
  border-color: #7c4a22;
}

html[data-theme="dark"] .impersonation-banner__original,
html[data-theme="dark"] .impersonation-banner__action {
  color: #fdba74;
}

html[data-theme="dark"] .impersonation-banner__action {
  border-color: #9a5b28;
}

html[data-theme="dark"] .impersonation-banner__action:hover,
html[data-theme="dark"] .impersonation-banner__action:focus-visible {
  color: #ffedd5;
  background: #4a2816;
  border-color: #c16d2c;
}

html[data-theme="dark"] ::selection {
  color: #eff6ff;
  background: #1d4ed8;
}

@media (prefers-reduced-motion: reduce) {
  .theme-mode-toggle,
  .theme-mode-toggle i,
  html,
  body,
  .app-main {
    transition: none;
  }}

html[data-theme="dark"] .home-chart-filter-toggle {
  color: var(--fa-primary);
}

html[data-theme="dark"] .home-chart-filter-toggle:hover,
html[data-theme="dark"] .home-chart-filter-toggle:focus-visible {
  color: #a8ebe1;
  background: #1e3d3d;
  border-color: #3e706b;
}

html[data-theme="dark"] .home-chart-filters {
  background: #1a282b;
  border-color: var(--fa-border);
}

html[data-theme="dark"] .home-chart-filter-field label {
  color: #b6c9c1;
}

html[data-theme="dark"] .home-chart-empty {
  color: var(--fa-text-muted);
}
.fa-cisterna {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

.fa-cisterna::before {
  display: block;
  width: 100%;
  height: 100%;
  background-color: currentColor;
  content: "";
  -webkit-mask: url("/icons/cisterna.svg") center / contain no-repeat;
  mask: url("/icons/cisterna.svg") center / contain no-repeat;
}

.sidebar .nav-item .fa-cisterna {
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 1.3rem;
  font-size: 1.3rem;
}

.sidebar--collapsed .nav-item .fa-cisterna {
  display: inline-block;
  visibility: visible;
  opacity: 1;
}

.page-heading-icon .fa-cisterna {
  width: 2rem;
  height: 2rem;
  font-size: 2rem;
}

.targhe-section + .targhe-section {
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.targhe-section-title {
  margin: 0 0 0.75rem;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
}

.targhe-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 26rem;
  margin: 0 0 0.85rem;
  padding: 0.15rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #f8fafc;
  color: #64748b;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.targhe-search:focus-within {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 14%);
}

.targhe-search input {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  font-size: 0.88rem;
}

.targhe-search input::placeholder {
  color: #64748b;
  opacity: 1;
}
.targhe-search input::-webkit-search-cancel-button {
  display: none;
}

.targhe-search-clear {
  display: grid;
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: inherit;
}

.targhe-search-clear:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.targhe-no-results {
  padding: 0.35rem 0;
}

.targhe-table-scroll {
  overflow-x: auto;
}

.targhe-saved-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.targhe-saved-table th:nth-child(1),
.targhe-saved-table td:nth-child(1) {
  width: 30%;
}

.targhe-saved-table th:nth-child(2),
.targhe-saved-table td:nth-child(2) {
  width: 42%;
}

.targhe-saved-table th:nth-child(3),
.targhe-saved-table td:nth-child(3) {
  width: 28%;
}

.targhe-saved-table th {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
}

.targhe-saved-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid black;
}

.targhe-saved-table tbody tr:last-child td {
  border-bottom: 0;
}

.targhe-value {
  color: #334155;
  font-size: 0.9rem;
}

.targhe-product {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  color: var(--targhe-product-color, #334155);
  background-color: color-mix(in srgb, var(--targhe-product-color, #64748b) 18%, #fff);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

html[data-theme="dark"] .targhe-product {
  color: #fff;
  background-color: color-mix(in srgb, var(--targhe-product-color, #64748b) 30%, #1f2937);
}

.targhe-plate {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}

.targhe-actions,
.targhe-actions-heading {
  width: 1%;
  text-align: right !important;
  white-space: nowrap;
}

.targhe-actions {
  display: table-cell;
}

.targhe-actions .fa-table-action + .fa-table-action {
  margin-left: 0.4rem;
}

.targhe-edit-field {
  min-width: 10rem;
}

.targhe-empty {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.targhe-add-form {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(12rem, 1.2fr) auto;
  align-items: center;
  gap: 0.65rem;
}

html[data-theme="dark"] .targhe-section + .targhe-section,
html[data-theme="dark"] .targhe-saved-table th,
html[data-theme="dark"] .targhe-saved-table td {
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .targhe-section-title {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .targhe-saved-table th,
html[data-theme="dark"] .targhe-empty {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .targhe-value {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .targhe-search {
  border-color: var(--fa-dark-border);
  background: #111827;
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .targhe-search:focus-within {
  border-color: #60a5fa;
  background: #111827;
  box-shadow: 0 0 0 3px rgb(96 165 250 / 18%);
}

html[data-theme="dark"] .targhe-search input {
  color: var(--fa-dark-text);
}
html[data-theme="dark"] .targhe-search input::placeholder {
  color: var(--fa-dark-text-muted);
}
html[data-theme="dark"] .targhe-search-clear:hover {
  background: #334155;
  color: var(--fa-dark-text);
}

/* Fatturazione clienti a credito */
.fatture-page-header { margin-bottom: 1.25rem; }
.fatture-panel, .fatture-summary {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #dce2e8;
  border-radius: 12px;
  background: #fff;
}
.fatture-panel { margin-bottom: 1rem; }
.fatture-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e7ebef;
}
.fatture-panel-heading h2, .fatture-panel-heading h3, .fatture-summary h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}
.fatture-panel-heading p {
  margin: .35rem 0 0;
  color: #667085;
  font-size: .875rem;
}
.fatture-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.fatture-filters .fatture-filter-fields { width: min(100%, 48rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fatture-cliente-filter { width: 100%; max-width: 17rem; }
.fatture-filters-reset { margin-left: auto; padding: .25rem .4rem; border: 0; background: transparent; color: #24538a; font-size: .78rem; font-weight: 650; cursor: pointer; }
.fatture-filters-reset:hover { text-decoration: underline; text-underline-offset: 2px; }
.fatture-filters-reset:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; border-radius: 3px; }
.fatture-panel-heading--compact { align-items: center; border: 0; padding: 0; margin-bottom: .85rem; }
.fatture-count { color: #667085; font-size: .8rem; white-space: nowrap; }
/* Titolo e sottotitolo usano le classi di sezione di "Situazione clienti": qui si annullano gli override di .fatture-panel-heading. */
.fatture-panel-lead { min-width: 0; }
.fatture-panel-heading .fatture-panel-lead h2 { font-weight: 600; margin: 0 0 .2rem; }
.fatture-panel-heading .fatture-panel-lead p { margin: 0; color: #475569; font-size: .8rem; }
.fatture-pager-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; border-top: 1px solid #e8ebef; }
.fatture-pager-row .mud-table-pagination { flex: 1 1 auto; justify-content: flex-end; }
.fatture-pager-row .mud-table-pagination-toolbar { border-top: 0; }
html[data-theme="dark"] .fatture-pager-row { border-top-color: var(--fa-dark-border); }
.fatture-btn {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem .9rem;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.fatture-btn:focus-visible, .fatture-link-button:focus-visible, .fatture-back-link:focus-visible {
  outline: 3px solid rgb(37 99 235 / 35%);
  outline-offset: 2px;
}
.fatture-btn--primary { color: #fff; background: #17654b; border-color: #17654b; }
.fatture-btn--primary:hover:not(:disabled) { color: #fff; background: #10543d; border-color: #10543d; }
.fatture-btn--secondary { color: #344054; background: #fff; border-color: #cfd6de; }
.fatture-btn--secondary:hover:not(:disabled) { background: #f4f6f8; }
.fatture-btn:disabled { opacity: .52; cursor: not-allowed; }
.fatture-table-scroll { overflow-x: auto; }
.fatture-table { width: 100%; background: transparent; color: #344054; font-size: .875rem; }
table.fatture-table { border-collapse: collapse; }
.fatture-table .mud-table-container { overflow-x: auto; }
.fatture-table th,
.fatture-table .mud-table-head .mud-table-cell { padding: .7rem .65rem; color: #475467; background: #f7f8fa; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.fatture-table td,
.fatture-table .mud-table-body .mud-table-cell { padding: .75rem .65rem; border-bottom: 1px solid #e8ebef; color: #344054; vertical-align: middle; }
.fatture-table th,
.fatture-table .mud-table-cell { text-align: left; }
.fatture-table .fatture-total-header,
.fatture-table .fatture-total-cell { min-width: 8.25rem; text-align: right; white-space: nowrap; }
.fatture-table .fatture-total-header .mud-table-sort-label { justify-content: flex-end; }
.fatture-table .fatture-total-cell { font-variant-numeric: tabular-nums; }
.fatture-table .fatture-no-records { padding: 2rem 1rem; color: #667085; text-align: center; }
.fatture-table tbody tr:last-child td,
.fatture-table .mud-table-body .mud-table-row:last-child .mud-table-cell { border-bottom: 0; }
.fatture-table .fatture-number { color: #172b24; font-weight: 650; white-space: nowrap; }
.fatture-table .mud-table-body .mud-table-row:hover { background: #f7f8fa; }
.fatture-status { display: inline-flex; align-items: center; padding: .25rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.fatture-status--success { color: #17654b; background: #e8f4ee; }
.fatture-status--pending { color: #805b13; background: #fff5d9; }
.fatture-status--error { color: #a4312b; background: #fbeceb; }
.fatture-status-group { display: inline-flex; align-items: center; gap: .3rem; }
.fatture-error-info { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #a4312b; cursor: pointer; }
.fatture-error-info:hover { color: #7f211d; }
.fatture-error-info:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.fatture-rejection-popover { position: fixed; inset: auto; position-area: block-end; width: max-content; max-width: min(22rem, calc(100vw - 2rem)); margin: .4rem 0; padding: .85rem 1rem; border: 1px solid #e8ebef; border-radius: .65rem; background: #fff; color: #344054; box-shadow: 0 .5rem 1.25rem rgb(16 24 40 / 18%); }
.fatture-rejection-popover h3 { margin: 0 0 .35rem; color: #a4312b; font-size: .85rem; font-weight: 650; }
.fatture-rejection-popover p { margin: 0; font-size: .85rem; line-height: 1.45; overflow-wrap: anywhere; }
.fatture-error-row { margin-top: .35rem; color: #a4312b; font-size: .825rem; overflow-wrap: anywhere; }
.fatture-link-button { padding: .2rem .25rem; border: 0; background: transparent; color: #17654b; font-size: .825rem; font-weight: 650; cursor: pointer; }
.fatture-link-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.fatture-link-button:disabled { color: #98a2b3; cursor: wait; }
.fatture-empty { display: flex; align-items: center; gap: 1rem; padding: 2rem 1rem; color: #667085; }
.fatture-empty > i { flex: 0 0 auto; color: #667085; font-size: 1.35rem; }
.fatture-empty h3 { margin: 0 0 .25rem; color: #344054; font-size: .95rem; font-weight: 650; }
.fatture-empty p { margin: 0; font-size: .875rem; }
.fatture-empty .fatture-btn { margin-left: auto; }
.fatture-empty--small { padding: .7rem 0; font-size: .875rem; }
.fatture-sandbox-note, .fatture-environment { display: inline-flex; align-items: center; gap: .45rem; color: #667085; font-size: .8rem; }
.fatture-environment { padding: .4rem .65rem; border: 1px solid #d8e8de; border-radius: 7px; color: #17654b; background: #edf6f0; white-space: nowrap; }
.fatture-sandbox-note { margin: .75rem 0 0; }
.fatture-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem); align-items: start; gap: 1rem; }
.fatture-main-column { min-width: 0; }
.fatture-summary { position: sticky; top: 1rem; }
.fatture-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-bottom: .9rem; border-bottom: 1px solid #e7ebef; }
.fatture-summary-heading > span { color: #17654b; font-size: .75rem; font-weight: 700; }
.fatture-summary dl { margin: 0; }
.fatture-summary dl > div { display: flex; justify-content: space-between; align-items: center;gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #eef0f2; }
.fatture-summary dt { color: #667085; font-size: .8rem; font-weight: 500; }
.fatture-summary dd { margin: 0; color: #344054; font-size: .825rem; text-align: right; }
.fatture-summary-total { font-size: 1rem !important; font-weight: 700; }
.fatture-summary-note { margin: .85rem 0; color: #667085; font-size: .78rem; line-height: 1.5; }
.fatture-confirm { display: flex; align-items: flex-start; gap: .55rem; margin: .9rem 0; color: #344054; font-size: .8rem; line-height: 1.45; }
.fatture-confirm .form-check-input { flex: 0 0 auto; margin-top: .15rem; }
.fatture-form-section { padding: 1rem 0; }
.fatture-form-section + .fatture-form-section { border-top: 1px solid #e7ebef; }
.fatture-form-section h3 { margin: 0 0 .35rem; font-size: .9rem; font-weight: 650; }
.fatture-form-section > p { color: #667085; font-size: .82rem; }
.fatture-selection-actions {
    display: flex;
    gap: .8rem;
    justify-content: end;
    align-items: end;
}
.fatture-lines-table { min-width: 720px; }
.fatture-lines-table th:first-child, .fatture-lines-table td:first-child { width: 2.5rem; text-align: center; }
.fatture-line-unselected td { color: #667085; }
.fatture-table-footnote { margin: .85rem 0 0; color: #667085; font-size: .78rem; line-height: 1.35; }
.fatture-codici-grid { display: grid; gap: .7rem; }
.fatture-code-row { display: grid; grid-template-columns: minmax(9rem, .6fr) minmax(13rem, 1.4fr); align-items: center; gap: .8rem; }
.fatture-code-row .form-label { margin: 0; font-size: .85rem; }
.fatture-back-link { display: inline-flex; align-items: center; gap: .4rem; margin: .65rem 0 0 .3rem; color: #17654b; font-size: .82rem; text-decoration: none; }
.fatture-back-link span { text-decoration: none; }
.fatture-back-link:hover span { text-decoration: underline; text-underline-offset: 3px; }
.fattura-preview-modal { display: flex; width: min(96vw, 1160px); max-width: 96vw; height: 95vh; max-height: 95vh; flex-direction: column; }
.nota-credito-modal { width: min(100%, 34rem); }
.fattura-preview-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; }
.fattura-preview-header > h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fattura-download-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.fattura-file-download { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; white-space: nowrap; }
.fattura-preview-action { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.fattura-preview-body { min-height: 0; overflow: auto; padding: clamp(1rem, 4vw, 3rem) !important; background: #f1f3f5; }
.fattura-documento { width: min(100%, 960px); margin: 0 auto; padding: clamp(1.25rem, 4vw, 3rem); border: 1px solid #dce2e8; border-radius: 8px; background: #fff; color: #263238; box-shadow: 0 8px 24px rgb(22 34 51 / 8%); }
.fattura-documento-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.5rem; border-bottom: 1px solid #dce2e8; }
.fattura-documento-title > div > span { color: #667085; font-size: .78rem; }
.fattura-documento-title h3 { margin: .25rem 0 0; font-size: 1.5rem; font-weight: 700; }
.fattura-documento-title dl { display: grid; grid-template-columns: auto auto; gap: .35rem 1rem; margin: 0; font-size: .85rem; }
.fattura-documento-title dt { color: #667085; font-weight: 500; }
.fattura-documento-title dd { margin: 0; font-weight: 650; }
.fattura-soggetti { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; padding: 1.5rem 0; }
.fattura-soggetti section { min-width: 0; }
.fattura-soggetti h4 { margin: 0 0 .65rem; color: #667085; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fattura-soggetti strong { display: block; margin-bottom: .35rem; font-size: .95rem; }
.fattura-soggetti p { margin: .15rem 0; color: #475467; font-size: .85rem; overflow-wrap: anywhere; }
.fattura-righe-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.fattura-righe-table th { padding: .7rem .5rem; border-top: 1px solid #dce2e8; border-bottom: 1px solid #dce2e8; color: #475467; font-size: .72rem; font-weight: 650; text-align: left; white-space: nowrap; }
.fattura-righe-table td { padding: .75rem .5rem; border-bottom: 1px solid #e8ebef; vertical-align: top; }
.fattura-documento-totale { display: flex; justify-content: flex-end; align-items: baseline; gap: 1.5rem; padding-top: 1rem; font-size: .9rem; }
.fattura-documento-totale strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .fatture-panel,
html[data-theme="dark"] .fatture-summary { border-color: var(--fa-dark-border); background: var(--fa-dark-surface); }
html[data-theme="dark"] .fatture-panel-heading,
html[data-theme="dark"] .fatture-summary-heading,
html[data-theme="dark"] .fatture-form-section + .fatture-form-section { border-color: var(--fa-dark-border); }
html[data-theme="dark"] .fatture-panel-heading p,
html[data-theme="dark"] .fatture-count,
html[data-theme="dark"] .fatture-sandbox-note,
html[data-theme="dark"] .fatture-summary-note,
html[data-theme="dark"] .fatture-table-footnote,
html[data-theme="dark"] .fatture-empty,
html[data-theme="dark"] .fatture-empty p,
html[data-theme="dark"] .fatture-form-section > p { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .fatture-table { color: var(--fa-dark-text); }
html[data-theme="dark"] .fatture-table th,
html[data-theme="dark"] .fatture-table .mud-table-head .mud-table-cell { color: var(--fa-dark-text-muted); background: var(--fa-dark-surface-raised); }
html[data-theme="dark"] .fatture-table .fatture-no-records { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .fatture-filters-reset { color: #9ec5fe; }
html[data-theme="dark"] .fatture-filters-reset:focus-visible { outline-color: #9ec5fe; }
html[data-theme="dark"] .fatture-table td,
html[data-theme="dark"] .fatture-table .mud-table-body .mud-table-cell,
html[data-theme="dark"] .fatture-summary dd,
html[data-theme="dark"] .fatture-confirm { color: var(--fa-dark-text); border-color: var(--fa-dark-border); }
html[data-theme="dark"] .fatture-table .fatture-number,
html[data-theme="dark"] .fatture-empty h3,
html[data-theme="dark"] .fatture-form-section h3 { color: var(--fa-dark-text); }
html[data-theme="dark"] .fatture-table .mud-table-body .mud-table-row:hover { background: var(--fa-dark-surface-raised); }
html[data-theme="dark"] .fatture-error-row { color: #ffb4ad; }
html[data-theme="dark"] .fatture-summary dt { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .fatture-line-unselected td { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .fatture-btn--secondary { color: var(--fa-dark-text); border-color: var(--fa-dark-border-strong); background: var(--fa-dark-surface-raised); }
html[data-theme="dark"] .fatture-btn--secondary:hover:not(:disabled) { background: var(--fa-dark-surface-muted); }
html[data-theme="dark"] .fatture-status--success { color: #a7e1c2; background: #193d2c; }
html[data-theme="dark"] .fatture-status--pending { color: #f4d78d; background: #443716; }
html[data-theme="dark"] .fatture-status--error { color: #ffb4ad; background: #492321; }
html[data-theme="dark"] .fatture-error-info { color: #ffb4ad; }
html[data-theme="dark"] .fatture-error-info:hover { color: #ffd2ce; }
html[data-theme="dark"] .fatture-rejection-popover { border-color: var(--fa-dark-border); background: var(--fa-dark-surface-raised); color: var(--fa-dark-text); }
html[data-theme="dark"] .fatture-rejection-popover h3 { color: #ffb4ad; }
html[data-theme="dark"] .fatture-environment { color: #a7e1c2; border-color: #315641; background: #193d2c; }
html[data-theme="dark"] .fatture-btn--primary { color: #fff; background: #16704f; border-color: #16704f; }

/* Storico fatture: documento, data e stato restano distinguibili a colpo d'occhio. */
.fatture-table-skeleton table { width: 100%; min-width: 720px; border-collapse: collapse; }
.fatture-table-skeleton th { padding: .7rem .5rem; border-bottom: 1px solid #e7ebef; color: #667085; font-size: .75rem; text-align: left; white-space: nowrap; }
.fatture-table-skeleton td { height: 3.35rem; padding: .65rem .5rem; border-bottom: 1px solid #eef0f2; }
.fatture-table-skeleton .skel { display: block; }
.fatture-skeleton-action { width: 2.25rem; height: 2rem; }
html[data-theme="dark"] .fatture-table-skeleton th { border-color: var(--fa-dark-border); color: var(--fa-dark-text-muted); background: var(--fa-dark-surface-raised); }
html[data-theme="dark"] .fatture-table-skeleton td { border-color: var(--fa-dark-border); }
html[data-theme="dark"] .fatture-table-skeleton .skel { background: linear-gradient(90deg, #30363d 25%, #3b424a 50%, #30363d 75%); background-size: 200% 100%; }
.fatture-table .fatture-issue-date { min-width: 9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fatture-issue-date small { display: block; margin-top: .2rem; color: #667085; font-size: .72rem; white-space: normal; }
.fatture-type-pill { display: inline-flex; align-items: center; max-width: 9rem; padding: .28rem .55rem; border: 1px solid transparent; border-radius: 999px; font-size: .72rem; font-weight: 650; line-height: 1.2; white-space: normal; }
.fatture-type-pill--invoice { color: #344054; border-color: #d7dde5; background: #f2f4f7; }
.fatture-type-pill--deferred { color: #155b76; border-color: #b9dce9; background: #e8f5fa; }
.fatture-type-pill--credit { color: #17654b; border-color: #b8ddc8; background: #e8f4ee; }
.fatture-type-pill--debit { color: #8b4a12; border-color: #efd2ae; background: #fff3e4; }
.fatture-table .fatture-actions-header,
.fatture-table .fatture-actions-cell { width: 4.5rem; min-width: 4.5rem; text-align: center; }
.fatture-actions-menu { justify-content: end; }
.fatture-table-scroll:has(.utente-actions__menu) { overflow: visible; }
.fatture-table:has(.utente-actions__menu) .mud-table-container { overflow: visible !important; }
.fatture-table .fatture-status { max-width: 10rem; white-space: normal; line-height: 1.25; }
.fatture-status-note, .fatture-provider-reference { display: block; margin-top: .25rem; color: #667085; font-size: .7rem; line-height: 1.3; overflow-wrap: anywhere; }
.fatture-table .mud-table-head .mud-table-cell { padding-inline: .5rem; }
/* L'header sticky resta sopra i trigger azioni (z-index 2); il bordo inferiore è un'ombra perché segue lo sticky. */
.fatture-table.mud-table-sticky-header .mud-table-head .mud-table-cell { z-index: 3; border-bottom: 0; box-shadow: inset 0 -1px 0 #e8ebef; }
html[data-theme="dark"] .fatture-table.mud-table-sticky-header .mud-table-head .mud-table-cell { box-shadow: inset 0 -1px 0 var(--fa-dark-border); }
@media (max-width: 1100px) {
  .fatture-table { font-size: .82rem; }
  .fatture-table td, .fatture-table .mud-table-body .mud-table-cell { padding: .65rem .45rem; }
  .fatture-table .fatture-issue-date { min-width: 7.5rem; }}
@media (max-width: 767.98px) {
  /* Mantiene raggiungibile la colonna azioni quando la tabella richiede scroll orizzontale. */
  .fatture-table:has(.utente-actions__menu) .mud-table-container { overflow-x: auto !important; }}
html[data-theme="dark"] .fatture-issue-date small { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .fatture-status-note, html[data-theme="dark"] .fatture-provider-reference { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .fatture-type-pill--invoice { color: var(--fa-dark-text); border-color: var(--fa-dark-border-strong); background: var(--fa-dark-surface-muted); }
html[data-theme="dark"] .fatture-type-pill--deferred { color: #b9e4f1; border-color: #315563; background: #1b3943; }
html[data-theme="dark"] .fatture-type-pill--credit { color: #a7e1c2; border-color: #315641; background: #193d2c; }
html[data-theme="dark"] .fatture-type-pill--debit { color: #f4d0a6; border-color: #65451f; background: #402f1a; }
html[data-theme="dark"] .fatture-btn--primary:hover:not(:disabled) { background: #1b805b; }
html[data-theme="dark"] .fatture-link-button,
html[data-theme="dark"] .fatture-back-link { color: #a7e1c2; }
html[data-theme="dark"] .fatture-form-section .form-control,
html[data-theme="dark"] .fatture-form-section .form-select { color: var(--fa-dark-text); border-color: var(--fa-dark-border-strong); background-color: #14171b; }
html[data-theme="dark"] .fatture-form-section .form-control::placeholder { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .nota-credito-modal .form-control { color: var(--fa-dark-text); border-color: var(--fa-dark-border-strong); background-color: #14171b; }
html[data-theme="dark"] .nota-credito-modal .form-text { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .fatture-lines-table .form-check-input,
html[data-theme="dark"] .fatture-confirm .form-check-input { border-color: var(--fa-dark-border-strong); background-color: #14171b; }
html[data-theme="dark"] .fatture-lines-table .form-check-input:checked,
html[data-theme="dark"] .fatture-confirm .form-check-input:checked { border-color: #16704f; background-color: #16704f; }
html[data-theme="dark"] .fattura-preview-body { background: var(--fa-dark-surface-raised); }
html[data-theme="dark"] .fattura-documento { border-color: var(--fa-dark-border); background: var(--fa-dark-surface); color: var(--fa-dark-text); box-shadow: 0 8px 24px rgb(0 0 0 / 24%); }
html[data-theme="dark"] .fattura-documento-title,
html[data-theme="dark"] .fattura-righe-table th,
html[data-theme="dark"] .fattura-righe-table td { border-color: var(--fa-dark-border); }
html[data-theme="dark"] .fattura-documento-title > div > span,
html[data-theme="dark"] .fattura-documento-title dt,
html[data-theme="dark"] .fattura-soggetti h4,
html[data-theme="dark"] .fattura-soggetti p,
html[data-theme="dark"] .fattura-righe-table th { color: var(--fa-dark-text-muted); }
@media (max-width: 640px) {
  .fatture-panel-heading:has(> .fatture-panel-lead) { flex-direction: column; }
  .fatture-panel-actions { justify-content: flex-start; }
  .fatture-filters .fatture-filter-fields { grid-template-columns: 1fr; }
  .fattura-preview-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .fattura-preview-header { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; padding: .75rem; }
  .fattura-preview-header > h2 { grid-column: 1 / -1; flex: 1 1 0; }
  .fattura-download-actions { gap: .4rem; flex: 1 1 100%; order: 1; }
  .fattura-preview-header .fa-table-action { width: max-content; min-height: 2.5rem; padding: .4rem .65rem; font-size: .82rem; }
  .fattura-documento-title { flex-direction: column; }
  .fattura-documento-title h3 { font-size: 1.25rem; overflow-wrap: anywhere; }
  .fattura-documento-title dl { grid-template-columns: auto 1fr; }
  .fattura-soggetti { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .fattura-righe-table { min-width: 760px; }
  .fattura-documento-totale { justify-content: space-between; gap: .75rem; font-size: .82rem; }
  .fattura-documento-totale strong { font-size: 1rem; white-space: nowrap; }}
@media (max-width: 1200px) {
  .fatture-workspace { grid-template-columns: minmax(0, 1fr); }
  .fatture-main-column, .fatture-summary { width: 100%; }
  .fatture-summary { position: static; }}
@media (max-width: 575.98px) {
  .fatture-panel, .fatture-summary { padding: 1rem; }
  .fatture-empty { align-items: flex-start; flex-wrap: wrap; }
  .fatture-empty .fatture-btn { margin-left: 0; }
  .fatture-panel-heading--compact { align-items: flex-start; flex-direction: column; }
  .fatture-code-row { grid-template-columns: 1fr; gap: .35rem; }
  .fatture-sandbox-note { align-items: flex-start; }}

@media (max-width: 575.98px) {
  .targhe-add-form {
    grid-template-columns: 1fr;
  }

  .targhe-add-form .fa-table-action {
    justify-content: center;
  }

  .targhe-saved-table th,
  .targhe-saved-table td {
    padding-right: 0.4rem;
    padding-left: 0.4rem;
  }

  .targhe-edit-field {
    min-width: 0;
    width: 100%;
  }}

.report-email-table tbody tr:not(:has(.report-share-button-td-empty)),
.report-email-table tbody tr:not(:has(.report-share-button-td-empty)) * {
  cursor: pointer;
}

.report-email-table .rz-grid-table tbody > tr > td {
  padding: 0.875rem 1rem;
}

@media (hover: hover) {
  .report-email-table .rz-grid-table tbody > tr:not(.is-selected):hover > td {
    background: #f1f5f9;
  }

  .report-email-table .rz-grid-table tbody > tr.is-selected:hover > td {
    background: #bfdbfe;
  }
}

.report-email-table tbody tr.is-selected td {
  --bs-table-bg: #dbeafe;
  background: #dbeafe;
}

.report-email-editor .rz-textbox,
.report-email-editor .rz-textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  color: #212529;
  background: #fff;
}

.report-email-editor .rz-textarea {
  min-height: 10rem;
  resize: vertical;
}

.report-email-editor .rz-textbox:focus,
.report-email-editor .rz-textarea:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgb(13 110 253 / 25%);
}

html[data-theme="dark"] .report-email-table tbody tr.is-selected td {
  --bs-table-bg: #1e3a5f;
  background: #1e3a5f;
}

@media (hover: hover) {
  html[data-theme="dark"] .report-email-table .rz-grid-table tbody > tr:not(.is-selected):hover > td {
    background: #252e3a;
  }

  html[data-theme="dark"] .report-email-table .rz-grid-table tbody > tr.is-selected:hover > td {
    background: #294969;
  }
}

.report-email-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.5rem;
}

.report-email-page {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  background: #fff;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}

.report-email-page > input {
  margin: 0;
  cursor: pointer;
}

.report-email-page.is-selected {
  border-color: #93c5fd;
  background: #dbeafe;
}

.report-email-page:has(input:focus-visible) {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

@media (hover: hover) {
  .report-email-page:not(.is-selected):hover { background: #f1f5f9; }
  .report-email-page.is-selected:hover { background: #bfdbfe; }
}

html[data-theme="dark"] .report-email-page {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .report-email-page.is-selected {
  border-color: #3b6ea5;
  background: #1e3a5f;
}

@media (hover: hover) {
  html[data-theme="dark"] .report-email-page:not(.is-selected):hover { background: #252e3a; }
  html[data-theme="dark"] .report-email-page.is-selected:hover { background: #294969; }
}

html[data-theme="dark"] .report-email-editor .rz-textbox,
html[data-theme="dark"] .report-email-editor .rz-textarea {
  color: var(--fa-dark-text);
  background: var(--fa-dark-surface);
  border-color: var(--fa-dark-border);
}

/* Preset pompe: una sola area di lavoro, con selezione leggibile anche su impianti grandi. */
.preset-pompe-workspace {
  display: grid;
  gap: 1.25rem;
}
.preset-pompe-create-disclosure { padding: 0; }
.preset-pompe-create-disclosure .preset-pompe-gestione-section-header { gap: 0.75rem; }
.preset-pompe-create-disclosure .preset-pompe-gestione-section-header > button { margin-left: auto; }
.preset-pompe-list { padding: 0 1.5rem 1.5rem; }
.preset-pompe-create {
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
}
.preset-pompe-create-heading,
.preset-pompe-list-heading,
.preset-pompe-selection-heading,
.preset-pompe-create-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.preset-pompe-create-heading { margin-bottom: 1.1rem; }
.preset-pompe-create-heading h3,
.preset-pompe-list-heading h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 650;
}
.preset-pompe-create-heading p {
  margin: 0.25rem 0 0;
  color: #475569;
  font-size: 0.875rem;
}
.preset-pompe-create-fields {
  display: grid;
  grid-template-columns: minmax(13rem, 0.7fr) minmax(0, 2fr);
  align-items: start;
  gap: 1.25rem;
}
.preset-pompe-name-field { max-width: 28rem; }
.preset-pompe-selection-heading { min-height: 2rem; margin-bottom: 0.5rem; }
.preset-pompe-selection-heading .preset-pompe-req { margin-inline-start: 0.2rem; }
.preset-pompe-selector { min-width: 0; }
.preset-pompe-selection-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #475569;
  font-size: 0.8rem;
}
.preset-pompe-selection-tools button {
  padding: 0.25rem 0.1rem;
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.preset-pompe-selection-tools button:disabled { color: #94a3b8; cursor: default; }
.preset-pompe-selection-tools button:focus-visible,
.preset-pompe-option:focus-within { outline: 2px solid #2563eb; outline-offset: 2px; }
.preset-pompe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.preset-pompe-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid #dbe3ee;
  border-radius: 7px;
  background: #fff;
  color: #1e293b;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.preset-pompe-option:hover { border-color: #93b4ec; background: #f4f8ff; }
.preset-pompe-option:has(input:checked) { border-color: #7da6ef; background: #edf4ff; color: #173b78; }
.preset-pompe-option input { width: 1rem; height: 1rem; margin: 0; accent-color: #2563eb; flex: 0 0 auto; }
.preset-pompe-no-pumps { margin: 0; color: #475569; font-size: 0.875rem; }
.preset-pompe-create-footer {
  margin-top: 1rem;
  justify-content: flex-end !important;
  padding-top: 0.9rem;
  border-top: 1px solid #dbe3ee;
}
.preset-pompe-create-footer > span,
.preset-pompe-list-heading > span { color: #475569; font-size: 0.8rem; }
.preset-pompe-list-heading { margin-bottom: 0.4rem; }
.preset-pompe-table thead th { text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
.preset-pompe-table tbody tr { border-bottom-color: #e8edf4; }
.preset-pompe-table tbody tr:hover td { background: #f8fafc; }
.preset-pompe-td-nome:first-child { width: 12rem; font-weight: 600 !important; }
.preset-pompe-td-nome:nth-child(2) { line-height: 1.7; }
.preset-pompe-edit-pumps { flex: 1 1 100%; min-width: 0; }
.preset-pompe-form-inline .preset-pompe-grid { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }

html[data-theme="dark"] .preset-pompe-create {
  background: var(--fa-dark-surface-raised);
  border-color: var(--fa-dark-border);
}
html[data-theme="dark"] .preset-pompe-create-heading h3,
html[data-theme="dark"] .preset-pompe-list-heading h3,
html[data-theme="dark"] .preset-pompe-option,
html[data-theme="dark"] .preset-pompe-selection-heading .preset-pompe-edit-label { color: var(--fa-dark-text); }
html[data-theme="dark"] .preset-pompe-create-heading p,
html[data-theme="dark"] .preset-pompe-selection-tools,
html[data-theme="dark"] .preset-pompe-create-footer > span,
html[data-theme="dark"] .preset-pompe-list-heading > span,
html[data-theme="dark"] .preset-pompe-no-pumps { color: var(--fa-dark-text-muted); }
html[data-theme="dark"] .preset-pompe-selection-tools button { color: #9fc1ff; }
html[data-theme="dark"] .preset-pompe-selection-tools button:disabled { color: #697586; }
html[data-theme="dark"] .preset-pompe-option { background: var(--fa-dark-surface); border-color: var(--fa-dark-border-strong); }
html[data-theme="dark"] .preset-pompe-option:hover { background: #202a38; border-color: #5276ad; }
html[data-theme="dark"] .preset-pompe-option:has(input:checked) { color: #dbeafe; background: #1c2b43; border-color: #5276ad; }
html[data-theme="dark"] .preset-pompe-create-footer { border-color: var(--fa-dark-border); }
html[data-theme="dark"] .preset-pompe-table tbody tr { border-color: var(--fa-dark-border); }
html[data-theme="dark"] .preset-pompe-table tbody tr:hover td { background: var(--fa-dark-surface-raised); }

@media (max-width: 760px) {
  .preset-pompe-create-disclosure .preset-pompe-gestione-section-header { flex-wrap: wrap; }
  .preset-pompe-list { padding: 0 1rem 1rem; }
  .preset-pompe-create { padding: 1rem; }
  .preset-pompe-create-fields { grid-template-columns: 1fr; }
  .preset-pompe-name-field { max-width: none; }
  .preset-pompe-selection-heading,
  .preset-pompe-create-footer { align-items: flex-start; flex-direction: column; }
  .preset-pompe-selection-tools { flex-wrap: wrap; }
  .preset-pompe-grid { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
  .preset-pompe-create-footer .fa-table-action { width: 100%; justify-content: center; }
  .preset-pompe-table,
  .preset-pompe-table tbody { display: block; width: 100%; }
  .preset-pompe-table thead { display: none; }
  .preset-pompe-table tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.2rem 0.65rem;
    padding: 0.75rem 0;
  }
  .preset-pompe-table tbody > tr[style*="display:none"] { display: none !important; }
  .preset-pompe-table tbody > tr > td { display: block; width: auto; min-width: 0; padding: 0.15rem 0; }
  .preset-pompe-table tbody > tr > td[colspan="3"] { grid-column: 1 / -1; }
  .preset-pompe-td-nome:first-child { grid-column: 1; width: auto; }
  .preset-pompe-td-nome:nth-child(2) { grid-column: 1; overflow-wrap: anywhere; }
  .preset-pompe-table tbody > tr > .preset-pompe-td-azioni {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 3;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-top: 0.35rem;
  }
}

/* Colore dei giorni selezionati nei Radzen date picker. */
.rz-calendar {
  --rz-datepicker-calendar-selected-color: #fff;
  --rz-datepicker-calendar-selected-background-color: #2563eb;
  --rz-datepicker-calendar-selected-hover-color: #fff;
  --rz-datepicker-calendar-selected-hover-background-color: #1d4ed8;
}

/* Il pulsante di conferma dei Radzen time picker usa il blu primario del sito. */
.rz-timepicker .rz-button.rz-secondary {
  border-color: #2563eb;
  background-color: #2563eb;
  color: #fff;
}

.rz-timepicker .rz-button.rz-secondary:hover:not(:disabled) {
  border-color: #1d4ed8;
  background-color: #1d4ed8;
}

/* Il visualizzatore PDF occupa lo spazio necessario alla lettura del documento. */
.pdf-preview-modal {
  display: flex;
  flex-direction: column;
  width: 90vw;
  max-width: 90vw;
  height: 95vh;
  max-height: 95vh;
}

.pdf-preview-modal .mud-dialog-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pdf-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #f1f5f9;
}

.pdf-preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #f1f5f9;
}

html[data-theme="dark"] .pdf-preview-body,
html[data-theme="dark"] .pdf-preview-frame {
  background: #20242a;
}

/* I popup Radzen restano sopra i dialog Mud che li ospitano. */
body:has(.mud-dialog-container) :is(.rz-dropdown-panel, .rz-multiselect-panel, .rz-datepicker-popup-container, .rz-autocomplete-panel) {
  z-index: calc(var(--mud-zindex-dialog) + 1) !important;
}

.ordini-muted {
  color: #64748b !important;
}

html[data-theme="dark"] .ordini-muted {
  color: var(--fa-dark-text-muted) !important;
}

/* Piano ordini: griglia modellata sul foglio Excel, con celle sempre modificabili. */
.ordini-piano-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
}

.ordini-piano-grid {
  font-variant-numeric: tabular-nums;
}

/* La griglia scorre in orizzontale invece di schiacciare le colonne: Data resta bloccata. */
.ordini-piano-grid .rz-grid-table {
  min-width: calc(5.6rem + var(--ordini-prodotti, 3) * 18rem + 7rem);
}

/* Intestazioni come Carichi e Giacenze: colonne di prodotto nel colore del carburante, le altre in grigio ardesia. */
.ordini-piano-grid .rz-grid-table thead th {
  white-space: nowrap;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  padding-inline: 0.3rem;
}

.ordini-piano-grid .rz-grid-table tbody td {
  padding-inline: 0.3rem;
  text-align: center;
  vertical-align: middle;
}

/* Intestazioni e valori centrati in orizzontale e in verticale. */
.ordini-piano-grid .rz-grid-table thead th {
  text-align: center;
  vertical-align: middle;
}

.ordini-piano-grid .rz-grid-table thead th .rz-cell-data,
.ordini-piano-grid .rz-grid-table thead th .rz-column-title,
.ordini-piano-grid .rz-grid-table thead th .rz-column-title-content {
  justify-content: center;
  text-align: center;
}

.ordini-piano-grid .rz-grid-table thead th .rz-column-title {
  padding-left: 0;
  color: inherit;
  font-size: inherit;
}

.ordini-prodotto--benzina { --giacenze-product-color: var(--ordini-benzina); }
.ordini-prodotto--gasolio { --giacenze-product-color: var(--ordini-gasolio); }
.ordini-prodotto--gpl { --giacenze-product-color: var(--ordini-gpl); }

.ordini-piano-grid .rz-grid-table thead th.ordini-prodotto,
.ordini-accettati-table thead th.ordini-prodotto {
  border-color: #cbd5e1;
  background: color-mix(in srgb, var(--giacenze-product-color, #64748b) 18%, #fff);
  color: #0f172a;
}

html[data-theme="dark"] .ordini-piano-grid .rz-grid-table thead th {
  border-color: var(--fa-dark-border);
  background: var(--fa-dark-surface-raised);
  color: var(--fa-dark-text-muted);
}

/* Come in Giacenze, anche in scuro la tinta del prodotto resta chiara con testo scuro. */
html[data-theme="dark"] .ordini-piano-grid .rz-grid-table thead th.ordini-prodotto,
html[data-theme="dark"] .ordini-accettati-table thead th.ordini-prodotto {
  border-color: var(--fa-dark-border);
  background: color-mix(in srgb, var(--giacenze-product-color, #64748b) 18%, #fff);
  color: #0f172a;
}

.ordini-skeleton {
  display: inline-block;
  width: 70%;
  height: 0.8rem;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, #e8ebef 25%, #f3f4f6 50%, #e8ebef 75%);
  background-size: 200% 100%;
  animation: email-history-skeleton-shimmer 1.4s ease-in-out infinite;
  vertical-align: middle;
}

.ordini-skeleton--testo {
  width: min(28rem, 80%);
}

/* In griglia lo skeleton occupa l'altezza dell'input numerico, così le righe in caricamento sono alte quanto quelle vere. */
.ordini-piano-grid tbody .ordini-skeleton {
  margin-block: calc((var(--rz-input-height, 2.5rem) - 0.8rem) / 2);
}

@media (prefers-reduced-motion: reduce) {
  .ordini-skeleton { animation: none; }
}

html[data-theme="dark"] .ordini-skeleton {
  background: linear-gradient(90deg, #30343a 25%, #3b4149 50%, #30343a 75%);
  background-size: 200% 100%;
}

.ordini-piano-grid .rz-grid-table thead th.ordini-piano-prodotto {
  font-size: 0.82rem;
  font-weight: 700;
}

.ordini-piano-grid .rz-cell-data {
  overflow: visible;
}

.ordini-cella {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.ordini-cella .rz-numeric {
  flex: 1 1 auto;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.ordini-cella .rz-numeric:hover,
.ordini-cella .rz-numeric:focus-within {
  border-color: var(--mud-palette-lines-inputs);
  background: var(--mud-palette-surface);
}

.ordini-cella .rz-numeric input {
  font-size: 0.875rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ordini-cella .rz-numeric .rz-numeric-input {
  padding-inline: 0.25rem 0.4rem;
}

.ordini-cella .rz-numeric {
  width: 100%;
}

.ordini-cella > i {
  font-size: 0.75rem;
  color: var(--mud-palette-text-secondary);
}

.ordini-cella.is-manuale .rz-numeric input,
.ordini-ordinato.is-manuale input {
  font-weight: 600;
}

.ordini-ordinato.is-proposto .rz-numeric input,
span.ordini-ordinato.is-proposto {
  color: #1d4ed8;
}

.ordini-ordinato.is-proposto .rz-numeric {
  border: 1px dashed #93c5fd;
}

.ordini-ordinato.is-accettato .rz-numeric input,
span.ordini-ordinato.is-accettato {
  font-weight: 700;
  color: #166534;
}

.ordini-ordinato.is-accettato > i,
.ordini-ordine-accettato i {
  color: #16a34a;
}

span.ordini-ordinato {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  padding: 0 0.3rem;
  border-radius: 0.25rem;
}

span.ordini-ordinato.is-proposto {
  border: 1px dashed #93c5fd;
}

.ordini-rimanenza.is-sotto-scorta,
.ordini-sotto-scorta-icona,
.ordini-ritardo {
  color: #b45309;
  font-weight: 700;
}

.ordini-reset {
  padding: 0.1rem 0.25rem;
  color: var(--mud-palette-text-secondary);
  background: none;
  border: 0;
  border-radius: 0.25rem;
  cursor: pointer;
}

/* Accetta e Annulla nella colonna Ordine: stesso pulsante del sito, in formato compatto. */
.fa-table-action.ordini-azione {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.ordini-reset:hover,
.ordini-reset:focus-visible {
  color: var(--mud-palette-primary);
  background: var(--mud-palette-action-default-hover);
}

.ordini-giorno {
  min-width: 3rem;
  padding: 0.3rem 0.6rem;
  color: var(--mud-palette-text-primary);
  background: var(--mud-palette-surface);
  border: 1px solid var(--mud-palette-lines-inputs);
  border-radius: 0.375rem;
  text-transform: capitalize;
}

.ordini-giorno.is-attivo {
  color: var(--mud-palette-primary-text);
  background: var(--mud-palette-primary);
  border-color: var(--mud-palette-primary);
}

.ordini-giorno:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Parametri ordini: una riga per tipo d'ordine, riepilogo a sinistra e campi su un pannello a destra. */
.ordini-impostazioni-riga {
  display: grid;
  grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  padding-block: 2rem;
  border-top: 1px solid #e5e7eb;
}

.ordini-impostazioni-riga:first-child {
  padding-top: 0.5rem;
  border-top: 0;
}

/* Spazio per la barra di salvataggio fissa in basso a destra. */
.ordini-impostazioni {
  padding-bottom: 5.5rem;
}

.ordini-impostazioni-riga > * {
  min-width: 0;
}

.ordini-impostazioni-intro {
  padding-top: 0.5rem;
}

.ordini-impostazioni-titolo {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.ordini-impostazioni-riepilogo {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569;
}

.ordini-impostazioni-pannello {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.ordini-campi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
}

.ordini-campo,
.ordini-campo-etichetta {
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.ordini-campo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ordini-campo-etichetta {
  margin-bottom: 0.5rem;
}

.ordini-campo .rz-numeric {
  width: 100%;
  max-width: 12rem;
}

.ordini-parametri-prodotti {
  --bs-table-bg: transparent;
  font-variant-numeric: tabular-nums;
}

.ordini-parametri-prodotti thead th {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  vertical-align: bottom;
}

.ordini-parametri-prodotti tbody :is(th, td) {
  padding-block: 0.6rem;
}

.ordini-parametri-prodotti tbody tr:last-child :is(th, td) {
  border-bottom: 0;
}

.ordini-prodotto-nome {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.ordini-prodotto-nome::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--giacenze-product-color, #94a3b8);
}

.ordini-parametri-prodotti .rz-numeric {
  width: 100%;
  min-width: 6rem;
  max-width: 9rem;
}

.ordini-parametri-prodotti .rz-numeric input {
  text-align: right;
}

/* Ordini accettati: pannello tabellare come Carichi, una riga per ordine con le sue azioni. */
.ordini-accettati-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}

.ordini-accettati-header {
  padding: 1.25rem 1.25rem 1rem;
}

.ordini-accettati-titolo {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.ordini-accettati-sottotitolo {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.ordini-accettati-table {
  font-variant-numeric: tabular-nums;
}

.ordini-accettati-table thead th {
  padding: 0.65rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.ordini-accettati-table tbody :is(th, td) {
  padding: 0.9rem 1.25rem;
  font-size: 0.925rem;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
}

.ordini-accettati-table tbody tr:last-child td {
  border-bottom: 0;
}

.ordini-accettati-litri {
  font-weight: 600;
}

.ordini-accettati-vuoto {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 1.25rem 1.25rem;
  padding: 1.25rem;
  color: #475569;
  background: #f8fafc;
  border-radius: 10px;
}

.ordini-accettati-vuoto i {
  font-size: 1.25rem;
  color: #94a3b8;
}

/* Popup di consegna: una riga per prodotto, con il colore del carburante come in Carichi. */
.ordini-consegna-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ordini-consegna-prodotto {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-left: 4px solid var(--giacenze-product-color, #94a3b8);
  background: color-mix(in srgb, var(--giacenze-product-color, #94a3b8) 8%, #fff);
  border-radius: 8px;
}

@media (max-width: 767.98px) {
  .ordini-consegna-grid,
  .ordini-consegna-prodotto {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Su telefono ogni ordine diventa un blocco: etichetta sopra il valore, azioni in fondo. */
  .ordini-accettati-table thead {
    display: none;
  }

  .ordini-accettati-table :is(tbody, tr, td) {
    display: block;
    width: 100%;
  }

  .ordini-accettati-table tbody tr {
    padding: 0.75rem 0;
    border-top: 1px solid #e2e8f0;
  }

  .ordini-accettati-table tbody td {
    padding: 0.3rem 1rem;
    border: 0;
  }

  .ordini-accettati-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
  }

  /* L'etichetta del prodotto prende la stessa tinta dell'intestazione desktop. */
  .ordini-accettati-table td.ordini-accettati-prodotto {
    text-align: left !important;
  }

  .ordini-accettati-table td.ordini-accettati-prodotto[data-label]::before {
    width: fit-content;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    background: color-mix(in srgb, var(--giacenze-product-color, #64748b) 18%, #fff);
    color: #0f172a;
  }

  .ordini-accettati-table td.ordini-accettati-azioni {
    padding-top: 0.6rem;
    text-align: left !important;
  }

  .ordini-accettati-table td.ordini-accettati-azioni > div {
    justify-content: flex-start !important;
  }
}

html[data-theme="dark"] .ordini-accettati-panel {
  background: var(--fa-dark-surface);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] :is(.ordini-accettati-titolo, .ordini-accettati-table tbody :is(th, td)) {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .ordini-accettati-sottotitolo,
html[data-theme="dark"] .ordini-accettati-vuoto {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .ordini-accettati-table thead th {
  color: var(--fa-dark-text-muted);
  background: var(--fa-dark-surface-raised);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .ordini-accettati-table {
  --bs-table-bg: transparent;
}

html[data-theme="dark"] .ordini-accettati-table tbody :is(tr, th, td) {
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .ordini-accettati-vuoto {
  background: var(--fa-dark-surface-raised);
}

html[data-theme="dark"] .ordini-consegna-form .accrediti-clienti-edit-label {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .ordini-consegna-prodotto {
  background: color-mix(in srgb, var(--giacenze-product-color, #94a3b8) 12%, var(--fa-dark-surface-raised));
}

@media (max-width: 767.98px) {
  .ordini-impostazioni-riga {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding-block: 1.5rem;
  }

  .ordini-impostazioni-intro {
    padding-top: 0;
  }

  .ordini-impostazioni-pannello {
    padding: 1rem;
  }
}

html[data-theme="dark"] .ordini-impostazioni-riga {
  border-top-color: var(--fa-dark-border);
}

html[data-theme="dark"] .ordini-impostazioni-titolo,
html[data-theme="dark"] :is(.ordini-campo, .ordini-campo-etichetta) {
  color: var(--fa-dark-text);
}

html[data-theme="dark"] .ordini-impostazioni-riepilogo,
html[data-theme="dark"] .ordini-parametri-prodotti thead th {
  color: var(--fa-dark-text-muted);
}

html[data-theme="dark"] .ordini-impostazioni-pannello {
  background: var(--fa-dark-surface-raised);
  border-color: var(--fa-dark-border);
}

html[data-theme="dark"] .ordini-ordinato.is-proposto .rz-numeric input,
html[data-theme="dark"] span.ordini-ordinato.is-proposto {
  color: #93c5fd;
}

html[data-theme="dark"] .ordini-ordinato.is-proposto .rz-numeric,
html[data-theme="dark"] span.ordini-ordinato.is-proposto {
  border-color: #3b5f8f;
}

html[data-theme="dark"] .ordini-ordinato.is-accettato .rz-numeric input,
html[data-theme="dark"] span.ordini-ordinato.is-accettato {
  color: #86efac;
}

html[data-theme="dark"] .ordini-ordinato.is-accettato > i,
html[data-theme="dark"] .ordini-ordine-accettato i {
  color: #4ade80;
}

html[data-theme="dark"] .ordini-rimanenza.is-sotto-scorta,
html[data-theme="dark"] .ordini-sotto-scorta-icona,
html[data-theme="dark"] .ordini-ritardo {
  color: #fbbf24;
}

html[data-theme="dark"] .ordini-parametri-prodotti {
  --bs-table-bg: transparent;
  --bs-table-color: var(--fa-dark-text);
  border-color: var(--fa-dark-border);
}

/* La regola scura globale degli input usa !important: le celle del piano restano trasparenti fino a hover o focus. */
html[data-theme="dark"] .ordini-cella :is(.rz-numeric, .rz-numeric input) {
  background-color: transparent !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .ordini-cella .rz-numeric:is(:hover, :focus-within) {
  background-color: #14171b !important;
  border-color: var(--fa-dark-border-strong) !important;
}

html[data-theme="dark"] .ordini-ordinato.is-proposto .rz-numeric {
  border-color: #3b5f8f !important;
}

html[data-theme="dark"] .ordini-ordinato.is-proposto .rz-numeric input {
  color: #93c5fd !important;
}

html[data-theme="dark"] .ordini-ordinato.is-accettato .rz-numeric input {
  color: #86efac !important;
}

.ordini-parametri-prodotti .rz-numeric .rz-numeric-input {
  padding-inline: 0.4rem;
}


.ordini-accetta {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  text-transform: none;
  white-space: nowrap;
}

/* Le icone di stato stanno nell'angolo della cella e non tolgono spazio al numero. */
.ordini-piano-grid .ordini-cella {
  position: relative;
}

.ordini-piano-grid .ordini-cella > i {
  position: absolute;
  top: 0.1rem;
  left: 0.1rem;
  z-index: 1;
  font-size: 0.6rem;
  pointer-events: none;
}

/* Anche il ripristino sta nell'angolo, così il numero resta intero nelle colonne strette. */
.ordini-piano-grid .ordini-cella > .ordini-reset {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  padding: 0.05rem 0.2rem;
  font-size: 0.6rem;
  line-height: 1;
}

.ordini-ordine-accettato {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.35rem;
}
