:root {
  --tf-primary: #0d6efd;
  --tf-accent: #198754;
  --tf-nav-bg: #212529;
  --tf-nav-txt: #f8f9fa;
  --tf-page-bg: #f8f9fa;
  --tf-surface-bg: #ffffff;
}

body {
  background-color: var(--tf-page-bg);
  color: var(--tf-page-text);
}

.card,
.modal-content {
  background-color: var(--tf-surface-bg);
  color: var(--tf-surface-text);
}

body.tf-branding-page .tf-branding-card {
  background-color: var(--tf-surface-bg);
}

.fa-solid {
  vertical-align: -0.125em;
}

.hgi-stroke {
  vertical-align: -0.125em;
}

.navbar {
  background-color: var(--tf-nav-bg) !important;
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-text,
.navbar .navbar-toggler {
  color: var(--tf-nav-txt) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--tf-nav-hover, var(--tf-nav-txt)) !important;
}

.navbar .btn-primary {
  color: var(--tf-nav-txt);
}

.tf-ui-page {
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}

.tf-ui-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem 0.95rem;
  margin-bottom: 1.05rem;
  padding: 0.78rem 0.95rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at top left, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.7), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--tf-surface-bg) 94%, var(--tf-surface-bg, #fff) 6%) 0%, color-mix(in srgb, var(--tf-surface-bg) 88%, var(--tf-page-bg) 12%) 100%);
  box-shadow: 0 0.9rem 2rem rgba(15, 23, 42, 0.05);
}

.tf-ui-page-header__body {
  min-width: min(100%, 34rem);
  flex: 1 1 28rem;
}

.tf-ui-page-header__eyebrow,
.tf-ui-section-heading__eyebrow {
  margin-bottom: 0.3rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tf-ui-page-header__title {
  margin: 0;
  font-size: clamp(1.3rem, 1.12rem + 0.6vw, 1.8rem);
  line-height: 1.05;
  font-weight: 700;
}

.tf-ui-page-header__subtitle {
  margin-top: 0.12rem;
  color: var(--tf-muted-text, #5f6b76);
  max-width: 48rem;
  line-height: 1.36;
}

.tf-address-uppercase {
  text-transform: uppercase;
}

.tf-ui-page-header__meta {
  margin-top: 0.32rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.84rem;
  line-height: 1.32;
}

.tf-ui-page-header__aside {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.tf-ui-page-header.is-compact {
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.85rem;
  padding: 0.72rem 0.9rem;
  border-radius: 1rem;
}

.tf-ui-page-header.is-compact .tf-ui-page-header__body {
  min-width: min(100%, 28rem);
  flex-basis: 24rem;
}

.tf-ui-page-header.is-compact .tf-ui-page-header__eyebrow {
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
}

.tf-ui-page-header.is-compact .tf-ui-page-header__title {
  font-size: clamp(1.15rem, 1.02rem + 0.45vw, 1.55rem);
  line-height: 1.06;
}

.tf-ui-page-header.is-compact .tf-ui-page-header__subtitle {
  margin-top: 0.12rem;
  max-width: 42rem;
  font-size: 0.95rem;
  color: var(--tf-muted-text, #53606c);
}

.tf-ui-page-header.is-compact .tf-ui-page-header__meta {
  margin-top: 0.26rem;
  font-size: 0.79rem;
  color: var(--tf-muted-text, #66727e);
}

.tf-ui-page-header.is-compact .tf-ui-page-header__aside {
  gap: 0.4rem;
  align-self: center;
}

.tf-ui-page-header.is-compact .tf-ui-actionbar {
  gap: 0.4rem;
}

.tf-ui-page-header.is-compact .tf-ui-actionbar .btn {
  --bs-btn-padding-y: 0.3rem;
  --bs-btn-padding-x: 0.68rem;
  --bs-btn-font-size: 0.79rem;
}

.tf-ui-actionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.tf-persona-detail-sticky-header {
  position: sticky;
  top: var(--tf-navbar-offset, 4.75rem);
  z-index: 1015;
  margin: -0.2rem -0.2rem 1.5rem;
  padding: 0.2rem;
  background: var(--tf-page-bg);
}

.tf-persona-detail-sticky-header__card {
  width: 100%;
}

.tf-persona-detail-sticky-header__layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 0.9rem;
}

.tf-persona-detail-sticky-header__identity {
  display: flex;
  flex: 1 1 32rem;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 0.35rem;
}

.tf-persona-detail-sticky-header__identity-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.65rem;
}

.tf-persona-detail-sticky-header__title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: clamp(1.3rem, 1.2rem + 0.35vw, 1.5rem);
  line-height: 1.1;
  font-weight: 700;
}

.tf-persona-detail-sticky-header__title > i {
  flex: 0 0 auto;
  font-size: 0.85em;
}

.tf-persona-detail-sticky-header__code {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.8rem;
  white-space: nowrap;
}

.tf-persona-detail-sticky-header__completion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.tf-persona-detail-sticky-header__completion .tf-ui-badge {
  cursor: help;
}

.tf-persona-detail-sticky-header__completion button.tf-ui-badge {
  border: 0;
  cursor: pointer;
}

.tf-persona-detail-sticky-header__completion .tf-ui-badge:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.tf-persona-detail-sticky-header__actions {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.tf-persona-detail-sticky-header__actions .btn {
  --bs-btn-padding-y: 0.3rem;
  --bs-btn-padding-x: 0.65rem;
  --bs-btn-font-size: 0.82rem;
}

@media (min-width: 768px) {
  .tf-persona-detail-sticky-header__actions {
    flex-wrap: nowrap;
  }
}

.tf-persone-list-filters {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.65rem;
  background-color: color-mix(in srgb, var(--tf-surface-bg) 94%, var(--tf-page-bg) 6%);
  box-shadow: 0 0.45rem 1rem rgba(15, 23, 42, 0.06);
}

.tf-persone-list-filters__form {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(11rem, 14rem) auto;
  gap: 0.5rem;
  align-items: center;
}

.tf-persone-list-filters__actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.tf-ui-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.9rem;
}

.tf-ui-section-heading__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--tf-surface-text, #1f2933);
}

.tf-ui-section-heading__subtitle {
  margin-top: 0.15rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.875rem;
}

.tf-ui-card {
  height: 100%;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--tf-surface-bg) 97%, var(--tf-surface-bg, #fff) 3%);
  box-shadow: 0 0.75rem 1.8rem rgba(15, 23, 42, 0.05);
}

.tf-ui-card .card-header,
.tf-ui-card__header {
  padding: 0.74rem 0.9rem 0.58rem;
  border-bottom: 1px solid var(--tf-border, #dee2e6);
  background: transparent;
}

.tf-ui-card .card-body,
.tf-ui-card__body {
  padding: 0.74rem 0.9rem 0.8rem;
}

.tf-ui-card .card-footer,
.tf-ui-card__footer {
  padding: 0.62rem 0.9rem 0.74rem;
  border-top: 1px solid var(--tf-border, #dee2e6);
  background: transparent;
}

.tf-ui-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

.tf-ui-card__subtitle {
  margin-top: 0.06rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.84rem;
  line-height: 1.32;
}

.tf-ui-card--soft {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tf-surface-bg) 95%, var(--tf-surface-bg, #fff) 5%) 0%, color-mix(in srgb, var(--tf-surface-bg) 90%, var(--tf-page-bg) 10%) 100%);
}

.tf-bundle-commerciale {
  max-width: 1320px;
  margin-inline: auto;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.tf-bundle-commerciale .tf-ui-page-header {
  margin-bottom: 0.5rem;
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
}

.tf-bundle-commerciale .tf-ui-page-header__eyebrow {
  margin-bottom: 0.1rem;
}

.tf-bundle-commerciale .tf-ui-page-header__subtitle {
  line-height: 1.22;
}

.tf-bundle-commerciale .tf-ui-card .card-header {
  padding: 0.48rem 0.75rem 0.4rem;
}

.tf-bundle-commerciale .tf-ui-card .card-body {
  padding: 0.5rem 0.75rem 0.55rem;
}

.tf-bundle-commerciale .tf-ui-card__subtitle {
  margin-top: 0.02rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.tf-bundle-commerciale #component-empty-state {
  padding: 0.45rem 0.75rem;
  border-radius: 0.75rem;
}

.tf-bundle-commerciale #component-empty-state .tf-ui-empty-state__title {
  margin-bottom: 0.05rem;
}

.tf-bundle-component {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--tf-surface-bg) 98%, var(--tf-page-bg) 2%);
}

.tf-bundle-component__totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--tf-border, #dee2e6);
  font-size: 0.82rem;
  color: var(--tf-muted-text, #6c757d);
}

.tf-bundle-component__totals strong {
  margin-left: 0.2rem;
  color: var(--tf-surface-text);
}

.tf-bundle-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.8rem;
  background: color-mix(in srgb, var(--tf-page-bg) 55%, var(--tf-surface-bg) 45%);
}

.tf-bundle-summary-card > span,
.tf-bundle-summary-card > small {
  color: var(--tf-muted-text, #6c757d);
}

.tf-bundle-summary-card > strong {
  margin-block: 0.05rem;
  font-size: 1.2rem;
  line-height: 1.15;
}

.tf-bundle-summary-card > small {
  font-size: 0.76rem;
  line-height: 1.18;
}

.tf-bundle-package-price {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tf-bundle-package-price .form-text {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.tf-bundle-commerciale .tf-ui-form-actions {
  gap: 0.5rem;
  padding: 0.42rem 0.65rem;
  border-radius: 0.8rem;
}

.tf-bundle-summary-card.is-primary {
  border-color: color-mix(in srgb, var(--tf-primary) 28%, transparent);
  background: color-mix(in srgb, var(--tf-primary) 7%, var(--tf-surface-bg) 93%);
}

.tf-bundle-summary-card.is-success {
  border-color: rgba(25, 135, 84, 0.25);
  background: color-mix(in srgb, #198754 7%, var(--tf-surface-bg) 93%);
}

.tf-bundle-auto-component {
  padding: 0.45rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--tf-primary) 18%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--tf-primary) 4%, var(--tf-surface-bg) 96%);
  font-size: 0.86rem;
}

.tf-bundle-commerciale-page #addComponentModal .modal-body {
  overflow: visible;
}

@media (max-width: 767.98px) {
  .tf-bundle-component {
    padding: 0.85rem;
  }

  .tf-bundle-commerciale .tf-ui-card__subtitle,
  .tf-bundle-package-price .form-text {
    line-height: 1.3;
  }
}

/* Keep horizontal access on small screens; use page scrolling when space is short. */
.well-catalog-scroll {
  min-width: 0;
  overflow: auto;
}

.well-catalog-scroll:focus-visible {
  outline: 2px solid var(--tf-primary);
  outline-offset: -2px;
}

/* Keep the catalog controls in view only when a usable table fits below them. */
@media screen and (min-width: 992px) and (min-height: 700px) {
  body.well-catalog-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.well-catalog-page > .navbar,
  body.well-catalog-page > .tf-app-footer,
  .well-catalog-container > #flash-messages,
  .well-catalog-layout > .tf-ui-page-header,
  .well-catalog-catalog > .card-header,
  .well-catalog-catalog > .card-footer {
    flex: 0 0 auto;
  }

  .well-catalog-container,
  .well-catalog-layout,
  .well-catalog-catalog {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
  }

  /* Tall filters and validation messages must remain reachable. */
  .well-catalog-container {
    overflow: auto;
  }

  .well-catalog-catalog {
    min-height: 14rem;
  }

  .well-catalog-scroll {
    flex: 1 1 0;
    min-height: 10rem;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-padding-top: 5rem;
  }

  .well-catalog-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .well-catalog-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--bs-table-bg, var(--tf-surface-bg));
  }

  body.well-catalog-page > .tf-app-footer {
    margin-top: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
  }
}

/* Counter-sale creation and add-item share one scroll area, including lookups. */
.cassa-counter-form-layout {
  padding-top: 0;
  padding-bottom: 0.5rem;
}

.cassa-counter-form-layout .tf-ui-page-header {
  margin-bottom: 0.5rem;
}

.cassa-counter-form-card > .card-body,
.cassa-counter-form-card > .card-footer {
  padding: 0.65rem 0.85rem;
}

.cassa-counter-form-content {
  overflow-wrap: anywhere;
}

.cassa-counter-form-content:focus-visible {
  outline: 2px solid var(--tf-primary);
  outline-offset: -2px;
}

.cassa-counter-form-content .alert {
  padding: 0.5rem 0.65rem;
}

.cassa-counter-form-content fieldset > legend {
  margin-bottom: 0.35rem;
}

@media screen and (min-width: 992px) and (min-height: 600px) {
  body.cassa-counter-form-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.cassa-counter-form-page > .navbar,
  body.cassa-counter-form-page > .tf-app-footer,
  .cassa-counter-form-container > #flash-messages,
  .cassa-counter-form-layout > .tf-ui-page-header,
  .cassa-counter-form-card > .card-footer {
    flex: 0 0 auto;
  }

  .cassa-counter-form-container,
  .cassa-counter-form-layout,
  .cassa-counter-form,
  .cassa-counter-form-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
  }

  .cassa-counter-form-card > .cassa-counter-form-content {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  body.cassa-counter-form-page > .navbar {
    margin-bottom: 0.5rem !important;
  }

  body.cassa-counter-form-page > .tf-app-footer {
    margin-top: 0;
    padding-top: 0.2rem;
    padding-bottom: 0.4rem;
  }

  /* An expanded navigation menu needs natural page flow on reduced desktops. */
  body.cassa-counter-form-page:has(> .navbar .navbar-collapse:is(.show, .collapsing)) {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }

  body.cassa-counter-form-page:has(> .navbar .navbar-collapse:is(.show, .collapsing))
    :is(.cassa-counter-form-container, .cassa-counter-form-layout, .cassa-counter-form, .cassa-counter-form-card, .cassa-counter-form-content) {
    flex: 0 0 auto;
  }

  body.cassa-counter-form-page:has(> .navbar .navbar-collapse:is(.show, .collapsing)) .cassa-counter-form-content {
    overflow: visible;
  }
}

/* Keep treatment setup inside the desktop viewport while preserving the app footer. */
@media (min-width: 992px) {
  body.well-service-form-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.well-service-form-page > .navbar,
  body.well-service-form-page > .tf-app-footer,
  .well-service-form-container > #flash-messages,
  .well-service-form-heading,
  .well-service-form > [data-testid="servizio-bottom-actions"] {
    flex: 0 0 auto;
  }

  .well-service-form-container,
  .well-service-form-layout,
  .well-service-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
  }

  .well-service-form {
    flex-wrap: nowrap;
    margin-bottom: 0;
  }

  .well-service-form > .col-12:first-of-type {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 0.15rem;
  }

  body.well-service-form-page.modal-open .well-service-form > .col-12:first-of-type {
    overflow: visible;
  }

  .well-service-form > [data-testid="servizio-bottom-actions"] {
    padding-top: 0.35rem;
  }

  body.well-service-form-page > .tf-app-footer {
    margin-top: 0;
    padding-top: 0.2rem;
    padding-bottom: 0.4rem;
  }
}

.well-service-form-layout h1 {
  font-size: clamp(1.55rem, 1.35rem + 0.55vw, 2rem);
}

.well-service-form .card-header {
  padding: 0.55rem 0.75rem;
}

.well-service-form .card-body {
  padding: 0.7rem 0.75rem;
}

.well-service-form textarea[name="descrizione"] {
  min-height: 4rem;
  max-height: 6rem;
}

.well-service-form [data-iva-specific-field][hidden] {
  display: none !important;
}

.well-home-compact {
  padding-top: 0.62rem;
  padding-bottom: 0.15rem;
}

body.well-dashboard-page > .tf-app-footer {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  padding-bottom: 0.5rem;
}

body.well-dashboard-page > .navbar {
  margin-bottom: 0.5rem !important;
}

.well-home-compact .tf-ui-detail-label {
  font-size: 0.76rem;
  text-transform: none;
  letter-spacing: normal;
}

.well-dashboard-cash-queue-card [data-well-cash-person-id] {
  font-size: 0.82rem;
}

.well-home-compact .well-dashboard-cash-queue-card .well-dashboard-cash-customer-main {
  flex-basis: 100%;
}

.well-home-compact .well-dashboard-cash-queue-card .well-dashboard-cash-customer-name,
.well-home-compact .well-dashboard-cash-queue-card .well-dashboard-cash-customer-badges {
  flex-basis: 100%;
}

.well-home-compact .tf-ui-page-header {
  align-items: center;
  gap: 0.38rem 0.68rem;
  margin-bottom: 0.52rem;
  padding: 0.48rem 0.72rem;
  border-radius: 0.85rem;
}

.well-home-compact .tf-ui-page-header__body {
  min-width: min(100%, 28rem);
}

.well-home-compact .tf-ui-page-header__eyebrow {
  margin-bottom: 0.12rem;
  font-size: 0.66rem;
}

.well-home-compact .tf-ui-page-header__title {
  font-size: clamp(1.08rem, 0.98rem + 0.35vw, 1.38rem);
  line-height: 1.06;
}

.well-home-compact .tf-ui-page-header__subtitle,
.well-home-compact .tf-ui-page-header__meta {
  margin-top: 0.08rem;
  font-size: 0.78rem;
  line-height: 1.25;
}

.well-home-compact .tf-ui-page-header .tf-ui-actionbar {
  gap: 0.3rem;
}

.well-home-compact .tf-ui-page-header__body > .tf-ui-actionbar {
  margin-top: 0.28rem !important;
}

.well-home-compact .well-home-header-aside {
  flex: 1 1 38rem;
  gap: 0.22rem;
  min-width: min(100%, 28rem);
}

.well-home-compact .well-home-tenant-brand {
  align-self: flex-end;
  max-width: 14rem;
  overflow: hidden;
}

.well-home-compact .well-home-tenant-logo {
  width: auto;
  height: auto;
  max-width: 14rem;
  max-height: 4.5rem;
  border-radius: 0.35rem;
  object-fit: contain;
}

.well-home-header-actions {
  gap: 0.22rem;
}

.well-home-compact .well-home-header-actions {
  width: 100%;
  max-width: 100%;
  justify-content: flex-end;
}

.well-home-header-actions .btn {
  white-space: nowrap;
}

.well-home-compact .tf-ui-page-header .btn-sm,
.well-home-header-actions .btn-sm {
  --bs-btn-padding-y: 0.2rem;
  --bs-btn-padding-x: 0.45rem;
  --bs-btn-font-size: 0.7rem;
}

.well-home-compact > .row {
  --bs-gutter-y: 0.62rem;
  margin-bottom: 0.62rem !important;
}

.well-home-compact > .row:first-of-type {
  margin-bottom: 0.58rem !important;
}

.well-home-compact > .well-dashboard-cash-row {
  margin-bottom: 0 !important;
}

.well-home-compact > .tf-ui-card.mb-4,
.well-home-compact > .card.mb-4 {
  margin-bottom: 0.62rem !important;
}

.well-home-compact .tf-ui-card .card-header,
.well-home-compact .tf-ui-card__header {
  padding: calc(0.46rem + var(--well-dashboard-space, 0px) * 0.5)
    calc(0.66rem + var(--well-dashboard-space, 0px) * 0.5)
    calc(0.38rem + var(--well-dashboard-space, 0px) * 0.5);
}

.well-home-compact .tf-ui-card .card-body,
.well-home-compact .tf-ui-card__body {
  padding: calc(0.48rem + var(--well-dashboard-space, 0px))
    calc(0.66rem + var(--well-dashboard-space, 0px) * 0.5)
    calc(0.52rem + var(--well-dashboard-space, 0px));
}

.well-home-compact .tf-ui-card__title {
  font-size: 0.86rem;
}

.well-home-compact .tf-ui-card__subtitle {
  font-size: 0.76rem;
  line-height: 1.22;
}

.well-home-compact .tf-ui-card .btn-sm {
  --bs-btn-padding-y: 0.22rem;
  --bs-btn-padding-x: 0.52rem;
  --bs-btn-font-size: 0.74rem;
}

.well-home-compact .well-dashboard-cash-summary-card,
.well-home-compact .well-dashboard-cash-operational-card,
.well-home-compact .well-dashboard-cash-queue-card {
  height: auto;
}

.well-home-compact .well-dashboard-payment-method-row {
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.1;
}

.well-home-compact .tf-ui-kpi-card {
  gap: 0.18rem;
  min-height: 4.3rem;
  padding-top: 0.38rem;
  padding-bottom: 0.4rem;
}

.well-home-compact .tf-ui-kpi-card__label {
  font-size: 0.72rem;
}

.well-home-compact .tf-ui-kpi-card__value {
  font-size: clamp(1.16rem, 1rem + 0.45vw, 1.55rem);
}

.well-home-compact .tf-ui-kpi-card__hint {
  font-size: 0.72rem;
  line-height: 1.2;
}

.well-home-compact .table-sm > :not(caption) > * > * {
  padding-top: 0.38rem;
  padding-bottom: 0.38rem;
}

.well-home-compact .list-group-item {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.well-home-compact .well-dashboard-arrival-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.well-home-compact .well-dashboard-arrival-time {
  font-weight: 700;
  white-space: nowrap;
}

.well-home-compact .well-dashboard-arrival-person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  min-width: 0;
}

.well-home-compact .well-dashboard-arrival-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.well-home-compact .well-dashboard-arrival-count {
  display: flex;
  align-items: center;
  min-width: 0;
}

.well-home-compact .well-dashboard-chip {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}

.well-home-compact .well-dashboard-chip--package {
  border-color: var(--bs-info-border-subtle);
  background: var(--bs-info-bg-subtle);
  color: var(--bs-info-text-emphasis);
}

.well-home-compact .well-dashboard-chip--practice {
  border-color: var(--bs-primary-border-subtle);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

.well-home-compact .well-dashboard-chip--count {
  border-color: var(--bs-border-color);
  background: var(--bs-light);
  color: var(--bs-secondary-color);
}

.well-home-compact .well-dashboard-arrival-actions {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.well-home-compact .well-dashboard-arrival-actions__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.well-home-compact .well-dashboard-arrival-actions__forms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.well-home-compact .well-dashboard-cash-customer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
}

.well-home-compact .well-dashboard-cash-customer-main {
  display: flex;
  flex: 1 1 18rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  min-width: 0;
}

.well-home-compact .well-dashboard-cash-customer-name {
  flex: 0 1 auto;
}

.well-home-compact .well-dashboard-cash-customer-badges {
  display: flex;
  flex: 1 1 12rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}

.well-home-compact .well-dashboard-cash-customer-actions {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* The row is the containment boundary, so half-width cards use their own width. */
.well-home-compact .well-dashboard-arrival-row {
  container-type: inline-size;
}

@container (max-width: 28rem) {
  .well-home-compact .well-dashboard-arrival-actions {
    grid-column: 1 / -1;
  }
}

/* Dashboard rows live in half-width cards even on a large desktop.
   Let customer data and actions wrap within the card, not the viewport. */
.well-home-compact .well-dashboard-arrival-person,
.well-home-compact .well-dashboard-cash-customer-name {
  overflow-wrap: anywhere;
}

.well-home-compact .well-dashboard-chip {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.well-home-compact .well-dashboard-chip > * {
  min-width: 0;
}

.well-home-compact .well-dashboard-cash-customer-badges .tf-ui-badge {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .well-home-compact {
    padding-top: 0.95rem;
    padding-bottom: 1.1rem;
  }

  .well-home-compact .tf-ui-page-header {
    align-items: flex-start;
    padding: 0.72rem 1rem;
  }

  .well-home-compact .well-home-header-aside {
    align-items: stretch;
    gap: 0.5rem;
    min-width: 100%;
  }

  .well-home-compact .well-home-tenant-brand {
    align-self: flex-start;
    max-width: 100%;
  }

  .well-home-compact .well-home-tenant-logo {
    max-width: 100%;
    max-height: 3.25rem;
  }

  .well-home-compact .well-home-header-actions {
    justify-content: flex-start;
  }

  .well-home-compact .tf-ui-page-header__subtitle,
  .well-home-compact .tf-ui-page-header__meta {
    font-size: 0.84rem;
  }

  .well-home-compact > .row {
    --bs-gutter-y: 1rem;
    margin-bottom: 1rem !important;
  }

  .well-home-compact .tf-ui-card .card-header,
  .well-home-compact .tf-ui-card .card-body,
  .well-home-compact .tf-ui-card__header,
  .well-home-compact .tf-ui-card__body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .well-home-compact .tf-ui-card__title {
    font-size: 0.95rem;
  }

  .well-home-compact .tf-ui-card__subtitle {
    font-size: 0.84rem;
  }
}

/* Reception dashboard: independent columns and natural page growth. */
body.well-dashboard-page .well-home-compact > .well-dashboard-columns {
  margin-bottom: 0 !important;
}

/* Grow spacing gradually on tall desktops; compact and mobile spacing stays unchanged. */
@media (min-width: 992px) and (min-height: 850px) {
  body.well-dashboard-page .well-dashboard-columns {
    --well-dashboard-space: clamp(0px, calc((100vh - 850px) * 0.12), 36px);
  }

  /* These spacing utilities are !important in Bootstrap. */
  body.well-dashboard-page .well-dashboard-columns > .d-grid {
    gap: calc(0.5rem + var(--well-dashboard-space) * 0.5) !important;
  }

  body.well-dashboard-page .well-dashboard-columns #well-dashboard-operational {
    margin-top: calc(1rem + var(--well-dashboard-space) * 0.5) !important;
  }

  body.well-dashboard-page .well-dashboard-columns #well-cash-dashboard-summary-body > .border-top {
    padding-top: calc(0.5rem + var(--well-dashboard-space) * 0.7) !important;
    margin-top: calc(0.5rem + var(--well-dashboard-space) * 0.7) !important;
  }

  body.well-dashboard-page .well-dashboard-columns #well-cash-dashboard-summary-body .tf-ui-detail-label {
    margin-bottom: calc(0.2rem + var(--well-dashboard-space) * 0.3);
  }

  body.well-dashboard-page .well-dashboard-columns #well-cash-dashboard-summary-body .row.g-2 {
    --bs-gutter-y: calc(0.5rem + var(--well-dashboard-space) * 0.3);
  }

  body.well-dashboard-page .well-dashboard-columns #well-cash-dashboard-summary-body .row.g-1 {
    --bs-gutter-y: calc(0.25rem + var(--well-dashboard-space) * 0.3);
  }
}

body.well-dashboard-page .well-home-compact .well-dashboard-cash-customer-main {
  display: block;
  flex-basis: 12rem;
}

body.well-dashboard-page .well-home-compact .well-dashboard-cash-customer-actions {
  flex: 0 1 auto;
}

body.well-dashboard-page .well-dashboard-cash-queue-card {
  container-type: inline-size;
}

@container (max-width: 28rem) {
  body.well-dashboard-page .well-dashboard-cash-queue-card .table,
  body.well-dashboard-page .well-dashboard-cash-queue-card tbody {
    display: block;
  }

  body.well-dashboard-page .well-dashboard-cash-queue-card thead {
    display: none;
  }

  body.well-dashboard-page .well-dashboard-cash-queue-card tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--tf-border);
  }

  body.well-dashboard-page .well-dashboard-cash-queue-card td {
    min-width: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  body.well-dashboard-page .well-dashboard-cash-queue-card td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--tf-muted-text);
  }

  body.well-dashboard-page .well-dashboard-cash-queue-card td .tf-ui-badge {
    white-space: normal;
  }
}

.tf-ui-meta-separator {
  display: inline-block;
  margin: 0 0.35rem;
}

.tf-ui-detail-label {
  margin-bottom: 0.2rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* Staff customer detail: compact content, natural page scrolling. */
.tf-cliente-detail .tf-ui-card {
  height: auto;
  min-width: 0;
}

.tf-cliente-detail .tf-ui-card .card-header {
  padding: 0.7rem 0.95rem;
}

.tf-cliente-detail .tf-ui-card .card-body {
  padding: 0.85rem 1rem;
}

.tf-cliente-detail .tf-ui-detail-label {
  margin-bottom: 0.2rem;
}

.tf-cliente-detail .tf-ui-card__title {
  font-size: 1rem;
}

.tf-cliente-detail .fw-semibold,
.tf-cliente-detail .tf-pre-wrap,
.tf-cliente-detail__admin-activation a {
  overflow-wrap: anywhere;
}

.tf-cliente-detail__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.tf-cliente-detail__steps .tf-ui-step-chip {
  min-height: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.9rem;
}

.tf-cliente-detail__steps .tf-ui-step-chip > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .tf-cliente-detail__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-cliente-detail__accounting-alert {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 359.98px) {
  .tf-cliente-detail__steps {
    grid-template-columns: 1fr;
  }
}

.tf-ui-detail-text {
  line-height: 1.5;
}

.cassa-today-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.cassa-kpi-card {
  min-height: 5.25rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.75rem;
  background: var(--tf-surface-bg, #fff);
  box-shadow: 0 0.55rem 1.35rem rgba(15, 23, 42, 0.05);
}

.cassa-kpi-card.is-collected {
  border-left: 0.28rem solid #198754;
}

.cassa-kpi-card.is-due {
  border-left: 0.28rem solid #b26b00;
}

.cassa-kpi-card__label {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cassa-kpi-card__value {
  margin-top: 0.25rem;
  color: var(--tf-surface-text, #1f2933);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.05;
}

.cassa-kpi-card__note {
  margin-top: 0.3rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.82rem;
}

.cassa-section-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cassa-section-nav .btn[aria-current="page"] {
  cursor: default;
}

.cassa-rendiconto-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
}

.cassa-rendiconto-header-meta > span:not(:last-child)::after {
  margin-left: 0.85rem;
  color: var(--tf-muted-text, #adb5bd);
  content: "\00b7";
}

.cassa-rendiconto-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.55rem;
}

.cassa-rendiconto-kpi {
  min-width: 0;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-left: 0.25rem solid #6c757d;
  border-radius: 0.7rem;
  background: var(--tf-surface-bg, #fff);
  box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.04);
}

.cassa-rendiconto-kpi.is-positive {
  border-left-color: #198754;
}

.cassa-rendiconto-kpi.is-warning {
  border-left-color: #b26b00;
}

.cassa-rendiconto-kpi.is-cash {
  border-left-color: #0d6efd;
}

.cassa-rendiconto-kpi dt {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.cassa-rendiconto-kpi dd {
  margin: 0.22rem 0 0;
  color: var(--tf-surface-text, #1f2933);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.35rem);
  font-weight: 800;
  line-height: 1.05;
}

.cassa-rendiconto-kpi .cassa-rendiconto-kpi__note {
  display: block;
  margin-top: 0.24rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.2;
}

.cassa-rendiconto-summaries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.65rem;
}

.cassa-rendiconto-summary {
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.7rem;
  background: var(--tf-surface-bg, #fff);
}

.cassa-rendiconto-summary h4 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 750;
}

.cassa-rendiconto-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0;
  border-top: 1px solid var(--tf-border, #dee2e6);
  font-size: 0.82rem;
  line-height: 1.3;
}

.cassa-rendiconto-summary-row strong {
  flex: 0 0 auto;
  text-align: right;
}

.cassa-rendiconto-summary-row.is-zero {
  color: var(--tf-muted-text, #6c757d);
}

.cassa-rendiconto-summary-detail {
  margin: 0.15rem 0 0.1rem 0.45rem;
  padding-left: 0.55rem;
  border-left: 0.16rem solid rgba(var(--tf-primary-rgb, 13, 110, 253), 0.18);
}

.cassa-rendiconto-table-wrap {
  overscroll-behavior-inline: contain;
}

.cassa-rendiconto-table-wrap:focus-visible {
  outline: 0.2rem solid rgba(var(--tf-primary-rgb, 13, 110, 253), 0.45);
  outline-offset: 0.15rem;
}

.cassa-rendiconto-table {
  min-width: 58rem;
  font-size: 0.82rem;
}

.cassa-rendiconto-final-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 0.7fr) minmax(18rem, 1.3fr);
  gap: 0.75rem;
  align-items: start;
}

.cassa-rendiconto-final textarea.form-control {
  min-height: 5rem;
}

.cassa-rendiconto-final-readonly {
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) minmax(12rem, 1fr) minmax(16rem, 1.5fr);
  gap: 0.75rem;
}

.cassa-rendiconto-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.cassa-priority-card {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.22);
  box-shadow: 0 0.85rem 2.2rem rgba(15, 23, 42, 0.08);
}

.cassa-priority-card .card-header {
  background: linear-gradient(180deg, rgba(var(--tf-primary-rgb, 13, 110, 253), 0.08), rgba(var(--tf-surface-rgb, 255, 255, 255), 0));
}

.cassa-work-list {
  display: grid;
  gap: 0.75rem;
}

.cassa-work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.75rem;
  background: var(--tf-surface-bg, #fff);
}

.cassa-work-item.is-focus {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.28);
  background: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.04);
}

.cassa-person-group {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(var(--tf-primary-rgb, 13, 110, 253), 0.16);
  border-radius: 0.75rem;
  background: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.035);
}

.cassa-person-group__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
}

.cassa-person-group__identity {
  min-width: 0;
}

.cassa-person-group__personline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.cassa-person-group__summary {
  margin-top: 0.2rem;
  color: var(--tf-muted-text, #4b5563);
  font-size: 0.9rem;
  line-height: 1.3;
}

.cassa-person-group__details-when-open {
  display: none;
}

.cassa-person-group__details-toggle[aria-expanded="true"] .cassa-person-group__details-when-closed {
  display: none;
}

.cassa-person-group__details-toggle[aria-expanded="true"] .cassa-person-group__details-when-open {
  display: inline;
}

.cassa-person-group__details-toggle:focus-visible {
  outline: 0.2rem solid rgba(var(--tf-primary-rgb, 13, 110, 253), 0.35);
  outline-offset: 0.15rem;
}

.cassa-person-group__items {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.6rem;
}

.cassa-work-item--nested {
  padding: 0.72rem 0.78rem;
  border-color: var(--tf-border, #dee2e6);
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.96);
}

.cassa-work-item__main {
  min-width: 0;
}

.cassa-work-item__person {
  color: var(--tf-surface-text, #1f2933);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.2;
}

.cassa-work-item__meta {
  margin-top: 0.18rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.9rem;
}

.cassa-work-item__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.cassa-work-item__amount {
  min-width: 8.4rem;
  text-align: right;
}

.cassa-work-item__price {
  color: var(--tf-surface-text, #111827);
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.05;
}

.cassa-work-item__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
}

.well-checkout-manage-item {
  display: grid;
  gap: 0.75rem;
}

.well-checkout-manage-item__heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.well-checkout-manage-item__status,
.well-checkout-manage-item__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.well-checkout-manage-item__status {
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--tf-border, #dee2e6);
}

.well-checkout-manage-item__links {
  padding-top: 0.1rem;
}

.cassa-sales-list {
  display: grid;
  gap: 0.75rem;
}

.cassa-sales-filters {
  background: var(--tf-surface-bg, #fff);
  overflow: visible;
}

.cassa-sale-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.8fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.75rem;
  background: var(--tf-surface-bg, #fff);
}

.cassa-sale-row__main {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.cassa-sale-row__identity,
.cassa-sale-row__source-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.cassa-sale-row__number {
  color: var(--tf-surface-text, #1f2933);
  font-size: 1.02rem;
  font-weight: 800;
}

.cassa-sale-row__date,
.cassa-sale-row__source-meta {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.88rem;
}

.cassa-sale-row__source {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.cassa-sale-row__person {
  color: var(--tf-surface-text, #1f2933);
  font-weight: 750;
  line-height: 1.2;
}

.cassa-sale-row__financials {
  display: grid;
  grid-template-columns: repeat(3, minmax(4.8rem, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.cassa-sale-row__money {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.84);
}

.cassa-sale-row__money span {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cassa-sale-row__money strong {
  color: var(--tf-surface-text, #1f2933);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.cassa-sale-row__money small {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.78rem;
  line-height: 1.15;
}

.cassa-sale-row__money.is-due {
  background: rgba(255, 193, 7, 0.18);
}

.cassa-sale-row__money.is-due strong {
  color: var(--tf-warning-text, #7a4d00);
  font-size: 1.08rem;
}

.cassa-sale-row__money.is-settled strong {
  color: var(--tf-muted-text, #495057);
}

.cassa-sale-row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
}

.cassa-ts-box {
  border-color: rgba(25, 135, 84, 0.22);
}

.cassa-ts-box .card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cassa-ts-box__icon {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  color: var(--tf-success-text, #0f5132);
  background: rgba(25, 135, 84, 0.12);
}

.cassa-ts-box__form {
  display: grid;
  gap: 0.65rem;
}

.cassa-blocked-card {
  border-color: rgba(178, 107, 0, 0.22);
  background: linear-gradient(180deg, rgba(255, 193, 7, 0.06), var(--tf-surface-bg, #fff) 56%);
}

.cassa-blocked-list {
  display: grid;
  gap: 0.65rem;
}

.cassa-blocked-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid rgba(178, 107, 0, 0.16);
  border-radius: 0.75rem;
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.82);
}

@media (max-width: 991.98px) {
  .cassa-today-kpis {
    grid-template-columns: 1fr;
  }

  .cassa-work-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cassa-person-group__header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cassa-work-item__amount {
    min-width: 0;
    text-align: left;
  }

  .cassa-work-item__actions {
    justify-content: flex-start;
  }

  .cassa-sale-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cassa-sale-row__actions {
    justify-content: flex-start;
  }

  .cassa-rendiconto-final-readonly {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (pointer: coarse) {
  .cassa-page .btn,
  .cassa-page .form-check-input {
    min-height: 2.75rem;
  }

  .cassa-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .cassa-page .form-check-input {
    min-width: 2.75rem;
  }
}

@media (min-width: 992px) {
  .cassa-sales-filters {
    position: sticky;
    top: calc(var(--tf-sticky-top, var(--tf-navbar-height, 4.75rem)) + 0.5rem);
    z-index: 20;
    box-shadow: 0 0.55rem 1.4rem rgba(15, 23, 42, 0.08);
  }
}

@media (max-width: 575.98px) {
  .cassa-sale-row__financials {
    grid-template-columns: 1fr;
  }

  .cassa-section-nav {
    width: 100%;
  }

  .cassa-section-nav .btn {
    flex: 1 1 auto;
  }

  .cassa-rendiconto-header-meta {
    display: grid;
    gap: 0.15rem;
  }

  .cassa-rendiconto-header-meta > span::after {
    display: none;
  }

  .cassa-rendiconto-final-grid,
  .cassa-rendiconto-final-readonly {
    grid-template-columns: 1fr;
  }

  .cassa-rendiconto-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.tf-ui-step-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.85rem;
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.7);
}

.tf-ui-list-muted li + li {
  margin-top: 0.4rem;
}

.tf-ui-kpi-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}

.tf-ui-kpi-card__label {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.82rem;
}

.tf-ui-kpi-card__value {
  font-size: clamp(1.35rem, 1.1rem + 0.7vw, 1.9rem);
  line-height: 1;
  font-weight: 700;
  color: var(--tf-surface-text, #1f2933);
}

.tf-ui-kpi-card__hint {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.82rem;
}

.tf-ui-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  min-height: 1.45rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.tf-ui-badge.is-neutral {
  background: rgba(108, 117, 125, 0.11);
  color: var(--tf-muted-text, #56616c);
  border-color: rgba(108, 117, 125, 0.18);
}

.tf-ui-badge.is-success {
  background: rgba(25, 135, 84, 0.12);
  color: var(--tf-success-text, #146c43);
  border-color: rgba(25, 135, 84, 0.18);
}

.tf-ui-badge.is-warning {
  background: rgba(255, 193, 7, 0.2);
  color: var(--tf-warning-text, #8a6b00);
  border-color: rgba(255, 193, 7, 0.26);
}

.tf-ui-badge.is-danger {
  background: rgba(220, 53, 69, 0.12);
  color: var(--tf-danger-text, #b42318);
  border-color: rgba(220, 53, 69, 0.18);
}

.tf-ui-badge.is-info {
  background: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.11);
  color: var(--tf-link, #0b5ed7);
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.18);
}

.tf-ui-empty-state {
  padding: 0.88rem;
  border: 1px dashed rgba(108, 117, 125, 0.35);
  border-radius: 1rem;
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.85);
}

.tf-ui-empty-state__title {
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.tf-ui-empty-state__copy {
  margin-bottom: 0;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.875rem;
}

.tf-ui-empty-state--center {
  text-align: center;
}

.tf-ui-table.table,
.tf-ui-table .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: var(--tf-soft-bg, #f8f9fa);
  --bs-table-hover-bg: var(--tf-primary-soft, rgba(var(--tf-primary-rgb, 13, 110, 253), 0.04));
  margin-bottom: 0;
}

.tf-ui-table.table > :not(caption) > * > *,
.tf-ui-table .table > :not(caption) > * > * {
  padding-top: 0.53rem;
  padding-bottom: 0.53rem;
  border-bottom-color: var(--tf-border, #dee2e6);
}

.tf-ui-table.table thead th,
.tf-ui-table .table thead th {
  padding-top: 0.41rem;
  padding-bottom: 0.41rem;
  border-bottom-width: 1px;
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tf-ui-page .form-label {
  margin-bottom: 0.22rem;
  font-size: 0.84rem;
  line-height: 1.18;
}

.tf-ui-page .form-control,
.tf-ui-page .form-select {
  min-height: calc(1.5em + 0.54rem + 2px);
  padding: 0.27rem 0.64rem;
  font-size: 0.9rem;
  line-height: 1.28;
}

.tf-ui-page textarea.form-control {
  min-height: 0;
}

.tf-ui-page .btn {
  padding: 0.27rem 0.66rem;
  font-size: 0.9rem;
  line-height: 1.28;
}

.tf-ui-page .btn-sm,
:is(.stat-clientela-page, .stat-geography-page) #htmx-modal-content :is(.stat-clientela-modal-footer, .stat-geo-modal-footer, .stat-age-configuration, .stat-well-saved) .btn-sm {
  padding: 0.18rem 0.48rem;
  font-size: 0.85rem;
  line-height: 1.22;
}

.tf-ui-search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.85rem;
  line-height: 1;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--tf-muted-text, #8a94a0);
  pointer-events: none;
}

.tf-ui-search-input {
  min-height: 2.35rem;
  padding-left: 2.75rem;
}

.tf-ui-note {
  padding: 0.82rem 0.9rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.95) 0%, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.95) 100%);
}

.tf-ui-note__title {
  margin-bottom: 0.18rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--tf-surface-text, #1f2933);
}

.tf-ui-note__copy {
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.875rem;
  line-height: 1.4;
}

.tf-ui-form-section {
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--tf-surface-bg) 97%, var(--tf-surface-bg, #fff) 3%);
  box-shadow: 0 0.75rem 1.8rem rgba(15, 23, 42, 0.04);
}

.tf-ui-form-section .form-label {
  font-weight: 600;
}

.tf-ui-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--tf-surface-bg, #fff) 0%, var(--tf-soft-bg, #f8f9fa) 100%);
}

.tf-login-card {
  height: auto;
}

.tf-login-page {
  padding-top: clamp(2rem, 5vh, 4rem);
}

.tf-login-actions .btn-primary {
  min-width: 7rem;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .tf-login-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tf-login-actions .btn-primary {
    width: 100%;
  }
}

.tf-purchases-entry-card {
  display: block;
  height: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--tf-surface-bg) 97%, var(--tf-surface-bg, #fff) 3%);
  box-shadow: 0 0.75rem 1.8rem rgba(15, 23, 42, 0.05);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tf-purchases-entry-card:hover,
.tf-purchases-entry-card:focus {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.22);
  box-shadow: 0 0.55rem 1.2rem rgba(15, 23, 42, 0.06);
  color: inherit;
  transform: translateY(-1px);
}

.tf-purchases-filters-card .card-body {
  padding: 1rem 1.15rem;
}

.tf-purchases-field-label {
  margin-bottom: 0.35rem;
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tf-purchases-status-strip .card-body {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.tf-purchases-order-needs-attention > td:first-child {
  border-left: 0.22rem solid rgba(255, 193, 7, 0.8);
}

.tf-purchases-order-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 32rem;
}

.tf-purchases-next-action {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.2);
  background: linear-gradient(135deg, rgba(var(--tf-primary-rgb, 13, 110, 253), 0.04), rgba(var(--tf-surface-rgb, 255, 255, 255), 0.98));
}

.tf-purchases-receipts .accordion-button {
  padding: 0.8rem 1rem;
  background: transparent;
  box-shadow: none;
}

.tf-purchases-receipts .accordion-button:not(.collapsed) {
  color: inherit;
  background: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.04);
}

.tf-purchases-form-card .card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem 1rem;
}

.tf-purchases-form-card .card-body {
  padding: 0.95rem 1rem 1rem;
}

.tf-purchases-form-card .form-label {
  font-weight: 600;
}

.tf-purchases-form-card .form-text {
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.78rem;
  line-height: 1.35;
}

.tf-purchases-form-actions {
  margin-top: 1rem;
}

.tf-purchases-inline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.85rem;
}

.tf-purchases-line-row {
  padding: 0.8rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.95rem;
  background: linear-gradient(180deg, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.9) 0%, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.98) 100%);
}

.tf-purchases-line-row + .tf-purchases-line-row {
  margin-top: 0.75rem;
}

.tf-purchases-line-row .form-label {
  margin-bottom: 0.32rem;
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tf-purchases-totals-preview {
  padding: 0.85rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.95rem;
  background: linear-gradient(180deg, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.92) 0%, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.98) 100%);
}

.tf-purchases-totals-preview input[readonly] {
  background-color: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.95);
}

.tf-clienti-list__filters-card .card-body {
  padding: 1rem 1.15rem;
}

.tf-clienti-list__field-label {
  margin-bottom: 0.35rem;
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tf-clienti-list__search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.85rem;
  line-height: 1;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--tf-muted-text, #8a94a0);
  pointer-events: none;
}

.tf-clienti-list__search-input {
  min-height: 2.35rem;
  padding-left: 2.75rem;
}

.tf-clienti-list__client-link {
  color: inherit;
}

.tf-clienti-list__client-link:hover,
.tf-clienti-list__client-link:focus {
  color: var(--bs-primary);
}

.tf-clienti-list__next-action {
  line-height: 1.4;
}

.tf-preventivi-list__filters-card .card-body {
  padding: 1rem 1.15rem;
}

.tf-preventivi-list__filter-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.tf-preventivi-list__filter-pill {
  display: flex;
  min-height: 4.25rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.95rem;
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.68);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tf-preventivi-list__filter-pill:hover,
.tf-preventivi-list__filter-pill:focus {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.22);
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.95);
  box-shadow: 0 0.55rem 1.2rem rgba(15, 23, 42, 0.06);
  color: inherit;
  transform: translateY(-1px);
}

.tf-preventivi-list__filter-pill.is-active {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.24);
  background: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.07);
  box-shadow: inset 0 0 0 1px rgba(var(--tf-primary-rgb, 13, 110, 253), 0.06);
}

.tf-preventivi-list__filter-pill-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.tf-preventivi-list__filter-pill-copy,
.tf-preventivi-list__status-copy {
  line-height: 1.35;
}

.tf-preventivi-list__filter-pill-copy {
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.82rem;
}

.tf-preventivi-list__primary-link {
  color: inherit;
}

.tf-preventivi-list__primary-link:hover,
.tf-preventivi-list__primary-link:focus {
  color: var(--bs-primary);
}

.tf-ordini-list__filters-card .card-body {
  padding: 1rem 1.15rem;
}

.tf-ordini-list__filter-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.tf-ordini-list__filter-pill {
  display: flex;
  min-height: 4.1rem;
  flex-direction: column;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.95rem;
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.68);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tf-ordini-list__filter-pill:hover,
.tf-ordini-list__filter-pill:focus {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.22);
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.95);
  box-shadow: 0 0.55rem 1.2rem rgba(15, 23, 42, 0.06);
  color: inherit;
  transform: translateY(-1px);
}

.tf-ordini-list__filter-pill.is-active {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.24);
  background: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.07);
  box-shadow: inset 0 0 0 1px rgba(var(--tf-primary-rgb, 13, 110, 253), 0.06);
}

.tf-ordini-list__filter-pill-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.tf-ordini-list__filter-pill-copy,
.tf-ordini-list__status-copy {
  line-height: 1.35;
}

.tf-ordini-list__filter-pill-copy {
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.82rem;
}

.tf-ordini-list__field-label {
  margin-bottom: 0.35rem;
  color: var(--tf-muted-text, #5f6b76);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tf-ordini-list__search-icon {
  position: absolute;
  top: 50%;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.85rem;
  line-height: 1;
  transform: translateY(-50%);
  z-index: 2;
  color: var(--tf-muted-text, #8a94a0);
  pointer-events: none;
}

.tf-ordini-list__search-input {
  min-height: 2.35rem;
  padding-left: 2.75rem !important;
}

.tf-ordini-list__toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.6rem;
}

.tf-ordini-list__toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: 100%;
  margin: 0;
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.9rem;
  background: rgba(var(--tf-surface-rgb, 255, 255, 255), 0.7);
}

.tf-ordini-list__toggle .form-check-input {
  margin-top: 0.18rem;
  float: none;
  flex-shrink: 0;
}

.tf-ordini-list__toggle .form-check-label {
  color: var(--tf-surface-text, #334155);
  font-size: 0.875rem;
  line-height: 1.35;
}

.tf-ordini-list__primary-link {
  color: inherit;
}

.tf-ordini-list__primary-link:hover,
.tf-ordini-list__primary-link:focus {
  color: var(--bs-primary);
}

.tf-preventivo-detail .tf-ui-page-header {
  gap: 0.55rem 0.8rem;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.85rem;
}

.tf-preventivo-detail .tf-ui-page-header__eyebrow {
  margin-bottom: 0.18rem;
}

.tf-preventivo-detail .tf-ui-page-header__subtitle {
  margin-top: 0.12rem;
  font-size: 0.93rem;
}

.tf-preventivo-detail .tf-ui-page-header__meta {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.tf-preventivo-detail .tf-ui-page-header__aside {
  gap: 0.55rem;
}

.tf-preventivo-detail .tf-ui-actionbar {
  gap: 0.45rem;
}

.tf-preventivo-detail .tf-ui-actionbar .btn {
  --bs-btn-padding-y: 0.28rem;
  --bs-btn-padding-x: 0.55rem;
}

.tf-preventivo-detail .tf-preventivo-detail__context .card-header,
.tf-preventivo-detail .tf-preventivo-detail__workflow .card-header {
  padding: 0.62rem 0.85rem 0.48rem;
}

.tf-preventivo-detail .tf-preventivo-detail__context .card-body,
.tf-preventivo-detail .tf-preventivo-detail__workflow .card-body,
.tf-preventivo-detail .tf-preventivo-detail__secondary .card-body,
.tf-preventivo-detail .tf-preventivo-detail__notes .card-body {
  padding: 0.66rem 0.85rem 0.72rem;
}

.tf-preventivo-detail .tf-preventivo-detail__secondary .card-header,
.tf-preventivo-detail .tf-preventivo-detail__notes .card-header {
  padding: 0.66rem 0.85rem 0.48rem;
}

.tf-preventivo-detail .tf-preventivo-detail__context .tf-ui-detail-label,
.tf-preventivo-detail .tf-preventivo-detail__workflow .tf-ui-detail-label,
.tf-preventivo-detail .tf-preventivo-detail__secondary .tf-ui-detail-label,
.tf-preventivo-detail .tf-preventivo-detail__notes .tf-ui-detail-label {
  margin-bottom: 0.12rem;
}

.tf-preventivo-detail .tf-preventivo-detail__context .fw-semibold,
.tf-preventivo-detail .tf-preventivo-detail__workflow .fw-semibold,
.tf-preventivo-detail .tf-preventivo-detail__secondary .fw-semibold,
.tf-preventivo-detail .tf-preventivo-detail__notes .fw-semibold {
  line-height: 1.3;
}

.tf-preventivo-detail .tf-preventivo-detail__context .small,
.tf-preventivo-detail .tf-preventivo-detail__workflow .small,
.tf-preventivo-detail .tf-preventivo-detail__secondary .small,
.tf-preventivo-detail .tf-preventivo-detail__notes .small {
  line-height: 1.35;
}

.tf-preventivo-detail .tf-preventivo-detail__context-section {
  padding: 0.1rem 0;
}

.tf-preventivo-detail .tf-preventivo-detail__context-divider {
  border-top: 1px solid var(--bs-border-color);
  opacity: 0.9;
}

.tf-preventivo-detail .tf-preventivo-detail__notes .tf-ui-card__subtitle,
.tf-preventivo-detail .tf-preventivo-detail__workflow .tf-ui-card__subtitle,
.tf-preventivo-detail .tf-preventivo-detail__secondary .tf-ui-card__subtitle {
  margin-top: 0.12rem;
}

@media screen {
  .tf-preventivo-detail .print-only {
    display: none !important;
  }
}

/* Adapt metadata to its actual card width, including inside the shared modal. */
.tf-preventivo-detail__context {
  container: quote-context / inline-size;
}

@container quote-context (min-width: 560px) and (max-width: 950px) {
  .tf-preventivo-detail__context-grid > .col-xl-4 {
    width: 100%;
  }

  .tf-preventivo-detail__context-grid > .col-md-6 {
    width: 50%;
  }
}

.modal-body .tf-preventivo-detail__rows {
  max-height: none;
  overflow-x: auto;
}

/* Quote detail keeps operational status alongside the offer on desktop. */
.tf-preventivo-detail .tf-preventivo-detail__layout .tf-ui-card {
  height: auto;
}

.tf-preventivo-detail .tf-preventivo-detail__sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tf-preventivo-detail .tf-preventivo-detail__package,
.tf-preventivo-detail .tf-preventivo-detail__context-section,
.tf-preventivo-detail .tf-preventivo-detail__sidebar .fw-semibold {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tf-preventivo-detail .tf-preventivo-detail__rows:focus-visible {
  outline: 2px solid var(--tf-primary);
  outline-offset: -2px;
}

@media screen and (min-width: 1200px) {
  .tf-preventivo-detail .tf-preventivo-detail__rows {
    max-height: clamp(16rem, 36vh, 28rem);
    overflow: auto;
    overscroll-behavior: contain;
  }

  .tf-preventivo-detail .tf-preventivo-detail__rows table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .tf-preventivo-detail .tf-preventivo-detail__rows thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--tf-surface-bg);
  }
}

@media print {
  .tf-preventivo-detail .tf-preventivo-detail__rows {
    max-height: none;
    overflow: visible;
  }

  .tf-preventivo-detail .tf-preventivo-detail__rows thead th {
    position: static;
  }

  .tf-preventivo-detail .tf-preventivo-detail__layout,
  .tf-preventivo-detail .tf-preventivo-detail__sidebar {
    display: block;
  }

  .tf-preventivo-detail .tf-preventivo-detail__layout > div {
    width: 100%;
  }
}

.tf-preventivo-detail .tf-preventivo-detail__context-table > :not(caption) > * > * {
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
}

.tf-preventivo-detail .tf-preventivo-detail__context-table thead th {
  padding-top: 0.4rem;
  padding-bottom: 0.34rem;
  white-space: nowrap;
}

.tf-preventivo-detail .tf-preventivo-detail__accesso .card-body {
  padding-top: 0.6rem;
  padding-bottom: 0.66rem;
}

.tf-preventivo-detail .tf-preventivo-detail__accesso .border-top {
  padding-top: 0.58rem !important;
  margin-top: 0.58rem !important;
}

.tf-preventivo-detail .tf-preventivo-detail__notes-section {
  padding-top: 0.05rem !important;
}

.tf-preventivo-detail .tf-preventivo-detail__notes-section .tf-ui-card__title {
  margin-bottom: 0.1rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__header {
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.8rem;
  gap: 0.45rem 0.65rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__header .tf-ui-page-header__eyebrow {
  margin-bottom: 0.15rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__header .tf-ui-page-header__title {
  font-size: clamp(1.3rem, 1.1rem + 0.55vw, 1.7rem);
}

body.tf-ordine-detail-page .tf-ordine-detail__header .tf-ui-page-header__aside {
  gap: 0.4rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__context .card-body,
body.tf-ordine-detail-page .tf-ordine-detail__workflow .card-body,
body.tf-ordine-detail-page .tf-ordine-detail__secondary .card-body,
body.tf-ordine-detail-page .tf-ordine-detail__payments .card-body,
body.tf-ordine-detail-page .tf-ordine-detail__overflow .card-body,
body.tf-ordine-detail-page .tf-ordine-detail__righe .card-body {
  padding-top: 0.66rem;
  padding-bottom: 0.72rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__context .card-body {
  padding-top: 0.5rem;
  padding-bottom: 0.55rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__context .card-header,
body.tf-ordine-detail-page .tf-ordine-detail__workflow .card-header,
body.tf-ordine-detail-page .tf-ordine-detail__secondary .card-header,
body.tf-ordine-detail-page .tf-ordine-detail__payments .card-header,
body.tf-ordine-detail-page .tf-ordine-detail__overflow .card-header,
body.tf-ordine-detail-page .tf-ordine-detail__righe .card-header {
  padding-top: 0.52rem;
  padding-bottom: 0.36rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__context .tf-ui-detail-label,
body.tf-ordine-detail-page .tf-ordine-detail__workflow .tf-ui-detail-label,
body.tf-ordine-detail-page .tf-ordine-detail__secondary .tf-ui-detail-label,
body.tf-ordine-detail-page .tf-ordine-detail__payments .tf-ui-detail-label,
body.tf-ordine-detail-page .tf-ordine-detail__status-strip .tf-ui-detail-label {
  margin-bottom: 0.1rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__context .small,
body.tf-ordine-detail-page .tf-ordine-detail__workflow .small,
body.tf-ordine-detail-page .tf-ordine-detail__secondary .small,
body.tf-ordine-detail-page .tf-ordine-detail__payments .small {
  line-height: 1.3;
}

body.tf-ordine-detail-page .tf-ordine-detail__context .fw-semibold,
body.tf-ordine-detail-page .tf-ordine-detail__workflow .fw-semibold,
body.tf-ordine-detail-page .tf-ordine-detail__secondary .fw-semibold,
body.tf-ordine-detail-page .tf-ordine-detail__payments .fw-semibold {
  line-height: 1.25;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-section {
  padding: 0.02rem 0;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-divider {
  border-top: 1px solid var(--bs-border-color);
  opacity: 0.9;
  margin-top: 0.14rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-grid--top {
  row-gap: 0.32rem !important;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-mini-grid {
  row-gap: 0.28rem !important;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-badges {
  margin-bottom: 0.35rem !important;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-content-head {
  margin-top: 0.05rem;
  margin-bottom: 0.25rem !important;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-pricing-note {
  max-width: 26rem;
  line-height: 1.2;
}

body.tf-ordine-detail-page .tf-ordine-detail__section-separator {
  margin-top: 0.18rem;
  padding-top: 0.38rem;
  border-top: 1px solid var(--tf-border, #dee2e6);
}

body.tf-ordine-detail-page .tf-ordine-detail__context-table > :not(caption) > * > * {
  padding-top: 0.36rem;
  padding-bottom: 0.36rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__context-table thead th {
  padding-top: 0.3rem;
  padding-bottom: 0.24rem;
  white-space: nowrap;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-actions {
  justify-content: flex-end;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-grid {
  row-gap: 0.32rem !important;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-panel {
  padding: 0.02rem 0;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-summary .fw-semibold {
  line-height: 1.2;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-update {
  margin-top: 0.28rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-section {
  margin-top: 0.08rem;
  padding-top: 0.32rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-invoice {
  margin-bottom: 0.28rem !important;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-table > :not(caption) > * > * {
  padding-top: 0.34rem;
  padding-bottom: 0.34rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__payments-table thead th {
  padding-top: 0.24rem;
  padding-bottom: 0.2rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__righe .table > :not(caption) > * > *,
body.tf-ordine-detail-page .tf-ordine-detail__payments .table > :not(caption) > * > *,
body.tf-ordine-detail-page .tf-ordine-detail__overflow .table > :not(caption) > * > * {
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
}

body.tf-ordine-detail-page .tf-ordine-detail__alert {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

@media (min-width: 1400px) and (min-height: 800px) {
  body.tf-ordine-detail-page .tf-ordine-detail__header {
    margin-bottom: 0.2rem;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
  }

  body.tf-ordine-detail-page .tf-ordine-detail__section-row {
    margin-bottom: 0.2rem !important;
  }

  body.tf-ordine-detail-page .tf-ordine-detail__context .card-header,
  body.tf-ordine-detail-page .tf-ordine-detail__payments .card-header {
    padding-top: 0.3rem;
    padding-bottom: 0.22rem;
  }

  body.tf-ordine-detail-page .tf-ordine-detail__context .card-body,
  body.tf-ordine-detail-page .tf-ordine-detail__payments .card-body {
    padding-top: 0.32rem;
    padding-bottom: 0.35rem;
  }

  body.tf-ordine-detail-page .tf-app-footer {
    margin-top: 0.15rem;
    padding-top: 0.1rem;
    padding-bottom: 0.15rem;
    font-size: 0.72rem;
    line-height: 1;
  }
}

@media (max-width: 767.98px) {
  .tf-ui-page-header,
  .tf-ui-card .card-header,
  .tf-ui-card .card-body,
  .tf-ui-card .card-footer,
  .tf-ui-card__header,
  .tf-ui-card__body,
  .tf-ui-card__footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .tf-ui-page-header__aside {
    width: 100%;
    align-items: stretch;
  }

  .tf-ui-actionbar > * {
    flex: 1 1 auto;
  }

  .tf-persona-detail-sticky-header {
    top: var(--tf-navbar-offset, 4.25rem);
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .tf-persona-detail-sticky-header .d-inline-flex {
    width: 100%;
  }

  .tf-persona-detail-sticky-header .btn,
  .tf-persona-detail-sticky-header form {
    flex: 1 1 auto;
  }

  .tf-persone-list-filters {
    margin-right: -0.25rem;
    margin-left: -0.25rem;
    padding: 0.55rem;
  }

  .tf-persone-list-filters__form {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-persone-list-filters__actions {
    justify-content: stretch;
  }

  .tf-persone-list-filters__actions .btn {
    flex: 1 1 auto;
  }

  .tf-ui-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.modal-body-scroll {
  max-height: 70vh;
  overflow-y: auto;
}

.tf-help-page {
  width: min(100%, 72rem);
}

.tf-help-search {
  width: min(100%, 28rem);
}

.tf-help-article__content {
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.tf-help-article__content h2,
.tf-help-article__content h3,
.tf-help-article__content h4 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.tf-help-article__content h2:first-child,
.tf-help-article__content h3:first-child,
.tf-help-article__content h4:first-child {
  margin-top: 0;
}

.tf-help-article__content p,
.tf-help-article__content ul,
.tf-help-article__content ol {
  margin-bottom: 1rem;
}

.tf-help-article__content ol > li + li {
  margin-top: 0.5rem;
}

#htmxModal .modal-dialog:has(.tf-user-created-modal) {
  max-width: min(42rem, calc(100vw - 1rem));
}

#htmxModal .tf-user-created-modal {
  padding: 0;
}

#htmxModal .tf-user-created-modal > [data-user-created] {
  margin: 0 !important;
  border: 0;
  box-shadow: none !important;
}

#htmxModal .modal-dialog.tf-modal-help-article {
  max-width: min(52rem, calc(100vw - 1rem));
}

#htmxModal .modal-dialog.tf-modal-help-article .modal-content {
  max-height: 100%;
  overflow: hidden;
}

#htmxModal .tf-modal-help-article [data-modal-layout="help-article"] {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

#htmxModal .modal-dialog.tf-modal-help-article .modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

#htmxModal .tf-modal-help-article .tf-help-article__content h2 {
  font-size: 1.125rem;
}

#htmxModal .tf-modal-help-article .tf-help-article__content h3,
#htmxModal .tf-modal-help-article .tf-help-article__content h4 {
  font-size: 1rem;
}

#htmxModal .tf-modal-help-article .tf-help-article__content :is(h2, h3, h4) {
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

#htmxModal .tf-modal-help-article .tf-help-article__content :is(h2, h3, h4):first-child {
  margin-top: 0;
}

@media (max-width: 575.98px) {
  .tf-help-search {
    width: 100%;
  }

  #htmxModal .modal-dialog.tf-modal-help-article {
    margin: 0.5rem;
  }
}

.modal-dialog.tf-modal-well-qr-checkin {
  max-width: 56rem;
}

/* Only the arrivals body scrolls; search and page controls stay reachable. */
.tf-modal-well-arrivals .well-arrivals-workspace {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tf-modal-well-arrivals .modal-header,
.tf-modal-well-arrivals .modal-footer {
  flex-shrink: 0;
}

.well-arrivals-workspace .list-group-item {
  overflow-wrap: anywhere;
}

/* Keep queue search and navigation outside the Bootstrap scrolling body. */
.tf-modal-well-cash-queue .well-cash-queue-workspace {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tf-modal-well-cash-queue .modal-header,
.tf-modal-well-cash-queue .modal-footer {
  flex-shrink: 0;
}

.well-cash-queue-content [data-well-cash-person-id] {
  overflow-wrap: anywhere;
}

@media (min-width: 992px) {
  #htmxModal .modal-dialog.tf-modal-cliente-form {
    max-width: min(1320px, calc(100vw - 1.5rem));
    height: calc(100vh - 1rem);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.96rem;
  }

  #htmxModal .modal-dialog.tf-modal-cliente-form .modal-content {
    height: 100%;
  }

  #htmxModal .modal-dialog.tf-modal-cliente-form .modal-body {
    overflow-y: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  #htmxModal .modal-dialog.tf-modal-cliente-form .modal-header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

@media (min-width: 992px) and (min-height: 860px) {
  #htmxModal .modal-dialog.tf-modal-cliente-form {
    height: auto;
    min-height: 0;
  }

  #htmxModal .modal-dialog.tf-modal-cliente-form .modal-content {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  #htmxModal .modal-dialog.tf-modal-cliente-form .modal-body {
    overflow-y: visible;
  }
}

/* scroll orizzontale */
.table-responsive.tf-table-scroll-x {
  overflow-x: auto;
  overflow-y: visible !important;   /* override bootstrap */
  position: relative;
  padding-bottom: 2.5rem;           /* spazio per dropdown */
}

/* wrapper interno: permette ai dropdown di uscire */
.table-responsive.tf-table-scroll-x .tf-table-overflow-visible {
  overflow: visible;
  min-width: 100%;
}

/* dropdown sopra card/righe */
.table-responsive.tf-table-scroll-x .dropdown-menu {
  z-index: 1080;
}

.tf-dropdown-submenu {
  position: relative;
}

.tf-dropdown-submenu > .dropdown-menu {
  top: -0.35rem;
  left: calc(100% - 0.15rem);
  margin-top: 0;
  display: none;
}

.tf-dropdown-submenu:hover > .dropdown-menu,
.tf-dropdown-submenu:focus-within > .dropdown-menu {
  display: block;
}

.tf-urgent-table-scroll {
  max-height: 52vh;
  overflow-y: auto;
}

.tf-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .40rem .55rem;
  border-radius: .85rem;

  /* neutro e sempre gradevole */
  background: linear-gradient(135deg, rgba(var(--tf-surface-rgb, 255, 255, 255), .95), rgba(222, 226, 230, .95));
  border: 1px solid rgba(0, 0, 0, .10);

  /* “card feel” leggero */
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .10),
    0 6px 18px rgba(0, 0, 0, .06);
}

.tf-brand-logo--plain {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

@supports ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {
  .tf-brand-logo {
    background: rgba(var(--tf-surface-rgb, 255, 255, 255), .75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }

  .tf-brand-logo--plain {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.tf-brand-logo__img {
  height: 56px;
  max-width: 240px;
  object-fit: contain;

  /* fa “staccare” i loghi bianchi/trasparenti senza rovinare quelli neri */
  filter:
    drop-shadow(0 1px 2px rgba(0, 0, 0, .35))
    drop-shadow(0 0 1px rgba(0, 0, 0, .45));
}

/* Variante grande (anteprima branding) */
.tf-brand-logo--lg .tf-brand-logo__img {
  height: 70px;
}

/* tabelle con dropdown che devono uscire dal wrapper */
.table-responsive.overflow-visible {
  overflow-x: auto;
  overflow-y: visible;
}

.table-responsive.overflow-visible .dropdown-menu {
  z-index: 1050;
}

/* utility per sostituire inline style nei template */
.tf-logo-login {
  height: 56px;
}

.tf-logo-navbar {
  height: 48px;
}

.tf-dashboard-metric-card {
  display: block;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--tf-surface-bg) 97%, var(--tf-surface-bg, #fff) 3%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tf-dashboard-metric-card:hover {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.35);
  box-shadow: 0 0.2rem 0.5rem rgba(33, 37, 41, 0.08);
  transform: translateY(-1px);
}

.tf-dashboard-metric-card:focus,
.tf-dashboard-metric-card:focus-visible {
  outline: 0;
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.65);
  box-shadow: 0 0 0 0.2rem rgba(var(--tf-primary-rgb, 13, 110, 253), 0.15);
}

.tf-dashboard-metric-card__hint {
  color: var(--tf-muted-text, #6c757d);
}

.tf-dashboard-attention-card {
  display: block;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--tf-surface-bg) 97%, var(--tf-surface-bg, #fff) 3%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tf-dashboard-attention-card.is-warning {
  border-color: rgba(255, 193, 7, 0.58);
  background: color-mix(in srgb, var(--tf-surface-bg) 88%, #fff3cd 12%);
}

.tf-dashboard-attention-card.is-primary {
  border-color: rgba(var(--tf-primary-rgb, 13, 110, 253), 0.42);
  background: color-mix(in srgb, var(--tf-surface-bg) 90%, #cfe2ff 10%);
}

a.tf-dashboard-attention-card:hover,
button.tf-dashboard-attention-card:hover,
a.tf-dashboard-attention-card:focus-visible,
button.tf-dashboard-attention-card:focus-visible {
  border-color: var(--tf-link, var(--tf-primary));
  box-shadow: 0 0 0 0.18rem rgba(var(--tf-primary-rgb, 13, 110, 253), 0.12);
  outline: 0;
}

.tf-dashboard-metric-card--action {
  border-left: 0.2rem solid color-mix(in srgb, #ffc107 72%, var(--tf-primary) 28%);
}

.tf-dashboard-metric-card:hover .tf-dashboard-metric-card__hint,
.tf-dashboard-metric-card:focus .tf-dashboard-metric-card__hint,
.tf-dashboard-metric-card:focus-visible .tf-dashboard-metric-card__hint {
  color: var(--tf-link, var(--tf-primary));
}

body.tf-dashboard-page .navbar {
  margin-bottom: 0.25rem !important;
}

body.tf-dashboard-page .tf-ui-page {
  padding-top: 0;
  padding-bottom: 0;
}

body.tf-dashboard-page .tf-ui-page-header {
  margin-bottom: 0.55rem;
  padding: 0.65rem 0.9rem;
  gap: 0.45rem 0.8rem;
}

body.tf-dashboard-page .tf-ui-page-header__eyebrow,
body.tf-dashboard-page .tf-ui-section-heading__eyebrow {
  margin-bottom: 0.1rem;
}

body.tf-dashboard-page .tf-ui-page-header__subtitle {
  margin-top: 0.15rem;
}

body.tf-dashboard-page .tf-ui-page-header__meta {
  display: none;
}

body.tf-dashboard-page .tf-ui-page-header__aside {
  gap: 0.45rem;
}

body.tf-dashboard-page .tf-ui-card .card-header,
body.tf-dashboard-page .tf-ui-card__header {
  padding: 0.62rem 0.85rem 0.45rem;
}

body.tf-dashboard-page .tf-ui-card .card-body,
body.tf-dashboard-page .tf-ui-card__body {
  padding: 0.45rem 0.7rem 0.5rem;
}

body.tf-dashboard-page .tf-ui-card .card-footer,
body.tf-dashboard-page .tf-ui-card__footer {
  padding: 0.5rem 0.85rem 0.6rem;
}

body.tf-dashboard-page .tf-ui-section-heading {
  gap: 0.25rem 0.6rem;
  margin-bottom: 0.3rem;
}

body.tf-dashboard-page .tf-dashboard-section-heading--inline .tf-ui-section-heading__eyebrow {
  margin-bottom: 0;
}

body.tf-dashboard-page .tf-dashboard-section-heading--inline .tf-ui-section-heading__title,
body.tf-dashboard-page .tf-dashboard-section-heading--inline .tf-ui-section-heading__subtitle {
  line-height: 1.15;
}

body.tf-dashboard-page .tf-dashboard-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
}

body.tf-dashboard-page .tf-ui-section-heading__subtitle,
body.tf-dashboard-page .tf-ui-card__subtitle,
body.tf-dashboard-page .tf-dashboard-metric-card__hint {
  font-size: 0.8rem;
}

body.tf-dashboard-page .tf-dashboard-metric-card {
  min-height: 0;
}

body.tf-dashboard-page .tf-dashboard-attention-card {
  padding: 0.45rem 0.58rem;
}

body.tf-dashboard-page .tf-dashboard-sales-card .card-body > .mb-2 {
  margin-bottom: 0.4rem !important;
}

body.tf-dashboard-page .tf-dashboard-metric-card.px-3.py-3,
body.tf-dashboard-page .tf-dashboard-metric-card.text-start.px-3.py-3 {
  padding: 0.5rem 0.72rem !important;
}

body.tf-dashboard-page #dashboard-kpis .row.g-3 {
  --bs-gutter-x: 0.5rem;
  --bs-gutter-y: 0.35rem;
}

body.tf-dashboard-page #dashboard-kpis .card.mb-3,
body.tf-dashboard-page #dashboard-kpis .shadow-sm.mb-3 {
  margin-bottom: 0.35rem !important;
}

body.tf-dashboard-page #dashboard-kpis .card.mb-2,
body.tf-dashboard-page #dashboard-kpis .shadow-sm.mb-2,
body.tf-dashboard-page .tf-dashboard-accounting-cluster.mb-2 {
  margin-bottom: 0.35rem !important;
}

body.tf-dashboard-page #dashboard-kpis .card.shadow-sm .card-body,
body.tf-dashboard-page #dashboard-kpis .shadow-sm .card-body {
  padding: 0.42rem 0.65rem !important;
}

body.tf-dashboard-page #dashboard-kpis .card.shadow-sm .card-header,
body.tf-dashboard-page #dashboard-kpis .shadow-sm .card-header {
  padding: 0.5rem 0.75rem !important;
}

body.tf-dashboard-page #dashboard-kpis .card.shadow-sm .border.rounded.bg-white,
body.tf-dashboard-page #dashboard-kpis .shadow-sm .border.rounded.bg-white,
body.tf-dashboard-page #dashboard-kpis .card.shadow-sm a.border.rounded.bg-white,
body.tf-dashboard-page #dashboard-kpis .shadow-sm a.border.rounded.bg-white {
  padding: 0.45rem 0.6rem !important;
}

body.tf-dashboard-page #dashboard-kpis .mb-2.mt-4,
body.tf-dashboard-page #dashboard-kpis .mb-1.mt-3,
body.tf-dashboard-page #dashboard-kpis .mb-1.mt-2,
body.tf-dashboard-page #dashboard-kpis .mb-1.mt-1 {
  margin-top: 0.35rem !important;
  margin-bottom: 0.25rem !important;
}

body.tf-dashboard-page #dashboard-kpis .row.g-2.mb-2,
body.tf-dashboard-page #dashboard-kpis .d-flex.flex-wrap.gap-2.mb-2 {
  margin-bottom: 0.35rem !important;
}

body.tf-dashboard-page #dashboard-kpis .d-flex.flex-wrap.gap-2.mb-2,
body.tf-dashboard-page #dashboard-kpis .d-flex.flex-wrap.gap-2 {
  gap: 0.35rem !important;
}

body.tf-dashboard-page #dashboard-urgent .card-header {
  padding: 0.35rem 0.6rem !important;
}

body.tf-dashboard-page #dashboard-urgent .card-body {
  padding: 0.3rem 0.6rem 0.35rem !important;
}

body.tf-dashboard-page #dashboard-urgent .table > :not(caption) > * > * {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

body.tf-dashboard-page .tf-dashboard-ddt-strip .card-body {
  padding: 0.35rem 0.6rem !important;
}

body.tf-dashboard-page .tf-app-footer {
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  padding-bottom: 0.5rem;
}

body.tf-dashboard-page #dashboard-urgent,
body.tf-dashboard-page #dashboard-urgent .tf-ui-card,
body.tf-dashboard-page #dashboard-urgent .table-responsive,
body.tf-dashboard-page #dashboard-urgent .tf-urgent-table-scroll,
body.tf-dashboard-page .tf-dashboard-urgent-table {
  overflow: visible;
}

body.tf-dashboard-page #dashboard-urgent .tf-urgent-table-scroll,
body.tf-dashboard-page .tf-dashboard-urgent-table {
  max-height: none;
}

body.tf-dashboard-page #dashboard-urgent .dropdown-menu {
  z-index: 1080;
}

.tf-img-max-h-140 {
  max-height: 140px;
}

.tf-img-preventivo-logo {
  max-height: 44px;
  max-width: 180px;
}

.tf-preview-navbar {
  background: #212529;
  color: #f8f9fa;
}

.tf-preview-badge-primary {
  background: #0d6efd;
}

.tf-preview-badge-accent {
  background: #198754;
}

.tf-minw-140 {
  min-width: 140px;
}

.tf-minw-160 {
  min-width: 160px;
}

.tf-minw-180 {
  min-width: 180px;
}

.tf-minw-220 {
  min-width: 220px;
}

.tf-minw-240 {
  min-width: 240px;
}

.tf-minw-320 {
  min-width: 320px;
}

.tf-w-110 {
  width: 110px;
}

.tf-w-140 {
  width: 140px;
}

.tf-inline-form {
  display: inline;
}

.tf-inline-form-spaced {
  display: inline;
  margin-left: 10px;
}

.tf-break-all {
  word-break: break-all;
}

.tf-company-card-body .form-label {
  margin-bottom: 0.1rem;
  font-size: 0.8rem;
  line-height: 1.1;
}

.tf-branding-shell {
  max-width: 1760px;
  margin: 0 auto;
}

.tf-branding-header {
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

.tf-branding-card {
  border-radius: 1.25rem;
}

.tf-branding-logo-stage__surface {
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem;
  border: 1px dashed rgba(108, 117, 125, 0.35);
  border-radius: 1rem;
  background:
    linear-gradient(135deg, rgba(var(--tf-surface-rgb, 255, 255, 255), 0.95), rgba(var(--tf-surface-rgb, 255, 255, 255), 0.95));
}

.tf-branding-logo-placeholder {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  text-align: center;
  max-width: 18rem;
}

.tf-branding-logo-placeholder__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 0.95rem;
  background: var(--tf-surface-bg, #fff);
  color: var(--tf-muted-text, #6c757d);
  border: 1px solid rgba(108, 117, 125, 0.15);
  box-shadow: 0 0.65rem 1.4rem rgba(33, 37, 41, 0.08);
}

.tf-branding-logo-placeholder__mark i {
  font-size: 1.15rem;
}

.tf-branding-color-field {
  height: 100%;
  padding: 0.85rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 1rem;
  background: var(--tf-surface-bg, #fff);
}

.tf-branding-page .form-control-color {
  width: 3.15rem;
  min-width: 3.15rem;
  height: 2.75rem;
  padding: 0.25rem;
  border-radius: 0.8rem;
}

.tf-branding-color-swatch {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.45rem;
  border: 1px solid var(--tf-border, #dee2e6);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.tf-branding-actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 1rem;
  background: linear-gradient(180deg, var(--tf-surface-bg, #fff) 0%, var(--tf-soft-bg, #f8f9fa) 100%);
}

.tf-branding-card .card-body > .d-flex.mb-3 {
  margin-bottom: 0.85rem !important;
}

.tf-branding-card .form-text {
  margin-top: 0.35rem;
}

.tf-theme-selector {
  padding: 0.9rem 1rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, var(--tf-surface-bg, #fff) 0%, var(--tf-soft-bg, #f8f9fa) 100%);
}

.tf-theme-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.tf-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--tf-border, #dee2e6);
  border-radius: 999px;
  background: var(--tf-surface-bg, #fff);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tf-theme-pill:hover,
.tf-theme-pill.is-active {
  border-color: rgba(var(--tf-primary-rgb, 37, 99, 235), 0.38);
  box-shadow: 0 0.65rem 1.35rem rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.tf-theme-pill.is-active {
  box-shadow:
    0 0.7rem 1.45rem rgba(15, 23, 42, 0.08),
    0 0 0 0.16rem rgba(var(--tf-primary-rgb, 37, 99, 235), 0.08);
}

.tf-theme-pill__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tf-theme-pill__swatch {
  position: relative;
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, var(--tf-pill-nav) 0 38%, var(--tf-pill-surface, #fff) 38% 100%);
  border: 1px solid rgba(33, 37, 41, 0.1);
  overflow: hidden;
  flex: 0 0 auto;
}

.tf-theme-pill__swatch::before,
.tf-theme-pill__swatch::after {
  content: "";
  position: absolute;
  bottom: 0.38rem;
  height: 0.42rem;
  border-radius: 999px;
}

.tf-theme-pill__swatch::before {
  left: 0.38rem;
  width: 0.95rem;
  background: var(--tf-pill-primary);
}

.tf-theme-pill__swatch::after {
  right: 0.38rem;
  width: 0.5rem;
  background: var(--tf-pill-accent);
}

.tf-theme-pill__label {
  font-weight: 600;
  color: var(--tf-surface-text, #1f2937);
}

.tf-theme-pill__badge {
  display: none;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(var(--tf-primary-rgb, 37, 99, 235), 0.12);
  color: var(--tf-link, #1d4ed8);
  font-size: 0.72rem;
  font-weight: 700;
}

.tf-theme-pill__badge.is-visible {
  display: inline-flex;
}

.tf-branding-preview-card {
  min-height: 100%;
}

.tf-branding-preview-theme-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(var(--tf-primary-rgb, 37, 99, 235), 0.08);
  color: var(--tf-link);
  border: 1px solid rgba(var(--tf-primary-rgb, 37, 99, 235), 0.14);
  font-weight: 700;
}

.tf-branding-contrast-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--tf-soft-bg, #f8f9fa);
  color: var(--tf-muted-text, #6c757d);
  border: 1px solid var(--tf-border, #dee2e6);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 0.4rem 1rem rgba(15, 23, 42, 0.05);
}

.tf-branding-contrast-indicator.is-good {
  background: rgba(25, 135, 84, 0.14);
  color: var(--tf-success-text, #146c43);
  border-color: rgba(25, 135, 84, 0.24);
}

.tf-branding-contrast-indicator.is-weak {
  background: rgba(255, 193, 7, 0.2);
  color: var(--tf-warning-text, #997404);
  border-color: rgba(255, 193, 7, 0.34);
}

.tf-branding-preview {
  --tf-branding-preview-primary: #0d6efd;
  --tf-branding-preview-accent: #198754;
  --tf-branding-preview-nav-bg: #212529;
  --tf-branding-preview-nav-text: #f8f9fa;
  --tf-branding-preview-page-bg: #f8f9fa;
  --tf-branding-preview-surface-bg: #ffffff;
  --tf-branding-preview-text: #212529;
  --tf-branding-preview-muted: #5c6670;
  --tf-branding-preview-on-primary: #fff;
  --tf-branding-preview-on-accent: #fff;
  --tf-branding-preview-accent-text: #146c43;
  --tf-surface-text: var(--tf-branding-preview-text);
  --tf-muted-text: var(--tf-branding-preview-muted);
}

.tf-branding-preview__frame {
  overflow: hidden;
  border: 1px solid rgba(33, 37, 41, 0.08);
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.6), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--tf-branding-preview-page-bg) 92%, #ffffff 8%) 0%, var(--tf-branding-preview-page-bg) 100%);
  box-shadow:
    0 1.35rem 3.6rem rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.tf-branding-preview__navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--tf-branding-preview-nav-bg);
  color: var(--tf-branding-preview-nav-text);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.tf-branding-preview__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
}

.tf-branding-preview__brand-logo,
.tf-branding-preview__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  flex: 0 0 auto;
}

.tf-branding-preview__brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.3rem;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.tf-branding-preview__navlinks {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
  opacity: 0.94;
}

.tf-branding-preview__status {
  color: var(--tf-branding-preview-nav-bg);
  background: var(--tf-branding-preview-nav-text);
}

.tf-branding-preview__body {
  padding: 1.5rem;
  background: var(--tf-branding-preview-page-bg);
  color: var(--tf-branding-preview-text);
}

.tf-branding-preview__title {
  font-size: clamp(1.75rem, 2.3vw, 2.35rem);
  line-height: 1.06;
  margin-bottom: 0.7rem;
}

.tf-branding-preview__copy {
  max-width: 31rem;
  margin-bottom: 1.25rem;
  color: var(--tf-branding-preview-muted);
  font-size: 0.95rem;
}

.tf-branding-preview__btn-primary {
  color: var(--tf-branding-preview-on-primary);
  background: var(--tf-branding-preview-primary);
  border-color: var(--tf-branding-preview-primary);
  box-shadow: 0 0.5rem 1.4rem rgba(var(--tf-primary-rgb, 13, 110, 253), 0.18);
}

.tf-branding-preview__btn-primary:hover,
.tf-branding-preview__btn-primary:focus {
  color: var(--tf-branding-preview-on-primary);
  background: var(--tf-branding-preview-primary);
  border-color: var(--tf-branding-preview-primary);
}

.tf-branding-preview__btn-secondary {
  color: var(--tf-branding-preview-text);
  background: color-mix(in srgb, var(--tf-branding-preview-surface-bg) 92%, #ffffff 8%);
  border: 1px solid rgba(33, 37, 41, 0.12);
}

.tf-branding-preview__accent-badge,
.tf-branding-preview__metric-badge,
.tf-branding-preview__list-pill {
  background: var(--tf-branding-preview-accent);
  color: var(--tf-branding-preview-on-accent);
}

.tf-branding-preview__link {
  color: var(--tf-branding-preview-accent-text);
  text-decoration: none;
  font-weight: 600;
}

.tf-branding-preview__link:hover,
.tf-branding-preview__link:focus {
  color: var(--tf-branding-preview-accent-text);
  text-decoration: underline;
}

.tf-branding-preview__module {
  border-radius: 1.3rem;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--tf-branding-preview-surface-bg) 96%, #ffffff 4%) 0%,
    color-mix(in srgb, var(--tf-branding-preview-surface-bg) 88%, var(--tf-branding-preview-page-bg) 12%) 100%
  );
}

.tf-branding-preview__stat {
  height: 100%;
  padding: 0.8rem 0.85rem;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--tf-branding-preview-surface-bg) 96%, #ffffff 4%);
  border: 1px solid rgba(33, 37, 41, 0.06);
}

.tf-branding-preview__list {
  display: grid;
  gap: 0.5rem;
}

.tf-branding-preview__list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--tf-branding-preview-surface-bg) 96%, #ffffff 4%);
  border: 1px solid rgba(33, 37, 41, 0.06);
}

.letter-spacing-1 {
  letter-spacing: 0.08em;
}

@media (max-width: 991.98px) {
  .tf-branding-hero__aside {
    max-width: none;
    width: 100%;
  }

  .tf-branding-actionbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tf-branding-actionbar > * {
    width: 100%;
  }

  .tf-branding-actionbar .d-flex {
    justify-content: stretch !important;
  }

  .tf-branding-actionbar .btn {
    flex: 1 1 auto;
  }

  .tf-branding-shell {
    max-width: none;
  }

  .tf-theme-selector {
    padding: 0.85rem;
  }
}

@media (max-width: 767.98px) {
  .tf-branding-preview__navbar,
  .tf-branding-preview__body {
    padding: 1rem;
  }

  .tf-branding-preview__navbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .tf-branding-preview__navlinks {
    gap: 0.75rem;
    font-size: 0.88rem;
  }

  .tf-theme-pill-group {
    gap: 0.55rem;
  }

  .tf-theme-pill {
    width: 100%;
    justify-content: space-between;
  }
}

.tf-company-card-body .form-text {
  margin-top: 0.08rem;
  font-size: 0.68rem;
  line-height: 1.1;
}

.tf-company-card-body .form-control,
.tf-company-card-body .form-select {
  padding-top: 0.18rem;
  padding-bottom: 0.18rem;
  font-size: 0.88rem;
}

.tf-company-card-body textarea.form-control {
  min-height: 52px;
}

.tf-company-section-title {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tf-muted-text, #6c757d);
  font-weight: 600;
  margin: 0 0 0.08rem;
}

.tf-company-section-title--border {
  border-top: 1px solid var(--tf-border);
  padding-top: 0.2rem;
}

@media (min-width: 992px) {
  body.tf-company-page {
    overflow: hidden;
  }

  body.tf-company-page > .container-fluid {
    height: calc(100vh - 86px);
    display: flex;
    flex-direction: column;
  }

  body.tf-company-page .tf-company-page-grid {
    flex: 1 1 auto;
    min-height: 0;
  }

  body.tf-company-page .tf-company-data-col {
    display: flex;
    min-height: 0;
  }

  body.tf-company-page .tf-company-data-col > form {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
  }

  body.tf-company-page .tf-company-data-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 180px);
    min-height: 0;
  }

  body.tf-company-page .tf-company-data-card .card-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
  }
}

@media (min-width: 1400px) {
  html {
    font-size: 0.8rem;
  }
}

@media (max-width: 991.98px) {
  html {
    font-size: 0.6rem;
  }
}

.tf-navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tf-navbar-usertext {
  display: inline-block;
}

@media (min-width: 1400px) {
  .navbar .nav-link,
  .navbar .navbar-text,
  .navbar .dropdown-item {
    font-size: 1rem;
  }

  .navbar .btn-sm {
    font-size: 0.95rem;
  }

  .tf-navbar-usertext {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 991.98px) {
  .navbar .nav-link,
  .navbar .navbar-text,
  .navbar .dropdown-item {
    font-size: 0.6rem;
  }

  .navbar .btn-sm {
    font-size: 0.6rem;
  }
}

@media (min-width: 992px) and (max-width: 1399.98px) {
  .navbar .nav-link,
  .navbar .navbar-text,
  .navbar .dropdown-item {
    font-size: 0.8rem;
  }

  .navbar .btn-sm {
    font-size: 0.8rem;
  }

  .tf-navbar-actions {
    margin-top: 0.5rem;
  }
}

.tf-pre-wrap {
  white-space: pre-wrap;
}

.tf-maxw-90 {
  max-width: 90px;
}

@media print {
  body.cassa-rendiconto-page {
    background: #fff !important;
    color: #000 !important;
    font-size: 9pt;
  }

  body.cassa-rendiconto-page .navbar,
  body.cassa-rendiconto-page .tf-app-footer,
  body.cassa-rendiconto-page .tf-ui-page-header__aside,
  body.cassa-rendiconto-page .cassa-rendiconto-actions {
    display: none !important;
  }

  body.cassa-rendiconto-page .tf-ui-page {
    padding: 0 !important;
  }

  body.cassa-rendiconto-page .tf-ui-page-header,
  body.cassa-rendiconto-page .cassa-rendiconto-kpi,
  body.cassa-rendiconto-page .cassa-rendiconto-summary,
  body.cassa-rendiconto-page .cassa-rendiconto-final {
    break-inside: avoid;
    box-shadow: none !important;
  }

  body.cassa-rendiconto-page .tf-ui-page-header,
  body.cassa-rendiconto-page .card,
  body.cassa-rendiconto-page .cassa-rendiconto-kpi,
  body.cassa-rendiconto-page .cassa-rendiconto-summary {
    border-color: #aaa !important;
  }

  body.cassa-rendiconto-page .cassa-rendiconto-table-wrap {
    overflow: visible !important;
  }

  body.cassa-rendiconto-page .cassa-rendiconto-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 7pt;
  }

  body.cassa-rendiconto-page .cassa-rendiconto-table th,
  body.cassa-rendiconto-page .cassa-rendiconto-table td {
    padding: 0.16rem 0.2rem;
    overflow-wrap: anywhere;
  }

  body.cassa-rendiconto-page .cassa-rendiconto-final input,
  body.cassa-rendiconto-page .cassa-rendiconto-final textarea {
    border-color: #777 !important;
  }
}

/* print preventivo */
body.tf-preventivo-print .print-only {
  display: none;
}

body.tf-preventivo-print .no-print {
  display: block;
}

@media print {
  body.tf-preventivo-print .no-print,
  body.tf-preventivo-print .navbar,
  body.tf-preventivo-print form {
    display: none !important;
  }

  body.tf-preventivo-print .print-only {
    display: block !important;
  }

  body.tf-preventivo-print .card {
    box-shadow: none !important;
    border: 1px solid #ddd;
  }

  body.tf-preventivo-print .card-header {
    background: #f8f9fa !important;
  }
}

/* tema pagina accettazione */
:root {
  --acc-bg: var(--tf-page-bg);
  --acc-ink: var(--tf-surface-text);
  --acc-muted: var(--tf-muted-text);
  --acc-accent: var(--tf-link);
  --acc-accent-2: var(--tf-accent-text);
  --acc-card: var(--tf-surface-bg);
  --acc-border: var(--tf-border);
}

.acc-page {
  background: radial-gradient(1200px 600px at 15% -10%, var(--tf-primary-soft) 0%, transparent 60%),
    radial-gradient(1000px 600px at 90% -20%, var(--tf-success-soft) 0%, transparent 55%),
    var(--acc-bg);
  border-radius: 18px;
  padding: 28px;
  border: 1px solid rgba(33, 37, 41, 0.06);
  box-shadow: 0 1rem 2.2rem rgba(15, 23, 42, 0.05);
}

.acc-title {
  font-family: "Playfair Display", "Georgia", serif;
  letter-spacing: 0.2px;
  color: var(--acc-ink);
}

.acc-subtitle {
  color: var(--acc-muted);
}

.acc-card {
  background: var(--acc-card);
  border: 1px solid var(--acc-border);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(17, 16, 14, 0.08);
}

.acc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--tf-soft-bg);
  color: var(--acc-accent);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.acc-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--acc-muted);
  font-weight: 700;
}

.acc-form .form-label {
  font-weight: 600;
  color: var(--acc-ink);
}

.acc-form .form-control,
.acc-form .form-select {
  border-radius: 12px;
  border-color: var(--tf-control-border);
}

.acc-primary {
  background: var(--acc-accent);
  border-color: var(--acc-accent);
}

.acc-secondary {
  background: var(--acc-accent-2);
  border-color: var(--acc-accent-2);
}

@media (max-width: 992px) {
  .acc-page {
    padding: 18px;
  }
}

.tf-app-footer {
  margin-top: 2rem;
  padding: 0.75rem 0 1rem;
  color: var(--tf-muted-text, #6c757d);
  font-size: 0.8125rem;
}

.tf-app-footer > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.modal-dialog.tf-modal-application-info {
  max-width: 540px;
}

.well-booking-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 0.5rem;
}

.well-booking-filter {
  min-width: 0;
}

.well-booking-filter .form-control,
.well-booking-filter .form-select {
  min-width: 0;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .well-booking-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .well-booking-filter-grid {
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(8.5rem, 0.85fr)) minmax(0, 0.9fr) minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)) auto;
  }
}
/* Il form articolo usa lo scroll del viewport della modal, evitando una seconda
   scrollbar interna al contenuto. */
.modal-dialog-scrollable .modal-content:has(.tf-magazzino-articolo-form) {
  max-height: none;
  overflow: visible;
}

.modal-dialog-scrollable .modal-content:has(.tf-magazzino-articolo-form) .modal-body {
  overflow-y: visible;
}

/* Dettaglio articolo Magazzino: le card seguono il contenuto e non ereditano
   l'altezza uniforme usata dalle griglie dashboard. */
.tf-magazzino-articolo-detail {
  padding-top: 0.75rem;
}

.tf-magazzino-articolo-detail .tf-ui-card {
  height: auto;
}

.tf-magazzino-articolo-detail .tf-ui-card .card-header {
  padding: 0.58rem 0.75rem 0.46rem;
}

.tf-magazzino-articolo-detail .tf-ui-card .card-body:not(.p-0) {
  padding: 0.62rem 0.75rem 0.68rem;
}

/* Keep wide stock tables inside their cards, including on narrow screens.
   The region is keyboard-focusable; printing keeps the full table available. */
.tf-magazzino-articolo-detail .tf-magazzino-table-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

@media print {
  .tf-magazzino-articolo-detail .tf-magazzino-table-scroll {
    overflow: visible;
  }
}

.tf-magazzino-articolo-detail__profile-card .fw-semibold {
  overflow-wrap: anywhere;
}

.tf-magazzino-articolo-detail__stock-card #giacenze-table > .card-body,
.tf-magazzino-articolo-detail__movements-card #movimenti-table > .card-body {
  padding: 0.55rem 0.65rem;
}

.tf-magazzino-articolo-detail .tf-ui-empty-state {
  padding: 0.58rem 0.68rem;
  border-radius: 0.75rem;
}

@media (min-width: 992px) {
  .tf-magazzino-articolo-detail__header {
    align-items: center;
  }

  .tf-magazzino-articolo-detail__header .tf-ui-page-header__body {
    min-width: 18rem;
    flex-basis: 22rem;
  }

  .tf-magazzino-articolo-detail__header .tf-ui-page-header__aside {
    flex: 1 1 34rem;
    align-items: flex-end;
  }

  .tf-magazzino-articolo-detail__header .tf-ui-actionbar {
    justify-content: flex-end;
  }
}

@media (max-width: 991.98px) {
  .tf-magazzino-articolo-detail__header .tf-ui-page-header__aside {
    width: 100%;
    align-items: flex-start;
  }
}

@media print {
  .well-catalog-scroll {
    overflow: visible;
  }
}

/* The quick-booking form wraps body and footer: let only the body scroll. */
.modal-dialog-scrollable [data-quick-booking-form] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-dialog-scrollable [data-quick-booking-form] > .modal-body {
  min-height: 0;
  overflow-y: auto;
}

/* Keep credit-note confirmation reachable in the shared scrollable modal. */
.modal-dialog-scrollable [data-cash-credit-form] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.modal-dialog-scrollable [data-cash-credit-form] > .modal-body {
  min-height: 0;
  overflow-y: auto;
}
