* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(180deg, #f6f8fb 0%, #eef3f9 100%);
  color: var(--text);
  font-family: var(--app-font-family);
  letter-spacing: 0;
}

body.font-ydea {
  --app-font-family: var(--app-font-family-ydea);
}

body button,
body input,
body select,
body textarea,
body .btn,
body .form-control,
body .form-select,
body .dx-widget,
body .dxbl {
  font-family: var(--app-font-family);
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-strong);
}

/* Neutralizza il colore rosa/magenta di default di Bootstrap per <code>: il tag e' usato in tutto il
   sito per codici/chiavi/identificatori tecnici (non snippet di codice), quindi deve seguire il colore
   del testo circostante come qualunque altro dato, non un colore fuori standard non voluto. */
code {
  color: inherit;
}

.app-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}

.app-global-topbar {
  position: fixed;
  z-index: 1060;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  max-height: var(--topbar-height);
  padding: 8px 18px;
  overflow: visible;
  border-bottom: 1px solid #dbe3ee;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.app-global-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  height: 46px;
  max-height: calc(var(--topbar-height) - 16px);
  overflow: hidden;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.app-global-logo img {
  display: block;
  flex: 0 0 auto;
  width: auto !important;
  height: 42px !important;
  max-width: 150px !important;
  max-height: 42px !important;
  object-fit: contain !important;
}

.app-company-context {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 100%;
  max-width: min(48vw, 520px);
  overflow: hidden;
}

.app-partner-home-logo,
.app-partner-topbar-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  justify-content: flex-start;
  gap: 9px;
  width: auto;
  max-width: min(44vw, 250px);
  min-width: 0;
  height: 46px;
  max-height: calc(var(--topbar-height) - 16px);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
}

.app-partner-home-logo img,
.app-partner-topbar-logo img {
  display: block;
  flex: 0 0 38px;
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  object-fit: contain !important;
}

.app-partner-wordmark {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.app-partner-wordmark strong {
  display: inline-block;
  overflow: hidden;
  font: inherit;
  text-overflow: ellipsis;
}

.app-partner-wordmark em {
  display: inline-block;
  margin-left: 5px;
  color: #00a86b;
  font: inherit;
  font-style: normal;
}

.app-partner-home-logo.is-test .app-partner-wordmark em {
  color: #dc2626;
}

.app-company-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 10px;
  min-width: 0;
  max-width: min(42vw, 420px);
  max-height: calc(var(--topbar-height) - 16px);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
}

button.app-company-logo {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.app-company-logo img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 190px !important;
  max-height: 46px !important;
  object-fit: contain !important;
}

.app-company-logo strong {
  max-width: min(34vw, 360px);
  overflow: hidden;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-company-logo:has(> .company-logo.small) {
  min-height: 46px;
}

.app-company-switch-hint {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: .55;
  transform: rotate(45deg);
  transition: opacity .16s ease, transform .16s ease;
}

button.app-company-logo:hover .app-company-switch-hint,
button.app-company-logo:focus-visible .app-company-switch-hint {
  opacity: .9;
  transform: rotate(45deg) translate(1px, 1px);
}

.topbar-company-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--primary-tint-11);
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.topbar-company-switch:hover,
.topbar-company-switch:focus-visible {
  border-color: var(--primary);
  background: var(--primary-tint-9);
  transform: translateY(-1px);
}

.topbar-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topbar-language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--primary-tint-11);
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.topbar-language-link:hover,
.topbar-language-link:focus-visible {
  border-color: var(--primary);
  background: var(--primary-tint-9);
  transform: translateY(-1px);
}

.topbar-language-link.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.app-global-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.app-global-actions form {
  margin: 0;
}

.topbar-impersonation-form,
.inline-action-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.topbar-impersonation-form {
  gap: 8px;
  min-width: 0;
  max-width: min(42vw, 420px);
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: var(--primary-tint-4);
}

.topbar-impersonation-label {
  min-width: 0;
  overflow: hidden;
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-impersonation-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-impersonation-stop:hover,
.topbar-impersonation-stop:focus-visible {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.app-global-user {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.app-global-user:hover,
.app-global-user:focus-visible {
  border-color: var(--primary);
  background: var(--primary-tint-9);
  color: var(--primary-deep);
}

.app-global-user img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-global-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.app-global-logout svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.app-global-logout:hover,
.app-global-logout:focus-visible {
  border-color: var(--primary-tint-10);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

/* Colori di pericolo/anomalia usati dalle grafiche v2, valgono anche fuori dal test */
body.nh-v2 {
  --test-environment-red: #dc2626;
  --test-environment-red-strong: #991b1b;
  --test-environment-red-soft: #fee2e2;
}

body.test-environment {
  --test-environment-red: #dc2626;
  --test-environment-red-strong: #991b1b;
  --test-environment-red-soft: #fee2e2;
}

body.test-environment .app-global-topbar {
  border-bottom-color: #7f1d1d;
  background: linear-gradient(90deg, #991b1b 0%, #dc2626 58%, #ef4444 100%);
  box-shadow: 0 10px 24px rgba(127, 29, 29, .24);
  color: #fff;
}

body.test-environment .page-hero {
  border-color: rgba(254, 202, 202, .64);
  background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 58%, #991b1b 100%);
  box-shadow: 0 16px 32px rgba(153, 27, 27, .20);
}

body.test-environment .app-company-logo,
body.test-environment .app-company-logo strong,
body.test-environment .app-global-logo,
body.test-environment .topbar-impersonation-label {
  color: #fff;
}

body.test-environment .topbar-company-switch,
body.test-environment .topbar-impersonation-form,
body.test-environment .app-global-user,
body.test-environment .app-global-logout,
body.test-environment .app-company-logo .company-logo {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

body.test-environment .app-global-topbar .app-company-logo:has(> .company-logo.small) {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

body.test-environment .app-global-topbar .app-company-logo:has(> .company-logo.small) strong {
  color: #fff;
  text-shadow: 0 1px 2px rgba(127, 29, 29, .34);
}

body.test-environment .app-global-topbar .app-company-logo:has(> .company-logo.small) .company-logo.small {
  border-color: rgba(255, 255, 255, .58);
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

body.test-environment .app-partner-home-logo,
body.test-environment .app-partner-topbar-logo {
  padding: 3px 8px;
  border-radius: 8px;
  background: #fff;
}

body.test-environment .topbar-company-switch:hover,
body.test-environment .topbar-company-switch:focus-visible,
body.test-environment .app-global-user:hover,
body.test-environment .app-global-user:focus-visible,
body.test-environment .app-global-logout:hover,
body.test-environment .app-global-logout:focus-visible,
body.test-environment button.app-company-logo:hover .company-logo,
body.test-environment button.app-company-logo:focus-visible .company-logo {
  border-color: rgba(255, 255, 255, .64);
  background: rgba(255, 255, 255, .24);
  color: #fff;
}

body.test-environment .topbar-impersonation-stop {
  border-color: #fff;
  background: #fff;
  color: var(--test-environment-red-strong);
}

body.test-environment .sidebar-toggle,
body.test-environment .sidebar-toggle:hover,
body.test-environment .sidebar-toggle:focus-visible,
body.test-environment:has(.sidebar:hover) .sidebar-toggle {
  background: linear-gradient(180deg, #991b1b, #dc2626);
  box-shadow: 0 12px 28px rgba(153, 27, 27, .28);
}

body.test-environment .shell-menu-group summary:hover,
body.test-environment .shell-menu-group summary:focus-visible,
body.test-environment .shell-menu-group.active > summary,
body.test-environment .shell-menu-group.is-expanded > summary,
body.test-environment .shell-primary-link:hover,
body.test-environment .shell-primary-link:focus-visible,
body.test-environment .shell-primary-link.active,
body.test-environment .nav-stack a:hover,
body.test-environment .nav-stack a.active,
body.test-environment .nav-stack a[aria-current="page"],
body.test-environment:not(.sidebar-open) .shell-nav .shell-menu-group.shell-flyout-open summary,
body.test-environment .shell-menu-flyout a:hover,
body.test-environment .shell-menu-flyout a:focus-visible,
body.test-environment .shell-menu-flyout a.active {
  background: linear-gradient(90deg, #991b1b 0%, #ef4444 100%);
  color: #fff;
}

body.test-environment .shell-menu-flyout .shell-flyout-title::before {
  background: var(--test-environment-red);
}

body.test-environment .expense-note-list-surface::before,
body.test-environment .expense-note-detail-surface::before,
body.test-environment .workflow-approvals-surface::before,
body.test-environment .company-closure-surface::before,
body.test-environment .work-surface:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table))::before,
body.test-environment .settings-panel:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table))::before {
  background: linear-gradient(90deg, #991b1b 0%, #ef4444 100%);
}

body.test-environment .settings-tabs:not(.partner-company-tabs) {
  --tab-accent: var(--test-environment-red);
}

.sidebar-toggle {
  position: fixed;
  z-index: 1050;
  top: calc(var(--topbar-height) + 10px);
  left: calc(var(--sidebar-collapsed-width) - 1px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 10px;
  height: 46px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, var(--primary-nav-from), var(--primary-nav-mid));
  box-shadow: 0 10px 22px rgba(14, 116, 144, .20);
  transition: width .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.sidebar-toggle::before {
  content: "";
}

body.sidebar-open .sidebar-toggle {
  left: calc(var(--sidebar-width) - 1px);
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible,
body:has(.sidebar:hover) .sidebar-toggle {
  width: 36px;
  background: linear-gradient(180deg, var(--primary-nav-deep), var(--primary-nav-from));
  box-shadow: 0 12px 28px rgba(14, 116, 144, .28);
}

.sidebar-toggle span {
  display: block;
  width: 17px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease;
}

.sidebar-toggle:hover span,
.sidebar-toggle:focus-visible span,
body:has(.sidebar:hover) .sidebar-toggle span {
  opacity: 1;
}

.sidebar-backdrop,
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1030;
  background: rgba(15, 23, 42, .34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  z-index: 1040;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-collapsed-width);
  max-height: calc(100dvh - var(--topbar-height));
  min-height: 0;
  padding: 8px 0 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
  border: 0;
  border-right: 1px solid #dbe3ee;
  border-radius: 0;
  background: var(--surface);
  box-shadow: 8px 0 24px rgba(15, 23, 42, .06);
  transform: translateX(0);
  transition: box-shadow .16s ease;
}

body.sidebar-open .sidebar {
  width: min(var(--sidebar-width), calc(100vw - 30px));
  scrollbar-gutter: auto;
  box-shadow: 12px 0 34px rgba(15, 23, 42, .12);
}

.shell-sidebar {
  background: #fff;
  overflow: hidden;
}

.shell-nav {
  gap: 8px;
  padding: 8px 0 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.shell-sidebar-brand {
  flex: 0 0 auto;
  padding: 14px 12px 16px;
  text-align: center;
  border-top: 1px solid #eef0f2;
  overflow: visible;
}

.shell-sidebar-logo {
  display: inline-flex;
  max-width: 100%;
}

.shell-sidebar-logo img {
  display: block;
  width: auto;
  height: auto;
  max-height: 40px;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.shell-sidebar-company-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #eef2f7;
  color: #334155;
  font-weight: 700;
  font-size: 16px;
}

.shell-sidebar-by {
  display: block;
  margin-top: 6px;
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: #4b5563;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Sidebar collassata (colonna stretta ~78px): la didascalia va a capo su piu'
   righe centrate e resta interamente leggibile, senza troncamento con "...". */
body:not(.sidebar-open) .shell-sidebar-brand {
  padding-left: 4px;
  padding-right: 4px;
}

body:not(.sidebar-open) .shell-sidebar-by {
  font-size: 10.5px;
}

.shell-menu-group {
  display: grid;
  align-content: start;
  gap: 3px;
}

/* "Dashboard" (voce singola, <a>) e' anche intercettata da ".nav-stack a" piu' sotto (stessa
   specificita' della sola .shell-primary-link, ma con selettore di tipo in piu' quindi vince):
   ne risultava un font-size piu' grande (16px invece di 13px, fuori dalla card @media
   max-height:820px che lo riporta a 13px solo sotto quell'altezza finestra) e un letter-spacing
   piu' stretto (.035em invece di .08em) rispetto a tutte le altre voci del menu (<summary>, non
   <a>, quindi mai toccate da quella regola) - "Dashboard" risultava scritta piu' grande/con un
   font diverso a seconda dell'altezza della finestra. Specificita' .shell-nav .shell-primary-link
   per vincere in modo stabile su entrambe le versioni di ".nav-stack a" (dentro e fuori la media
   query), non per ordine nel file. Stesso motivo per "gap": ".nav-stack a" impone 12px invece
   di 8px, spostando il testo "Dashboard" piu' a destra rispetto alle altre voci (<summary>, mai
   toccate da quel selettore che richiede il tag <a>) - disallineamento visibile in sidebar. */
.shell-nav .shell-primary-link {
  font-size: 13px;
  letter-spacing: .08em;
  gap: 8px;
}

.shell-menu-group summary,
.shell-primary-link {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 16px 7px 2px;
  border-radius: 0 8px 8px 0;
  color: #7f8184;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.15;
  text-transform: uppercase;
  text-decoration: none;
  list-style: none;
  transition: background .16s ease, color .16s ease;
}

.shell-menu-group summary::-webkit-details-marker {
  display: none;
}

.shell-menu-group summary:hover,
.shell-menu-group summary:focus-visible,
.shell-menu-group.active > summary,
.shell-menu-group.is-expanded > summary,
.shell-primary-link:hover,
.shell-primary-link:focus-visible,
.shell-primary-link.active {
  background: linear-gradient(90deg, var(--primary-nav-from) 0%, var(--primary-nav-to) 100%);
  color: #fff;
}

/* Aperto a mano un altro gruppo, il gruppo della pagina corrente perde il colore (un solo gruppo colorato). */
.shell-nav.has-expanded-group .shell-menu-group.active:not(.is-expanded) > summary:not(:hover):not(:focus-visible) {
  background: transparent;
  color: #7f8184;
}

.shell-line-icon svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell-menu-chevron {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  transition: transform .16s ease;
}

.shell-menu-chevron::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translate(-1px, -1px);
}

.shell-menu-group[open] .shell-menu-chevron {
  transform: rotate(180deg);
}

/* Pallino con il numero di richieste da approvare accanto a "Approvazioni" (ApprovalsMenuBadge). Con la sidebar chiusa il
   testo e' minuscolo e centrato sotto l'icona: il pallino passa sull'angolo della voce invece di stare in linea. */
.shell-menu-badge {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
}

body:not(.sidebar-open) .shell-menu-badge {
  position: absolute;
  top: 4px;
  right: 10px;
  min-width: 16px;
  height: 16px;
  margin-left: 0;
  padding: 0 4px;
  font-size: 9px;
  line-height: 16px;
}

/* Nel sottomenu (e nel flyout a sidebar chiusa) il pallino sta in linea accanto alla voce, non sull'angolo dell'icona. */
body:not(.sidebar-open) .shell-menu-children .shell-menu-badge,
body:not(.sidebar-open) .shell-menu-flyout .shell-menu-badge {
  position: static;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 20px;
}

.shell-menu-children {
  display: grid;
  gap: 2px;
  /* Niente padding-bottom (era 7px): sommato al gap uniforme di 6px tra i gruppi del menu,
     lo spazio tra l'ultima voce di un gruppo aperto e il gruppo successivo (13px) risultava
     molto piu' grande del gap di 2px tra le voci dello stesso gruppo o del gap di 6px tra due
     gruppi chiusi consecutivi - uno "scalino" proprio li'. */
  padding: 4px 0 0 58px;
}

.shell-flyout-title {
  display: none;
}

.shell-menu-children a,
.shell-empty-item {
  display: block;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  text-decoration: none;
  text-transform: none;
}

.shell-menu-children a:hover,
.shell-menu-children a:focus-visible,
.shell-menu-children a.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.shell-empty-item {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

body:not(.sidebar-open) .shell-nav {
  gap: 7px;
  padding-top: 10px;
  overflow-x: hidden;
}

body:not(.sidebar-open) .shell-menu-group summary,
body:not(.sidebar-open) .shell-primary-link {
  display: flex;
  min-height: 62px;
  padding: 7px 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.15;
  text-align: center;
}

body:not(.sidebar-open) .shell-menu-group summary > span:nth-child(2),
body:not(.sidebar-open) .shell-primary-link > span:nth-child(2) {
  display: block;
  width: 84px;
  max-width: 84px;
  overflow: hidden;
  color: #7c7f83;
  font-size: 7.2px;
  letter-spacing: .035em;
  text-overflow: clip;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

body:not(.sidebar-open) .shell-menu-chevron,
body:not(.sidebar-open) .shell-menu-children {
  display: none;
}

body:not(.sidebar-open) .shell-line-icon svg {
  width: 25px;
  height: 25px;
}

body:not(.sidebar-open) .shell-nav .shell-primary-link,
body:not(.sidebar-open) .shell-nav .shell-menu-group summary {
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-height: 62px;
  padding: 7px 0;
  text-align: center;
}

body:not(.sidebar-open) .shell-nav .shell-primary-link > span:nth-child(2),
body:not(.sidebar-open) .shell-nav .shell-menu-group summary > span:nth-child(2) {
  display: block;
  width: 84px;
  max-width: 84px;
  overflow: hidden;
  color: #7c7f83;
  font-size: 7.2px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

body.mobile-kiosk .sidebar-toggle,
body.mobile-kiosk .sidebar-backdrop,
body.mobile-kiosk .sidebar,
body.mobile-kiosk .topbar,
body.mobile-kiosk .app-global-topbar {
  display: none !important;
}

body.mobile-kiosk .app-shell {
  display: block;
  min-height: 100vh;
}

body.mobile-kiosk .content {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

body.mobile-kiosk .auth-panel,
body.mobile-kiosk .mobile-badge {
  margin-inline: auto;
}

body.auth-page .sidebar-toggle,
body.auth-page .sidebar-backdrop,
body.auth-page .sidebar,
body.auth-page .topbar,
body.auth-page .app-global-topbar {
  display: none !important;
}

body.auth-page .app-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

body.auth-page .content {
  width: min(100%, 820px);
  min-height: auto;
  padding: 24px;
}

body.auth-page .auth-panel {
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

body:not(.sidebar-open) .brand,
body:not(.sidebar-open) .sidebar-user,
body:not(.sidebar-open) .sidebar-company,
body:not(.sidebar-open) .menu-search,
body:not(.sidebar-open) .sidebar-footer,
body:not(.sidebar-open) .nav-favorites-sublist {
  display: none;
}

.brand strong,
.sidebar-user strong {
  display: block;
  overflow: hidden;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand > span:not(.brand-mark),
.sidebar-user > div {
  min-width: 0;
}

.sidebar-user-details {
  display: block;
  min-width: 0;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.sidebar-user-details:hover,
.sidebar-user-details:focus-visible {
  color: var(--primary);
}

.brand small,
.sidebar-user span,
.sidebar-user small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #0f766e);
  color: #fff;
  font-weight: 800;
}

.brand-logo {
  overflow: hidden;
  border: 1px solid #d8e6f7;
  background: #fff;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 42px minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 800;
}

.sidebar-user i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, .12);
}

.sidebar-company {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.company-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid #d8e6f7;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-soft), #f4fbff);
  color: var(--primary-strong);
  font-weight: 800;
}

.company-logo.small {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 13px;
}

.company-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-company-text {
  min-width: 0;
}

.sidebar-company-text span,
.sidebar-company-text small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.sidebar-company-text span {
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-company-text strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-switch-button {
  min-height: 30px;
  border: 1px solid var(--primary-tint-11);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.company-switch-button:hover,
.company-switch-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-tint-9);
}

.menu-search {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.menu-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.menu-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.nav-stack {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  flex: 1 1 auto;
  gap: 7px;
  min-height: 96px;
  overflow-y: auto;
  padding: 30px 0 16px;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
}

body.sidebar-open .nav-stack {
  gap: 0;
  padding: 6px 0 18px;
  scrollbar-gutter: auto;
}

.nav-section {
  align-self: start;
  margin: 12px 12px 3px;
  color: #7b7f86;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body:not(.sidebar-open) .nav-section {
  margin: 14px 0 3px;
  font-size: 9px;
  letter-spacing: .08em;
  text-align: center;
}

.nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-self: start;
  align-items: center;
  gap: 4px;
  border-radius: 0;
}

.access-denied-shell {
  min-height: min(560px, calc(100dvh - 180px));
  display: grid;
  place-items: center;
  padding: 24px;
}

.access-denied-dialog,
.access-denied-popup-card {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 24px;
  border: 1px solid #fecdd3;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff 0%, #fff7f7 100%);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

.access-denied-dialog h2,
.access-denied-popup-card h2 {
  margin: 2px 0 8px;
  color: #0f172a;
}

.access-denied-dialog p,
.access-denied-popup-card p {
  margin: 0;
  color: #64748b;
}

.access-denied-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 900;
  font-size: 24px;
}

.access-denied-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.access-denied-popup {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .34);
  backdrop-filter: blur(3px);
}

.access-denied-popup-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.readonly-page main.content .readonly-action-form {
  position: relative;
}

.readonly-page main.content .readonly-action-form input:not([type="hidden"]),
.readonly-page main.content .readonly-action-form select,
.readonly-page main.content .readonly-action-form textarea {
  background-color: #f8fafc;
  color: var(--text);
  cursor: not-allowed;
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}

.readonly-page main.content [data-edit-target][hidden],
.readonly-page main.content [data-open-modal][data-reset-form][hidden] {
  display: none !important;
}

.nav-stack a {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 50px;
  padding: 7px 16px 7px 2px;
  border-radius: 0 8px 8px 0;
  color: #7c7f84;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .035em;
  text-transform: uppercase;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-row .nav-link-main {
  grid-template-columns: 34px minmax(0, 1fr);
  min-width: 0;
}

body:not(.sidebar-open) .nav-row {
  display: block;
}

body:not(.sidebar-open) .nav-stack a,
body:not(.sidebar-open) .nav-row .nav-link-main {
  display: flex;
  min-height: 68px;
  padding: 8px 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #818181;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .06em;
  line-height: 1.16;
  text-align: center;
}

.nav-link-main > span:last-child,
.nav-favorite-link > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.sidebar-open) .nav-link-main > span:last-child {
  width: 76px;
  max-width: 76px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-align: center;
}

.nav-favorites-sublist {
  display: grid;
  align-self: start;
  gap: 3px;
  margin: -1px 0 4px 42px;
}

.nav-favorites-sublist > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.nav-stack .nav-favorite-link {
  grid-template-columns: 16px minmax(0, 1fr);
  min-height: 30px;
  padding: 4px 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}

.nav-favorite-link small {
  color: var(--warning);
  line-height: 1;
}

.nav-stack a:hover {
  background: linear-gradient(90deg, var(--primary-nav-from) 0%, var(--primary-nav-to) 100%);
  color: #fff;
}

.nav-stack a.active,
.nav-stack a[aria-current="page"] {
  background: linear-gradient(90deg, var(--primary-nav-from) 0%, var(--primary-nav-to) 100%);
  color: #fff;
}

.nav-stack a.active::before,
.nav-stack a[aria-current="page"]::before {
  content: none;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

body:not(.sidebar-open) .nav-icon {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

.sidebar-footer {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.portal-preview-switch {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.portal-preview-switch > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-preview-switch > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.portal-preview-switch form,
.portal-preview-switch button {
  width: 100%;
}

.language-select {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.language-select select {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 5px 8px;
}

.content {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  min-height: 100vh;
  overflow-x: clip;
  padding: calc(var(--topbar-height) + 8px) 16px 28px calc(var(--sidebar-collapsed-width) + 16px);
  transition: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

/* Intestazione mini-pannello (eyebrow+titolo a sinistra, azione a destra): usata da schermate che
   non hanno un proprio <style> di pagina (es. Sincronizzazione esterna). Prima non esisteva da
   nessuna parte a livello globale: i pulsanti "Nuovo campo/lookup/chiave/filtro" finivano impilati
   sotto il titolo invece che allineati a destra. */
.commesse-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.commesse-mini-head h3,
.commesse-mini-head h4 {
  margin: 0;
}

.commesse-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* Alias di .commesse-mini-head/.commesse-config-actions per Sincronizzazione Esterna: stessa resa
   visiva, ma con classi proprie del modulo invece di importare quelle di Commesse. */
.syncesterno-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.syncesterno-mini-head h3,
.syncesterno-mini-head h4 {
  margin: 0;
}

.syncesterno-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 800;
}

.status-dot::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  padding: 18px;
  border: 1px solid rgba(var(--primary-edge-rgb), .5);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0f172a 0%, var(--primary-strong) 58%, var(--primary-hero-end) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.page-hero.compact-page-head {
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
  padding: 18px 20px;
}

.page-hero.compact-page-head h2 {
  margin: 0;
}

.page-hero.compact-page-head p {
  display: none;
}

/* Eccezione scoped alla sola testata Note spese: qui il sottotitolo serve a mostrare "Rendiconto in
   sola lettura" (vedi ExpenseNotesBlazor.razor, HeroSubtitle) nella testata colorata invece che come
   banner separato sotto. Non tocca la regola generica sopra: le altre pagine con .compact-page-head
   restano invariate. */
.page-hero.compact-page-head.expense-note-page-hero p {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.page-hero .eyebrow,
.page-hero p {
  color: rgba(255, 255, 255, .76);
}

.page-hero h1,
.page-hero h2 {
  margin: 4px 0 6px;
  font-size: 24px;
  font-weight: 800;
}

.page-hero h1:focus,
.page-hero h2:focus {
  outline: none;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
}

.page-hero.blazor-page-hero,
.page-hero.partner-blazor-head,
.page-hero.standard-blazor-head {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 8px;
  padding: 12px 20px;
}

.page-hero.blazor-page-hero h2,
.page-hero.partner-blazor-head h2,
.page-hero.standard-blazor-head h2 {
  margin: 0;
}

.page-hero.blazor-page-hero .quick-actions,
.page-hero.partner-blazor-head .quick-actions,
.page-hero.standard-blazor-head .quick-actions {
  justify-content: flex-end;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Azione distruttiva separata dal gruppo primario, come nei footer modal (.modal-form-actions.has-danger) */
.quick-actions .page-hero-danger-group {
  margin-right: auto;
}

/* Stesso override del tema DevExpress gia' applicato in .modal-form-actions.has-danger > .btn-danger,
   necessario perche' la classe generica .btn-danger viene sovrascritta dal tema dxbl-btn. */
.quick-actions .page-hero-danger-group .btn-danger {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}

.table-filter-row th {
  padding: 2px 5px;
  background: #fff;
  overflow: visible;
  vertical-align: middle;
}

.table-filter-row input,
.table-filter-row select,
.table-filter-row .dxbl-text-edit {
  box-sizing: border-box;
  min-height: 26px;
  min-width: 110px;
  padding: 2px 6px;
  border-color: #dbe3ee;
  background-color: #fff;
  font-size: 12px;
  line-height: 1.2;
}

.table-filter-row .dxbl-text-edit input {
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  padding-block: 0;
  font-size: 12px;
  line-height: 1.2;
}

.module-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.module-switcher .btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.editor-panel[hidden],
.editor-modal[hidden],
.confirm-modal[hidden],
[data-module-section][hidden] {
  display: none !important;
}

.editor-modal,
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1070;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Lo sfondo sta su uno pseudo-elemento, NON sulla modal stessa:
   backdrop-filter su .editor-modal creerebbe un containing block per i
   discendenti position:fixed, intrappolando il popup del DxDateEdit (anch'esso
   position:fixed) e rompendone posizione/clipping dentro la modal. */
.editor-modal::before,
.confirm-modal::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top, rgba(var(--primary-rgb), .10), transparent 34%),
    rgba(15, 23, 42, .48);
  pointer-events: none;
}

.editor-dialog,
.confirm-dialog {
  display: flex;
  flex-direction: column;
  width: min(940px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(216, 230, 247, .92);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 72px rgba(15, 23, 42, .24);
}

.editor-dialog.wide {
  width: min(1120px, 100%);
}

.editor-modal.editor-modal-floating-content {
  place-items: start center;
  align-items: start;
  justify-items: center;
  overflow: auto;
  overscroll-behavior: contain;
}

.editor-modal.editor-modal-floating-content .editor-dialog-floating-content {
  max-height: none;
  overflow: visible;
}

.editor-modal.editor-modal-floating-content .editor-body {
  overflow: visible;
}

/* Con overflow visibile il dialog non ritaglia piu' la testata: il raggio va dato alla testata stessa. */
.editor-modal.editor-modal-floating-content .editor-dialog-floating-content > .surface-head {
  border-radius: 17px 17px 0 0;
}

.company-switch-dialog {
  width: min(620px, 100%);
}

.editor-dialog .surface-head {
  flex: 0 0 auto;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid #cfe0f5;
  border-radius: 0;
  background: linear-gradient(180deg, var(--primary-tint-1) 0%, var(--primary-tint-6) 100%);
  box-shadow: none;
}

.editor-dialog .surface-head h2,
.confirm-dialog h2 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.editor-dialog .surface-head p,
.confirm-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.editor-dialog .surface-head [data-close-modal] {
  min-width: 82px;
  align-self: flex-start;
}

/* Testata modal Impostazioni Standard: stesso gradiente blu/verde acqua usato in avatar e KPI del sito. */
.standard-blazor-modal .editor-dialog .surface-head {
  border-bottom: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #0f766e 100%);
}

.standard-blazor-modal .editor-dialog .surface-head h2,
.standard-blazor-modal .editor-dialog .surface-head p,
.standard-blazor-modal .editor-dialog .surface-head .eyebrow {
  color: #fff;
}

.standard-blazor-modal .editor-dialog .surface-head .eyebrow,
.standard-blazor-modal .editor-dialog .surface-head p {
  opacity: .86;
}

.editor-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 18px 20px 20px;
}

.editor-body .form-grid,
.settings-detail-panel .form-grid,
.editor-dialog .form-grid,
.expense-note-editor-page .form-grid,
.expense-row-editor-page .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin-bottom: 0;
}

.editor-dialog.wide .form-grid,
.expense-row-editor-page .form-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.settings-detail-panel .form-grid label,
.editor-dialog .form-grid label,
.expense-note-editor-page .form-grid label,
.expense-row-editor-page .form-grid label {
  min-width: 0;
}

.settings-detail-panel .form-grid-wide,
.editor-dialog .form-grid-wide,
.settings-detail-panel .admin-wide,
.editor-dialog .admin-wide,
.settings-detail-panel .field.span-2,
.editor-dialog .field.span-2,
.expense-note-editor-page .form-grid-wide,
.expense-row-editor-page .form-grid-wide {
  grid-column: 1 / -1;
}

/* Checkbox/interruttori: un solo aspetto per tutto il sito, definito in un unico punto (vedi ".check-row,
   .check-line, .switch-line" piu' sotto). Prima, dentro modali e pannelli di dettaglio, queste classi
   diventavano una "riga card" con bordo e fondo azzurro: rimossa per non avere due aspetti diversi. */

.timestamp-existing-attachments {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--primary-tint-1);
}

.timestamp-attachments-dialog {
  width: min(660px, 100%);
}

.timestamp-existing-attachments[hidden] {
  display: none !important;
}

.timestamp-existing-attachments p {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 650;
}

.timestamp-existing-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timestamp-attachments-modal-list {
  display: grid;
  gap: 10px;
}

.timestamp-attachment-chip,
.timestamp-attachment-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.timestamp-attachment-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.timestamp-attachment-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timestamp-attachment-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.timestamp-attachment-actions .btn {
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.timestamp-attachment-chip:hover,
.timestamp-attachment-chip:focus {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.timestamp-attachment-chip small {
  color: var(--muted);
  font-weight: 750;
}

.timestamp-attachment-empty {
  border-color: var(--border);
  color: var(--muted);
}

.timestamp-attachments-modal-list .timestamp-attachment-chip {
  justify-content: space-between;
  width: 100%;
  border-radius: 12px;
}

.timestamp-attachment-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 52px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: var(--primary-tint-4);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.timestamp-attachment-indicator:hover,
.timestamp-attachment-indicator:focus {
  border-color: var(--primary);
  background: var(--primary-tint-9);
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), .14);
  transform: translateY(-1px);
}

.timestamp-attachment-indicator svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-stamp-with-attachments {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Proprieta' strutturali comuni ai 2 pulsanti-icona rotondi sotto (cerchio icon-only con hover):
   raggruppate qui invece che ripetute in ciascuna regola, il CSS calcolato risultante e' invariato. */
.report-attachment-indicator,
.report-anomaly-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.report-attachment-indicator svg,
.report-anomaly-indicator svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-attachment-indicator {
  width: 20px;
  height: 20px;
  border: 1px solid var(--primary-tint-10);
  background: var(--primary-tint-4);
  color: var(--primary-strong);
  vertical-align: middle;
}

.report-attachment-indicator:hover,
.report-attachment-indicator:focus {
  border-color: var(--primary);
  background: var(--primary-tint-9);
  box-shadow: 0 5px 12px rgba(var(--primary-rgb), .16);
}

.report-attachment-indicator svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.report-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.report-anomaly-indicator {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(220, 38, 38, .26);
  background: #fff;
  color: var(--danger);
}

.report-anomaly-indicator:hover,
.report-anomaly-indicator:focus {
  border-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: 0 5px 12px rgba(220, 38, 38, .14);
}

.report-anomaly-indicator svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.1;
}

.report-anomaly-message {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(220, 38, 38, .18);
  border-radius: 14px;
  background: var(--danger-soft);
  color: #7f1d1d;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  white-space: pre-wrap;
}

.timestamp-attachment-none {
  display: inline-flex;
  justify-content: center;
  min-width: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-form-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr minmax(120px, auto);
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-form-actions .btn {
  min-width: 122px;
}

.blazor-save-button {
  position: relative;
}

.blazor-save-button.is-busy {
  cursor: wait;
  opacity: .88;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: button-spinner-rotate .72s linear infinite;
}

@keyframes button-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.modal-form-actions .btn[data-close-modal],
.modal-form-actions .btn-outline-secondary {
  grid-column: 1;
  justify-self: start;
}

.modal-form-actions .btn[type="submit"],
.modal-form-actions .btn-primary,
.modal-form-actions .btn-danger {
  grid-column: 3;
  justify-self: end;
}

.modal-form-actions.has-danger {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-form-actions.has-danger > .btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  justify-self: start;
}

/* Dentro un contenitore flex (es. .modal-footer di Bootstrap) la riga azioni occupa tutta la larghezza:
   altrimenti Elimina, a sinistra nella riga, resta attaccato ai pulsanti a destra. */
.modal-footer > .modal-form-actions {
  flex: 1 1 100%;
  width: 100%;
}

.modal-form-main-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.modal-form-actions:not(.has-danger) .modal-form-main-actions {
  grid-column: 3;
  justify-self: end;
}

.modal-form-actions.has-danger .modal-form-main-actions .btn,
.modal-form-actions.has-danger > .btn-danger {
  min-width: 122px;
}

.modal-form-actions.has-danger .modal-form-main-actions .btn-outline-secondary,
.modal-form-actions.has-danger .modal-form-main-actions .btn-primary,
.modal-form-actions.has-danger .modal-form-main-actions .btn-danger {
  grid-column: auto;
  justify-self: auto;
}

.modal-inline-alert {
  grid-column: 1 / -1;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 10px 22px rgba(153, 27, 27, 0.08);
}

.editor-body > .modal-inline-alert,
.editor-body > .modal-inline-success,
.editor-body > .modal-inline-warning {
  margin-bottom: 14px;
}

.modal-inline-alert[hidden] {
  display: none !important;
}

.modal-inline-success {
  grid-column: 1 / -1;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #047857;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 10px 22px rgba(4, 120, 87, 0.08);
}

.modal-inline-warning {
  grid-column: 1 / -1;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.35;
  box-shadow: 0 10px 22px rgba(154, 52, 18, 0.08);
}

.form-feedback {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.35;
}

.form-feedback > strong {
  flex: 0 0 auto;
}

.form-feedback > span {
  min-width: 0;
}

.form-feedback-success {
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.form-feedback-error,
.form-feedback-danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.form-feedback-warning {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.form-feedback-info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.form-feedback-dismiss {
  margin: -4px -4px -4px auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.editor-dialog .form-grid > button[type="submit"],
.editor-dialog .form-grid > button[data-close-modal] {
  min-width: 122px;
  margin-top: 8px;
}

.editor-dialog .form-grid > button[data-close-modal] {
  grid-column: 1;
  justify-self: start;
}

.editor-dialog .form-grid > button[type="submit"] {
  grid-column: -2 / -1;
  justify-self: end;
}

.company-switch-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  max-height: calc(100vh - 168px);
  padding: 16px;
}

.company-switch-list form {
  margin: 0;
}

.company-switch-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

button.company-switch-row:hover,
button.company-switch-row:focus-visible {
  border-color: var(--primary);
  background: var(--primary-tint-2);
}

.company-switch-row.current {
  border-color: var(--primary-tint-11);
  background: var(--primary-soft);
}

.company-switch-row strong,
.company-switch-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-switch-row small {
  color: var(--muted);
  font-size: 12px;
}

body.editor-modal-open {
  overflow: hidden;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.work-surface,
.toolbar-surface,
.auth-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* Le card .metric della Dashboard usano token dedicati (bordo/radius/ombra piu' soft) definiti
   dallo spec di design della Dashboard: non condividono piu' l'aspetto generico .work-surface. */
.metric {
  display: flex;
  flex-direction: column;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  padding: 18px 20px;
  min-height: auto;
}

.metric > span:first-child {
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.metric strong {
  color: #0f172a;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
}

.metric-role-value {
  font-size: 22px !important;
  letter-spacing: -.01em;
  margin-top: auto;
}

.metric small {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 11px;
}

.work-surface,
.toolbar-surface,
.auth-panel {
  margin-bottom: 16px;
  padding: 16px;
}

/* ===== Dashboard: header + context strip (design handoff "Dashboard NetHub360") ===== */
.dashboard-header-card {
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow: hidden;
  margin-bottom: 16px;
}

.dashboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 26px;
  border-bottom: 1px solid #e2e8f0;
}

.dashboard-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.dashboard-header-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--primary);
}

.dashboard-header-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: #0f172a;
  line-height: 1.15;
  margin-top: 2px;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.dashboard-refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #dbe3ee;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 9px;
  color: #334155;
}

.dashboard-refresh-button:disabled {
  opacity: .6;
  cursor: default;
}

.dashboard-refresh-icon {
  font-size: 14px;
  color: var(--primary);
}

.dashboard-context-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 9px 26px;
  background: #fbfdff;
}

.dashboard-context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #059669;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .14);
}

.dashboard-context-label {
  font-size: 12px;
  color: #334155;
  font-weight: 700;
}

.dashboard-context-sep {
  font-size: 12px;
  color: #cbd5e1;
}

.dashboard-context-time {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  margin-bottom: 12px;
}

/* Quando Title/Eyebrow sono vuoti, BlazorSurfaceHeader non renderizza il blocco titolo: le Actions
   restano l'unico figlio flex e "justify-content: space-between" le spinge a sinistra invece che a
   destra, per assenza di un secondo elemento contro cui distribuire lo spazio. Il selettore [class]
   individua solo il contenitore Actions (ha sempre una classe via ActionsClass): il blocco titolo e'
   un <div> senza classe, quindi un titolo senza Actions non viene toccato e resta a sinistra. */
.surface-head > [class]:only-child {
  margin-left: auto;
}

.work-surface,
.settings-panel,
.settings-tab-shell,
.page-hero,
.compact-page-head,
.table-responsive {
  min-width: 0;
  max-width: 100%;
}

.surface-head > *,
.topbar > * {
  min-width: 0;
}

.surface-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.surface-head span,
.surface-head p {
  color: var(--muted);
}

.surface-head p {
  margin: 4px 0 0;
  font-size: 13px;
}

.report-table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Dashboard timbrature: il titolo non va a capo; se le azioni non ci stanno sulla sua riga scendono
   insieme, a tutta larghezza e allineate a destra, invece di lasciare un pulsante orfano. */
.surface-head:has(> .report-dashboard-tools) {
  flex-wrap: wrap;
}

.surface-head:has(> .report-dashboard-tools) > div:not([class]) {
  flex: 0 0 auto;
  white-space: nowrap;
}

.surface-head > .report-dashboard-tools {
  flex: 1 1 auto;
}

.table-group-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 14px;
  background: rgba(239, 246, 255, .82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.table-group-tools > span {
  color: var(--text-main);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.table-group-tools label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.table-group-tools input {
  accent-color: var(--primary);
}

.table-group-tools button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  font-weight: 900;
  cursor: pointer;
}

.table-group-dropzone {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 680px;
  min-width: min(100%, 680px);
  padding: 10px 12px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 18px;
  background: rgba(239, 246, 255, .82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.table-group-dropzone > span {
  color: var(--text-main);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.table-group-drop-target {
  display: inline-flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  padding: 8px 10px;
  border: 2px dashed var(--primary-tint-10);
  border-radius: 16px;
  background: #fff;
}

.table-group-drop-target em {
  padding: 0 8px;
  color: #64748b;
  font-style: normal;
  font-weight: 750;
}

.table-group-dropzone.is-drag-over .table-group-drop-target {
  border-color: var(--primary);
  background: var(--primary-tint-4);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .10);
}

.table-group-dropzone [data-table-group-clear] {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  font-weight: 900;
  cursor: pointer;
}

.table-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
  cursor: grab;
}

.table-group-chip:active {
  cursor: grabbing;
}

.table-group-draggable {
  cursor: grab;
}

.table-group-draggable:active {
  cursor: grabbing;
}

.presence-stamps-table.is-group-return-target {
  outline: 3px dashed rgba(var(--primary-rgb), .35);
  outline-offset: 6px;
}

.report-summary-chip {
  background: var(--primary-tint-5);
  color: var(--text-main);
}

.surface-head .report-summary-chip {
  color: var(--text-main);
}

.report-hours-chip-warning {
  border-color: rgba(245, 158, 11, .36);
  background: rgba(245, 158, 11, .14);
  color: #92400e;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .10), 0 8px 18px rgba(245, 158, 11, .12);
}

.surface-head .report-hours-chip-warning {
  color: #92400e;
}

.surface-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.surface-head > .surface-actions {
  margin-left: auto;
}

.settings-action-button,
.settings-back-button,
.partner-action-button {
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
  min-height: 34px;
  padding-inline: 12px;
  white-space: nowrap;
}

.inline-action-form {
  display: inline-flex;
  margin: 0;
}

.info-callout {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #f6f8fb;
}

.info-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.syncesterno-conflitto-message {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.syncesterno-conflitto-fields {
  display: grid;
  gap: 8px;
}

.syncesterno-conflitto-field {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #f8fafc;
}

.syncesterno-conflitto-field-name {
  font-weight: 800;
  font-size: 12.5px;
  color: var(--text);
  word-break: break-word;
}

.syncesterno-conflitto-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.syncesterno-conflitto-value .chip {
  flex: 0 0 auto;
}

.syncesterno-conflitto-value-text {
  font-size: 13px;
  color: var(--text);
  overflow-wrap: break-word;
  min-width: 0;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.copy-row input {
  font-family: Consolas, "SFMono-Regular", "Segoe UI Mono", monospace;
  font-size: 13px;
}

.metric-number-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-suffix {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}

.metric-out-of-scope {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  box-shadow: none;
}

.metric-out-of-scope strong {
  color: #94a3b8;
  font-size: 16px;
  margin-top: auto;
}

.metric-out-of-scope small {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.45;
  margin-top: 8px;
}

.dashboard-delta-row {
  display: flex;
  align-items: center;
  margin-top: 11px;
}

.dashboard-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.dashboard-delta-up {
  background: #ecfdf5;
  color: #047857;
}

.dashboard-delta-down {
  background: #fef2f2;
  color: #dc2626;
}

.dashboard-delta-caption {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  margin-left: 7px;
}

.dashboard-range-switch {
  display: inline-flex;
  background: #e6edf5;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.dashboard-range-switch button {
  border: none;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 7px;
}

.dashboard-range-switch button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}

.dashboard-chart-card {
  /* Contenitore di posizionamento per overlay interni dei grafici DevExpress
     (DxPieChart/DxChart): senza questo la card resta static e un eventuale
     overlay assoluto del grafico si ancora all'antenato posizionato piu'
     vicino piu' in alto nella pagina invece che alla card. */
  position: relative;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  padding: 20px 24px 12px;
  margin-bottom: 16px;
}

.dashboard-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.dashboard-chart-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.dashboard-chart-sub {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  margin: 2px 0 0;
}

.dashboard-chart-total {
  text-align: right;
  flex: 0 0 auto;
}

.dashboard-chart-total-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.dashboard-chart-total-value {
  font-size: 21px;
  font-weight: 900;
  color: #2563eb;
  letter-spacing: -.02em;
  margin-top: 1px;
}

.dashboard-chart-total-suffix {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  margin-left: 3px;
}

.dashboard-panels-3,
.dashboard-panels-2 {
  display: grid;
  gap: 16px;
}

.dashboard-panels-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-panels-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-panel-card {
  position: relative;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  padding: 20px 22px;
}

.dashboard-panel-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.dashboard-panel-sub {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  margin: 2px 0 18px;
}

.dashboard-panel-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-panel-total {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-donut-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.dashboard-donut-row.dashboard-donut-row-wide {
  gap: 26px;
}

.dashboard-donut-wrap {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 120px;
}

.dashboard-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dashboard-donut-center-value {
  font-size: 23px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

.dashboard-donut-center-label {
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 3px;
}

.dashboard-donut-svg {
  /* SVG a mano (stessa tecnica del mockup: cerchi con stroke-dasharray/stroke-dashoffset) al posto
     di DxPieChart, il cui contenitore non si vincolava in modo affidabile alla card. */
  display: block;
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.dashboard-legend {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.dashboard-legend.dashboard-legend-wide {
  gap: 12px;
}

.dashboard-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.dashboard-legend-row.dashboard-legend-row-wide {
  gap: 9px;
  font-size: 13px;
}

.dashboard-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dashboard-legend-row-wide .dashboard-legend-dot {
  width: 10px;
  height: 10px;
}

.dashboard-legend-label {
  color: #475569;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-legend-value {
  color: #0f172a;
  font-weight: 800;
}

.dashboard-legend-pct {
  color: #94a3b8;
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

.dashboard-bars {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 17px;
}

.dashboard-bars.dashboard-bars-wide {
  gap: 14px;
  margin-top: 18px;
}

.dashboard-bar-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 7px;
  gap: 12px;
}

.dashboard-bar-label {
  color: #475569;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dashboard-bar-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.dashboard-bar-value {
  color: #0f172a;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-bar-track {
  height: 8px;
  background: #eef3f9;
  border-radius: 999px;
  overflow: hidden;
}

.dashboard-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.dashboard-counter-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e6edf5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  padding: 20px 22px;
}

.dashboard-counter-card > .dashboard-panel-title {
  margin-bottom: 0;
}

.dashboard-counter-card > .dashboard-panel-sub {
  margin: 2px 0 0;
}

.dashboard-counter-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.dashboard-counter-pill {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  border-radius: 14px;
}

.dashboard-counter-pill-warning {
  background: #fffbeb;
}

.dashboard-counter-pill-ok {
  background: #ecfdf5;
}

.dashboard-counter-value {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
}

.dashboard-counter-warning {
  color: #b45309;
}

.dashboard-counter-ok {
  color: #047857;
}

.dashboard-counter-caption {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 600;
  margin-top: 13px;
}

.dashboard-counter-link {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

/* input type=color dentro BlazorTextInput (Colore utente, Colore tipologia note spese): senza
   vincoli il wrapper .form-control eredita width:100% dagli altri campi testo e l'input diventa
   una barra piena a tinta unita, non riconoscibile come controllo cliccabile. Dimensione fissa e
   compatta, come un vero swatch. */
.dxbl-input-editor.form-control:has(input[type="color"]) {
  width: 56px;
  flex: 0 0 auto;
}

input[type="color"].dxbl-text-edit-input {
  width: 100%;
  height: 34px;
  padding: 2px;
  cursor: pointer;
  border-radius: 6px;
}

.form-grid-wide {
  grid-column: span 2;
}

.standard-date-input {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
}

.standard-date-input > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Nelle modal editor gli altri campi (Descrizione, Cliente, Importo, ...) hanno
   etichetta in maiuscoletto/sentence-case senza text-transform: la data, sola,
   spiccava in maiuscolo. Allineata alle altre per coerenza nella stessa form. */
.settings-detail-panel .standard-date-input > label,
.editor-dialog .standard-date-input > label {
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}

.standard-date-edit {
  min-width: 0;
  width: 100%;
}

/* Stessa altezza minima del combo DevExpress affiancato (.blazor-combo-box, min-height:38px sopra):
   senza questa regola DxDateEdit usa la propria altezza di default DevExpress, piu' bassa di 38px,
   e i due campi affiancati nello stesso form (es. "Data spesa"/"Tipo spesa") risultavano disallineati
   in altezza. Il contesto Assenze aveva gia' questo fix ma solo per se stesso (.absences-form-grid/
   .absences-day-table); qui diventa la regola generale per tutte le altre schermate. */
.standard-date-edit.dxbl-text-edit {
  min-height: 38px;
}

.standard-date-edit-sm {
  font-size: 12px;
}

/* FIX DECISIVO: DevExpress renderizza i popup in DXBL-POPUP-ROOT a livello
   <body>, dentro un DXBL-POPUP-CELL con position:absolute; z-index:1050 che crea
   uno stacking context a 1050. La modal custom (.editor-modal) e' a z-index 1070:
   percio' tutto il popup-cell (1050) finisce DIETRO la modal e il calendario del
   DxDateEdit non si vede. Lo z-index interno del .dxbl-dropdown e' ininfluente
   perche' confinato nello stacking context del popup-cell. Quando una modal e'
   aperta alziamo il popup-cell sopra la modal: e' questo il punto reale. */
body.editor-modal-open .dxbl-popup-root,
body.editor-modal-open .dxbl-popup-cell {
  z-index: 13050 !important;
}

.editor-modal .dxbl-dropdown,
.editor-modal .dxbl-window,
.editor-modal .dxbl-flyout,
.editor-modal .dxbl-modal,
body.editor-modal-open .dxbl-dropdown,
body.editor-modal-open .dxbl-window,
body.editor-modal-open .dxbl-flyout,
body.editor-modal-open .dxbl-modal {
  z-index: 13050 !important;
}

.editor-modal .dxbl-modal > .dxbl-modal-root,
body.editor-modal-open .dxbl-modal > .dxbl-modal-root {
  z-index: 13060 !important;
}

.editor-modal .dxbl-dropdown > .dxbl-dropdown-dialog,
.editor-modal .dxbl-dropdown > .dxbl-dropdown-dialog.dxbl-edit-dropdown,
.editor-modal .dxbl-window > .dxbl-window-dialog,
.editor-modal .dxbl-modal > .dxbl-modal-root > .dxbl-popup,
.editor-modal .dxbl-modal > .dxbl-modal-root > .dxbl-popup.dxbl-edit-dropdown,
.editor-modal .dxbl-modal > .dxbl-modal-root > .dxbl-popup.dxbl-edit-dropdown > .dxbl-modal-content,
.editor-modal .standard-date-dropdown,
.editor-modal .standard-date-dropdown-body,
body.editor-modal-open .dxbl-dropdown > .dxbl-dropdown-dialog,
body.editor-modal-open .dxbl-dropdown > .dxbl-dropdown-dialog.dxbl-edit-dropdown,
body.editor-modal-open .dxbl-window > .dxbl-window-dialog,
body.editor-modal-open .dxbl-modal > .dxbl-modal-root > .dxbl-popup,
body.editor-modal-open .dxbl-modal > .dxbl-modal-root > .dxbl-popup.dxbl-edit-dropdown,
body.editor-modal-open .dxbl-modal > .dxbl-modal-root > .dxbl-popup.dxbl-edit-dropdown > .dxbl-modal-content,
body.editor-modal-open .standard-date-dropdown,
body.editor-modal-open .standard-date-dropdown-body {
  z-index: 13061 !important;
}

.standard-date-input-validation {
  color: #dc2626;
  font-size: 12px;
  font-weight: 750;
}

.field-hint {
  color: var(--warning);
  font-size: 11px;
  font-weight: 700;
}

.compact-form {
  max-width: 460px;
  grid-template-columns: 1fr;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.report-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-self: end;
  min-height: 38px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
}

.report-view-switch legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip: rect(0 0 0 0);
}

.report-view-switch label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 30px;
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.report-view-switch label.active {
  background: #fff;
  color: var(--primary-strong);
  box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}

.report-view-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.form-control,
.form-select,
.menu-search input,
.table-search {
  border-color: var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 400;
}

input:not([type="button"]):not([type="checkbox"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="radio"]):not([type="range"]):not([type="reset"]):not([type="submit"]),
select,
textarea,
.dxbl-text-edit input {
  font-weight: 400;
}

.form-control::placeholder,
.form-select::placeholder,
.menu-search input::placeholder,
.table-search::placeholder,
input::placeholder,
textarea::placeholder,
.dxbl-text-edit input::placeholder {
  font-weight: 400;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled,
input:disabled:not([type="hidden"]),
input[readonly]:not([type="hidden"]),
select:disabled,
textarea:disabled,
textarea[readonly],
.dxbl-text-edit.dxbl-disabled,
.dxbl-text-edit.dxbl-readonly,
.dxbl-text-edit.dxbl-disabled input,
.dxbl-text-edit.dxbl-readonly input {
  background: transparent !important;
  color: var(--text) !important;
  font-weight: 400 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: var(--text) !important;
}

.form-control:focus,
.form-select:focus,
.menu-search input:focus,
.table-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .14);
}

.blazor-combo-box.dxbl-text-edit {
  width: 100%;
  min-height: 38px;
  border-color: var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background-color: #fff;
}

.blazor-combo-box.dxbl-text-edit:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .14);
}

.blazor-combo-box.dxbl-text-edit .dxbl-btn-group-right,
.blazor-combo-box.dxbl-text-edit .dxbl-edit-btn-dropdown {
  border-left: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.blazor-combo-box.dxbl-text-edit .dxbl-edit-btn-dropdown {
  color: var(--muted);
}

.blazor-combo-box.dxbl-text-edit .dxbl-edit-btn-dropdown:hover,
.blazor-combo-box.dxbl-text-edit .dxbl-edit-btn-dropdown:focus-visible {
  color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  font-weight: 750;
  white-space: nowrap;
}

.btn::first-letter {
  text-transform: uppercase;
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* !important su tutte le regole hover/focus/disabled qui sotto (2026-09-21, vedi audit
   bottoni-bianchi-al-hover): il tema DevExpress (blazing-berry) definisce
   .dxbl-btn:not(.dxbl-disabled):not(:disabled):hover con 4 "classi" di specificita' (via i due
   :not()), che batte sempre le nostre regole a 1-2 classi indipendentemente dall'ordine di
   caricamento CSS - la classe dxbl-btn e' presente su OGNI <DxButton>, incluso quello dentro
   BlazorActionButton/BlazorSaveButton (RenderStyle=None, usato ovunque per le icone azione riga).
   Senza !important lo sfondo hover ricade sul default DevExpress (transparent = bianco sulle
   righe tabella) e il colore su #212529, cancellando il colore custom del sito solo in hover
   (lo stato normale resta corretto perche' li' il selettore DevExpress non ha i :not() extra).
   Stesso problema gia' noto e patchato solo per .btn-danger in 2 punti circoscritti (vedi
   .quick-actions .page-hero-danger-group .btn-danger sopra); qui risolto una volta per tutte. */
.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--primary-strong) !important;
  background: var(--primary-strong) !important;
  color: #fff !important;
}

.btn-outline-primary {
  border-color: var(--primary-tint-12);
  color: var(--primary);
  background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  color: var(--primary-strong) !important;
}

.btn-outline-secondary {
  border-color: var(--border-strong);
  color: #475569;
  background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
  color: var(--text) !important;
}

.btn-danger,
.btn-outline-danger:hover,
.btn-outline-danger:focus {
  border-color: var(--danger) !important;
  background: var(--danger) !important;
  color: #fff !important;
}

.btn-outline-danger {
  border-color: #fecaca;
  color: var(--danger);
  background: #fff;
}

/* Conferma positiva (es. "Approva"): verde, come .btn-danger e' sempre rosso. !important su hover/focus per lo stesso
   conflitto di specificita' col tema DevExpress descritto sopra. */
.btn-success {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.btn-success:hover,
.btn-success:focus {
  border-color: #047857 !important;
  background: #047857 !important;
  color: #fff !important;
}

/* Popup di dettaglio di un blocco del calendario di pianificazione (posizionato accanto al punto cliccato; il backdrop
   trasparente lo chiude al click fuori). Sostituisce il tooltip nativo DevExpress. */
.planning-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: transparent;
}

.planning-popover {
  position: fixed;
  z-index: 1201;
  display: grid;
  gap: 4px;
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 12px 34px 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 0.9rem;
}

.planning-popover strong {
  overflow-wrap: anywhere;
}

.planning-popover .planning-popover-action {
  justify-self: start;
  margin-top: 6px;
}

.planning-popover-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

/* Stato disabilitato uniforme per tutte le varianti .btn-* (incluse quelle DevExpress via
   BlazorActionButton/BlazorSaveButton/ecc, che renderizzano comunque un <button disabled>):
   grigio invece del solo dimming di opacity di Bootstrap, che con .btn-primary/.btn-danger
   restava troppo colorato per leggersi come "non cliccabile". !important per lo stesso motivo
   di conflitto di specificita' col tema DevExpress spiegato sopra. */
.btn:disabled,
.btn.disabled,
.btn:disabled:hover,
.btn.disabled:hover,
.btn:disabled:focus,
.btn.disabled:focus {
  background: var(--surface-soft) !important;
  border-color: var(--border-strong) !important;
  color: var(--muted) !important;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}

.compact-filter {
  max-width: 220px;
}

.tag-list,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-list {
  margin-top: 8px;
}

.settings-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-page-head h2 {
  margin: 3px 0 4px;
  font-size: 22px;
  font-weight: 800;
}

.settings-page-head p {
  margin: 0;
  color: var(--muted);
}

.settings-form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.settings-main,
.settings-side {
  display: grid;
  gap: 16px;
}

.settings-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.settings-panel.compact {
  display: grid;
  gap: 8px;
}

.settings-panel.compact p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Card "Informazioni ticket": titolo/descrizione a sinistra, stato/priorita'/categoria/assegnato
   compatti a destra sulla stessa riga (disposizione richiesta su reference esterna, stile NetHub360). */
.ticket-info-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.ticket-info-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.ticket-info-meta {
  width: 240px;
  flex-shrink: 0;
  display: grid;
  gap: 10px;
}

@media (max-width: 720px) {
  .ticket-info-layout {
    flex-direction: column;
  }

  .ticket-info-meta {
    width: 100%;
  }
}

.settings-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

/* Stesso motivo di .surface-head: senza Title/Eyebrow le Actions restano l'unico figlio flex e
   "justify-content: space-between" le spinge a sinistra. Il selettore [class] individua solo il
   contenitore Actions, non un titolo senza classe rimasto da solo. */
.settings-panel-head > [class]:only-child {
  margin-left: auto;
}

.settings-panel-head h3 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
}

.settings-panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.settings-panel-subhead h4 {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 800;
}

.settings-form-grid,
.list-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  /* Senza questo, un campo corto (es. combo box) in coppia con uno alto (es. chip
     suggerimenti sotto un input) veniva stirato dallo stretch di default della griglia,
     gonfiando il controllo al posto di restare alla sua altezza naturale in alto. */
  align-items: start;
}

/* CAP, citta' e provincia su una sola riga (scheda sede di timbratura). */
.settings-address-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 84px;
  gap: 12px;
  align-items: start;
}

.settings-address-row > * {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.settings-day-schedule {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.settings-form-grid > .settings-day-schedule.span-2,
.form-grid > .settings-day-schedule.admin-wide {
  grid-column: 1 / -1;
}

.settings-day-schedule__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-day-schedule__header strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.settings-day-schedule__header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.settings-day-schedule__rows {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(70px, 90px) repeat(4, minmax(90px, 1fr)) auto auto;
  gap: 8px 10px;
  align-items: center;
  overflow-x: auto;
}

.settings-day-schedule__copy-button {
  justify-self: start;
}

.settings-day-schedule__time-invalid {
  border-color: #dc2626;
  background: #fff5f5;
}

.settings-day-schedule__warning {
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff5f5;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
}

.settings-day-schedule__col-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.settings-day-schedule__row {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.settings-day-schedule__row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-day-schedule__day-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.company-two-factor-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) auto;
}

.company-two-factor-method {
  align-self: stretch;
}

.company-two-factor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.list-filter-grid {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

/* Campo Colore utente + pulsante "Ripristina colore" sulla stessa riga. */
.color-field-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.color-field-row > .field {
  flex: 1 1 auto;
}

.color-field-row > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.field.span-2 {
  grid-column: span 2;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: transparent;
  color: var(--text);
  border-style: solid;
  font-weight: 400;
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}

.color-preview-input {
  border-left: 18px solid var(--primary);
}

.color-preview-input.secondary {
  border-left-color: var(--teal);
}

.upload-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: center;
  color: var(--muted);
}

.upload-mark {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 30px;
  font-weight: 800;
}

.logo-preview-image {
  width: 132px;
  height: 132px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px;
}

.upload-input {
  max-width: 100%;
  margin-top: 6px;
}

.company-logo-input {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.company-logo-preview {
  display: grid;
  place-items: center;
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.company-logo-preview span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 24px;
  font-weight: 800;
}

.company-logo-control {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
}

.company-logo-error {
  color: var(--danger);
  font-weight: 700;
}

.settings-actions {
  display: grid;
  gap: 8px;
}

.settings-actions.horizontal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.settings-tab-shell {
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #f8fafc;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.settings-tabs {
  /* Colore della linea in basso: base per tutte le tab, piu' spessa sotto quella attiva. */
  --tab-accent: var(--primary);
  /* Tab compatte allineate a sinistra (come nel flusso approvativo): ogni tab prende la larghezza del testo. */
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 16px;
  overflow: visible;
  scrollbar-width: none;
}

.settings-tab-shell .settings-tabs,
.surface-head .settings-tabs {
  margin-bottom: 0;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 48px;
  min-width: max-content;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  /* Linea di base continua sotto tutti i pulsanti, fino all'ultimo visibile. */
  box-shadow: inset 0 -1px var(--tab-accent, var(--primary));
}

.settings-tab:hover {
  background: var(--primary-tint-6);
  color: var(--primary);
}

.settings-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 -3px var(--tab-accent, var(--primary));
}

.settings-tab.active::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: #fff;
}

.partner-company-tabs {
  padding: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #eaf0f8;
}

.partner-company-tabs {
  --tab-accent: var(--primary);
}

.partner-company-tabs .settings-tab {
  border-right-color: #cbd5e1;
  border-radius: 6px;
  color: #334155;
}

.partner-company-tabs .settings-tab:hover {
  background: var(--primary-tint-9);
  color: var(--primary-strong);
}

.partner-company-tabs .settings-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: inset 0 -3px var(--tab-accent, var(--primary)), 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Modificatore storico: l'allineamento a sinistra ora vale per tutte le .settings-tabs. */
.settings-tabs--left {
  width: fit-content;
  max-width: 100%;
}

.settings-tabs--left .settings-tab {
  flex: 0 0 auto;
}

/* Pagine di dettaglio con pochi dati: meta' larghezza, allineate a sinistra; sotto i 900px tornano piene. */
.work-surface--half {
  max-width: 50%;
  margin-right: auto;
}

@media (max-width: 900px) {
  .work-surface--half {
    max-width: 100%;
  }
}

/* Dettaglio a meta' schermata delle Impostazioni: il corpo scorre con la pagina, non in un riquadro. */
.settings-detail-panel > .editor-body {
  overflow: visible;
  padding: 0;
}

.company-tab-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.company-tab {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.company-tab span,
.company-tab small {
  color: var(--muted);
  font-size: 12px;
}

.company-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.company-tab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.company-tab-actions form {
  margin: 0;
}

.favorite-star {
  color: #cbd5e1;
  font-size: 22px;
  line-height: 1;
}

.favorite-star.active {
  color: var(--warning);
}

.favorites-help-panel {
  max-width: 980px;
}

.favorite-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.favorite-summary-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.favorite-summary-item > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #fffbeb;
  color: var(--warning);
}

.favorite-summary-item strong,
.favorite-summary-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-summary-item small {
  color: var(--muted);
  font-weight: 750;
}

.empty-table-state {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.empty-table-state .inline-action-form {
  margin-top: 10px;
}

.expense-payment-options {
  display: grid;
  gap: 8px;
}

.expense-payment-options > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.expense-page-head {
  margin-bottom: 12px;
}

.expense-month-strip {
  margin-bottom: 12px;
}

/* Stile della card mese, ripristinato: viveva in .presence-day-card (classe condivisa con Timbrature),
   rimossa il 2026-09-25 nel redesign della day-strip di Timbrature (commit ca3a6456) senza accorgersi
   che questa pagina la riusava per la propria card mese - da quel momento la card era rimasta spoglia
   (nessun bordo/sfondo/hover/stato attivo). Ora e' indipendente da Timbrature, stessi valori di prima. */
.expense-month-card {
  position: relative;
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 150px;
  min-height: 96px;
  padding: 12px 10px;
  border: 2px solid rgba(14, 165, 233, .72);
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  font: inherit;
  text-align: center;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.expense-month-card:disabled {
  cursor: progress;
  opacity: .72;
}

.expense-month-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

.expense-month-card span {
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  text-transform: lowercase;
}

.expense-month-card strong {
  color: #1f2937;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.expense-month-card small {
  color: #64748b;
  font-weight: 800;
  text-transform: lowercase;
}

.expense-month-card.active {
  border-color: var(--primary-bright);
  background: var(--primary-bright);
}

.expense-month-card.active span,
.expense-month-card.active strong,
.expense-month-card.active small {
  color: #fff;
}

.expense-month-card em {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-tint-7);
  color: var(--primary-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.expense-month-card.active em {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.expense-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.expense-context-bar {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbe3ee;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .05);
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 12px 16px;
}

.expense-context-company,
.expense-context-brand {
    align-items: center;
    display: flex;
    gap: 10px;
}

.expense-context-brand {
    justify-content: flex-end;
    text-align: right;
}

.expense-context-logo {
    align-items: center;
    background: var(--primary-soft);
    border: 1px solid var(--primary-tint-10);
    border-radius: 12px;
    color: var(--primary-strong);
    display: inline-flex;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    min-width: 38px;
}

.expense-context-bar small {
    color: #64748b;
    display: block;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
}

.expense-context-bar strong {
    color: #0f172a;
    display: block;
    font-weight: 900;
}

.expense-summary-card {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-tint-1) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .045);
}

.expense-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.expense-summary-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.expense-detail-total-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.expense-total-card {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 13px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
}

.expense-detail-total-grid .expense-total-card {
  justify-items: end;
  text-align: right;
}

.expense-total-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.expense-total-card strong {
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
}

.expense-total-card small {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.expense-total-card.regular {
  border-color: #86efac;
  background: linear-gradient(135deg, #ecfdf5 0%, #bbf7d0 100%);
}

.expense-total-card.regular strong {
  color: #15803d;
}

.expense-total-card.mileage {
  border-color: var(--primary-tint-13);
  background: linear-gradient(135deg, var(--primary-tint-4) 0%, var(--primary-tint-10) 100%);
}

.expense-total-card.mileage strong {
  color: var(--primary-strong);
}

.expense-total-card.period {
  border-color: #fdba74;
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
}

.expense-total-card.period strong {
  color: #c2410c;
}

.expense-total-card.approved {
  border-color: #c4b5fd;
  background: linear-gradient(135deg, #f5f3ff 0%, #ddd6fe 100%);
}

.expense-total-card.approved strong {
  color: #6d28d9;
}

.expense-notes-grid {
  grid-template-columns: minmax(360px, .78fr) minmax(0, 1.22fr);
  align-items: start;
}

.expense-approval-list-layout {
  display: block;
  width: 100%;
}

.expense-approval-list-layout .expense-note-list-surface {
  max-width: none;
  width: 100%;
}

.expense-note-list-surface,
.expense-note-detail-surface,
.workflow-approvals-surface,
.company-closure-surface,
.work-surface:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)),
.work-surface:has(> .standard-table-shell > .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)),
.settings-panel:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)),
.settings-panel:has(> .standard-table-shell > .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.expense-approval-head .quick-actions {
  justify-content: flex-end;
}

.expense-approval-surface {
  box-shadow: 0 16px 34px rgba(15, 23, 42, .07);
}

.expense-full-surface {
    margin-bottom: 16px;
    max-width: none;
    width: 100%;
}

.expense-approval-filters {
    align-items: end;
    background: var(--primary-tint-1);
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, .8fr) auto auto;
    margin: 0 0 14px;
    padding: 12px;
}

.expense-approval-filters label {
    color: #334155;
    font-size: .78rem;
    font-weight: 800;
    margin: 0;
}

.approval-amount-form {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.approval-amount-form .form-control {
    max-width: 110px;
    text-align: right;
}

.expense-note-list-surface::before,
.expense-note-detail-surface::before,
.workflow-approvals-surface::before,
.company-closure-surface::before,
.work-surface:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table))::before,
.work-surface:has(> .standard-table-shell > .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table))::before,
.settings-panel:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table))::before,
.settings-panel:has(> .standard-table-shell > .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table))::before,
.smart-table-surface::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #0f766e);
  opacity: .88;
}

.expense-note-list-surface .surface-head {
  gap: 12px;
  padding-bottom: 14px;
}

.expense-note-list-surface .surface-head,
.expense-note-detail-surface .surface-head {
  align-items: flex-start;
  flex-direction: column;
}

.expense-note-detail-surface .surface-head.expense-detail-toolbar {
  align-items: center;
  flex-direction: row;
  justify-content: flex-end;
  margin-bottom: 14px;
  padding-bottom: 0;
}

.expense-note-detail-surface .expense-detail-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  width: 100%;
}

.expense-back-text-button {
  background: #fff;
  border-color: #cfe0ff;
  color: #334155;
  min-height: 34px;
  padding-inline: 14px;
  white-space: nowrap;
}

.expense-back-text-button:hover,
.expense-back-text-button:focus-visible {
  background: var(--primary-tint-1);
  border-color: #9bbcff;
  color: var(--primary-deep);
}

.expense-note-list-surface .surface-head {
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
}

.work-surface:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) > .surface-head,
.work-surface:has(> .standard-table-shell > .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) > .surface-head,
.settings-panel:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) > .surface-head,
.settings-panel:has(> .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) > .settings-panel-head,
.settings-panel:has(> .standard-table-shell > .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) > .surface-head,
.settings-panel:has(> .standard-table-shell > .table-responsive > .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) > .settings-panel-head {
  align-items: center;
  flex-direction: row;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 14px;
}

.expense-note-detail-surface .surface-head {
  align-items: flex-start;
  flex-direction: column;
}

.expense-note-list-surface .surface-head p,
.expense-note-detail-surface .surface-head p {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  margin-top: 2px;
}

.expense-note-list-surface .surface-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  margin-left: auto;
  white-space: nowrap;
}

.expense-toolbar-button {
  min-height: 34px;
}

.expense-note-list-surface .table-responsive,
.expense-note-detail-surface .table-responsive {
  border-radius: 12px;
}

.table-command-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.plan-procedure-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

/* Icona di menu caricata come file (/menu-icone/{id}): a differenza delle icone di sistema, che sono
   SVG inline colorati dal CSS, questa e' un'immagine e mantiene i propri colori. */
.menu-icon-image {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.menu-icon-preview {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.table-toolbar-split {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 0 0 14px;
  width: 100%;
}

.table-toolbar-left,
.table-toolbar-right {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.table-toolbar-left {
  justify-content: flex-start;
}

.table-toolbar-right {
  justify-content: flex-end;
  margin-left: auto;
}

.manual-toolbar .surface-head {
  margin-bottom: 10px;
}

.manual-search-panel {
  margin-bottom: 16px;
}

.manual-search-row {
  align-items: center;
  display: flex;
  gap: 8px;
  max-width: 760px;
  width: 100%;
}

.manual-search-input {
  flex: 1 1 auto;
  min-width: 0;
}

.manual-layout {
  align-items: flex-start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}

.manual-layout.article-layout {
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
}

.manual-layout.management-layout {
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
}

.manual-layout.management-layout .manual-article-surface {
  width: 100%;
}

.manual-sidebar {
  max-height: calc(100vh - 112px);
  overflow: auto;
  position: sticky;
  top: 84px;
}

.manual-nav {
  display: grid;
  gap: 12px;
}

.manual-nav-section {
  display: grid;
  gap: 6px;
}

.manual-nav-section-title {
  background: transparent;
  border: 0;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  padding: 0;
  text-align: left;
  width: 100%;
}

.manual-nav-section-title {
  align-items: flex-end;
  gap: 8px;
}

.manual-nav-section-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.manual-nav-section-title small {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
}

.manual-nav-section-title:hover span,
.manual-nav-section-title:focus span {
  color: var(--primary);
  outline: none;
}

.manual-nav-link {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

a.manual-nav-link {
  text-decoration: none !important;
}

.manual-nav-link:hover,
.manual-nav-link:focus {
  border-color: var(--primary-tint-14);
  outline: none;
}

.manual-nav-link.active {
  background: var(--primary-tint-6);
  border-color: var(--primary);
}

.manual-nav-link strong {
  font-size: 13px;
  line-height: 1.25;
}

.manual-result-card em,
.manual-nav-link span,
.manual-nav-link small,
.manual-article-meta {
  color: var(--muted);
  font-size: 12px;
}

.manual-article-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.manual-state-pill {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
}

.manual-state-pill.published {
  background: #dcfce7;
  color: #166534;
}

.manual-state-pill.draft {
  background: #fef3c7;
  color: #92400e;
}

.manual-article-body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  max-width: none;
}

.manual-article-body img {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  height: auto;
  margin: 4px 0 12px;
  max-width: 100%;
}

.manual-reader-grid {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.manual-reader-grid.has-index {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
}

.manual-article-main {
  min-width: 0;
}

.manual-article-body h2,
.manual-article-body h3 {
  color: var(--text);
  font-weight: 850;
  letter-spacing: 0;
  margin: 18px 0 8px;
  scroll-margin-top: 96px;
}

.manual-article-body h2:first-child,
.manual-article-body h3:first-child {
  margin-top: 0;
}

.manual-article-body p,
.manual-article-body ul,
.manual-article-body ol,
.manual-article-body table {
  margin-bottom: 12px;
}

.manual-article-body table {
  border-collapse: collapse;
  width: 100%;
}

.manual-article-body th,
.manual-article-body td {
  border: 1px solid var(--border);
  padding: 7px 9px;
  vertical-align: top;
}

.manual-article-body th {
  background: #f8fafc;
  font-weight: 800;
}

.novita-page {
  display: grid;
  gap: 0;
}

.novita-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.novita-item:first-child {
  padding-top: 4px;
}

.novita-item:last-child {
  border-bottom: none;
}

.novita-item-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.novita-version {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.novita-type-chip {
  font-size: 11px;
}

.novita-date {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
}

.novita-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 8px;
}

.novita-changelog {
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.novita-changelog p,
.novita-changelog ul,
.novita-changelog ol {
  margin: 0 0 10px;
}

.novita-changelog ul,
.novita-changelog ol {
  padding-left: 20px;
}

.novita-changelog p:last-child,
.novita-changelog ul:last-child,
.novita-changelog ol:last-child {
  margin-bottom: 0;
}

.novita-load-more {
  padding-top: 8px;
  text-align: center;
}

.manual-home,
.manual-results {
  display: grid;
  gap: 16px;
}

.manual-result-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

a.manual-result-card {
  text-decoration: none !important;
}

.manual-result-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.manual-result-list {
  display: grid;
  gap: 8px;
}

.manual-result-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.manual-result-card:hover,
.manual-result-card:focus {
  border-color: var(--primary-tint-14);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  outline: none;
}

.manual-results-editorial {
  max-width: 660px;
  margin: 0 auto;
}

.manual-results-editorial .manual-result-card {
  gap: 6px;
  padding: 16px 18px;
  border-radius: 12px;
}

.manual-results-editorial .manual-result-eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.manual-results-editorial .manual-result-card strong {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.manual-result-snippet {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.manual-tree {
  display: grid;
  gap: 8px;
}

.manual-dx-tree {
  color: var(--text);
  font: inherit;
}

/* DxTreeView possiede il proprio markup: la riga cliccabile e' [role="treeitem"],
   non una classe nostra. Lo stile riga/hover/marker va agganciato li', non su
   classi custom che DxTreeView non applica mai. Sezioni e foglie condividono la
   riga base; solo le foglie ricevono il rientro extra (badge/chevron delle
   sezioni sono contenuto reale nel NodeTemplate, non piu' un ::before CSS). */
.manual-dx-tree [role="treeitem"] {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  transition: background-color .12s ease, border-color .12s ease;
}

.manual-dx-tree [role="treeitem"]:has(.manual-tree-leaf) {
  padding-left: 42px;
}

.manual-dx-tree [role="treeitem"]:hover,
.manual-dx-tree [role="treeitem"]:focus-visible {
  background: #f8fbff;
  border-color: #dbeafe;
  outline: none;
}

.manual-dx-tree [role="treeitem"]:has(.manual-tree-leaf.active) {
  background: #eff6ff;
  border-color: transparent;
  box-shadow: inset 2px 0 0 var(--primary);
}

.manual-tree-main {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.manual-tree-section {
  gap: 9px;
}

.manual-tree-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 999px;
  background: #eef3f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.manual-dx-tree [role="treeitem"][aria-expanded="true"] .manual-tree-badge {
  background: var(--primary);
  color: #fff;
}

.manual-tree-section strong {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.manual-tree-chevron {
  flex: 0 0 auto;
  color: #c0ccda;
  font-size: 16px;
  line-height: 1;
  transition: transform .18s ease, color .18s ease;
}

.manual-dx-tree [role="treeitem"][aria-expanded="true"] .manual-tree-chevron {
  color: var(--primary);
  transform: rotate(90deg);
}

.manual-tree-leaf strong {
  flex: 1 1 auto;
  min-width: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}

.manual-tree-leaf small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.manual-tree-leaf.active strong {
  color: var(--primary-strong);
  font-weight: 700;
}

.manual-article-index {
  background: var(--primary-tint-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-bottom: 0;
  padding: 13px 15px;
}

.manual-article-index:empty {
  display: none;
}

.manual-article-index span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.manual-article-index ol {
  display: grid;
  font-size: 13px;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.manual-article-index li.nested {
  margin-left: 14px;
}

.manual-article-index a {
  color: var(--primary-strong);
  font-weight: 800;
  text-decoration: none;
}

.manual-article-index a:hover,
.manual-article-index a:focus {
  text-decoration: underline;
}

.manual-reader-grid .manual-article-index {
  max-height: calc(100vh - 132px);
  overflow: auto;
  position: sticky;
  top: 92px;
}

.manual-editorial {
  max-width: 660px;
  margin: 0 auto;
  padding: 6px 4px 8px;
}

.manual-editorial-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.manual-editorial-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
}

.manual-editorial-breadcrumb a:hover,
.manual-editorial-breadcrumb a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.manual-editorial-eyebrow {
  margin: 0 0 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
}

.manual-editorial-title {
  margin: 0 0 16px;
  text-align: center;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  text-wrap: balance;
}

.manual-editorial-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--muted);
}

.manual-editorial-meta-sep {
  color: #cbd5e1;
}

.manual-editorial-lead {
  margin: 0 0 28px;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.7;
  color: #475569;
}

.manual-editorial-chips {
  margin: 0 0 32px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.manual-editorial-chips-label {
  display: block;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.manual-editorial-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manual-editorial-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.manual-editorial-chip:hover,
.manual-editorial-chip:focus-visible {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-1);
  outline: none;
}

.manual-editorial-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.manual-editorial-body {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  color: #334155;
}

.manual-editorial-body h2,
.manual-editorial-body h3,
.manual-editorial-body h4 {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  color: var(--text);
  line-height: 1.3;
}

.manual-editorial-body h2 {
  margin: 40px 0 14px;
  font-size: 26px;
  font-weight: 700;
}

.manual-editorial-body h2:first-child {
  margin-top: 0;
}

.manual-editorial-body h3 {
  margin: 32px 0 12px;
  font-size: 21px;
  font-weight: 700;
}

.manual-editorial-body h4 {
  margin: 26px 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.manual-editorial-body p {
  margin: 0 0 18px;
}

.manual-editorial-body ul,
.manual-editorial-body ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.manual-editorial-body li {
  margin-bottom: 6px;
}

.manual-editorial-body a {
  color: var(--primary);
}

.manual-editorial-body img {
  max-width: 100%;
  border-radius: 10px;
}

.manual-editorial-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
}

.manual-editorial-body th,
.manual-editorial-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.manual-callout {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: "Inter", system-ui, sans-serif;
}

.manual-callout-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.manual-callout-body {
  min-width: 0;
}

.manual-callout-body strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 800;
}

.manual-callout-body p {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.manual-callout.tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.manual-callout.tip .manual-callout-icon {
  background: var(--primary);
}

.manual-callout.tip .manual-callout-icon::before {
  content: "i";
}

.manual-callout.tip .manual-callout-body strong {
  color: #1d4ed8;
}

.manual-callout.warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.manual-callout.warn .manual-callout-icon {
  background: #f97316;
}

.manual-callout.warn .manual-callout-icon::before {
  content: "!";
}

.manual-callout.warn .manual-callout-body strong {
  color: #c2410c;
}

.manual-callout.note {
  background: #f8fafc;
  border: 1px solid var(--border);
}

.manual-callout.note .manual-callout-icon {
  background: #94a3b8;
}

.manual-callout.note .manual-callout-icon::before {
  content: "•";
}

.manual-callout.note .manual-callout-body strong {
  color: #475569;
}

.manual-editorial-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-family: "Inter", system-ui, sans-serif;
}

.manual-pager-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .12s ease, background-color .12s ease;
}

.manual-pager-card:hover,
.manual-pager-card:focus-visible {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-1);
  outline: none;
}

.manual-pager-card strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.manual-pager-next {
  grid-column: 2;
  align-items: flex-end;
  text-align: right;
}

.manual-pager-direction {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
}

.manual-pager-spacer {
  grid-column: 1;
}

.manual-editor-form {
  display: grid;
  gap: 14px;
}

.manual-editor-page {
  display: grid;
  gap: 14px;
}

.manual-editor-surface {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.manual-editor-field {
  display: grid;
  gap: 6px;
}

.manual-editor-primary-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(320px, 2fr) minmax(220px, 1fr) minmax(160px, auto);
}

.manual-editor-title-field,
.manual-editor-module-field,
.manual-editor-summary-field,
.manual-editor-advanced-grid {
  align-items: start;
  width: 100%;
}

.manual-editor-title-field,
.manual-editor-module-field,
.manual-editor-summary-field,
.manual-editor-advanced-grid > * {
  min-width: 0;
}

.manual-editor-summary-field textarea {
  min-height: 68px;
  resize: vertical;
}

.manual-editor-advanced {
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 12px;
}

.manual-editor-advanced summary,
.manual-editor-preview summary,
.release-editor-advanced summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.manual-editor-advanced-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  margin-top: 12px;
}

.manual-editor-preview {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.manual-wysiwyg-editor {
  box-sizing: border-box;
  min-height: 620px;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.release-changelog-field {
  grid-template-columns: minmax(0, 1fr) !important;
  margin-top: 2px;
}

.release-changelog-editor {
  box-sizing: border-box;
  min-height: 320px;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.release-editor-advanced {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}

.release-editor-advanced-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  margin-top: 12px;
}

.manual-native-html-editor {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.manual-editor-actions {
  background: transparent;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.manual-confirm-dialog {
  width: min(560px, 100%);
}

.manual-empty-state {
  min-height: 120px;
}

.manual-structure {
  display: grid;
  gap: 12px;
}

.manual-structure-table-wrapper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 100%;
  overflow: auto;
  width: 100%;
}

.manual-structure-table {
  min-width: 760px !important;
}

.manual-structure-table th,
.manual-structure-table td {
  vertical-align: middle;
}

.manual-structure-table tbody tr.manual-structure-row > td {
  background: var(--node-row-bg, #fff) !important;
  border-color: var(--node-row-border, #e8eef7);
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, opacity .14s ease;
}

.manual-structure-row {
  --node-indent: calc(var(--node-level, 0) * 34px);
  --node-row-bg: #fff;
  --node-row-border: #e8eef7;
  --node-marker: #dbe3ee;
}

.manual-structure-row.level-0 {
  --node-level: 0;
}

.manual-structure-row.level-1 {
  --node-level: 1;
}

.manual-structure-row:nth-child(even) {
  --node-row-bg: var(--primary-tint-1);
}

.manual-structure-row:hover {
  --node-row-bg: var(--primary-tint-3);
  --node-row-border: var(--primary-tint-9);
}

.manual-structure-row.grouped {
  --node-marker: #ef4444;
  font-weight: 800;
}

.manual-structure-row.standard {
  --node-marker: #cbd5e1;
  font-weight: 600;
}

.manual-structure-table tbody tr.manual-structure-row > td:first-child {
  background: linear-gradient(to right, transparent 0 var(--node-indent), var(--node-row-bg) var(--node-indent) 100%) !important;
  border-left-color: transparent;
  box-shadow: none !important;
  padding-left: calc(10px + var(--node-indent)) !important;
  position: relative;
}

.manual-structure-table tbody tr.manual-structure-row > td:first-child::before {
  background: var(--node-marker);
  border-radius: 999px;
  bottom: 10px;
  content: "";
  left: calc(var(--node-indent) + 2px);
  position: absolute;
  top: 10px;
  width: 3px;
}

.manual-structure-table tbody tr.manual-structure-row.standard > td:first-child::before {
  opacity: .8;
  width: 2px;
}

.manual-structure-table .commesse-node-title {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
}

.manual-structure-table .commesse-chevron {
  align-items: center;
  background: #fff;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  color: var(--primary-strong);
  display: inline-flex;
  font-size: 13px;
  font-weight: 950;
  height: 22px;
  flex: 0 0 auto;
  justify-content: center;
  line-height: 1;
  width: 22px;
}

.manual-structure-table .commesse-chevron.empty {
  background: transparent;
  border-color: transparent;
  color: transparent;
}

.manual-structure-table .commesse-drag-handle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--primary-tint-9);
  border-radius: 999px;
  color: #64748b;
  cursor: grab;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  user-select: none;
  width: 24px;
}

.manual-structure-table .commesse-drag-handle:hover,
.manual-structure-table .commesse-drag-handle:focus-visible {
  border-color: var(--primary-tint-13);
  background: var(--primary-tint-4);
  color: var(--primary-strong);
  outline: none;
}

.manual-structure-table .commesse-drag-handle:active {
  cursor: grabbing;
}

.manual-structure-table .commesse-drag-handle.disabled {
  cursor: not-allowed;
  opacity: .45;
}

.manual-structure-link,
.manual-structure-section-title {
  color: var(--text);
  font-weight: 850;
  min-width: 0;
}

.manual-structure-link {
  color: var(--primary-strong, #1d4ed8);
  text-decoration: none;
}

.manual-structure-link:hover,
.manual-structure-link:focus {
  color: var(--primary-strong);
}

.manual-structure-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.manual-structure-table .actions-cell {
  width: 1%;
}

@media (max-width: 900px) {
  .manual-layout {
    grid-template-columns: 1fr;
  }

  .manual-layout.article-layout,
  .manual-reader-grid.has-index {
    grid-template-columns: 1fr;
  }

  .manual-sidebar {
    max-height: none;
    position: static;
  }

  .manual-reader-grid .manual-article-index {
    max-height: none;
    order: -1;
    position: static;
  }

  .manual-editor-primary-grid,
  .manual-editor-advanced-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .manual-search-row {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-search-input {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .manual-editorial-title {
    font-size: 28px;
  }

  .manual-editorial-lead {
    font-size: 17px;
  }

  .manual-editorial-meta {
    flex-wrap: wrap;
  }

  .manual-editorial-chip {
    min-height: 44px;
    padding: 10px 16px;
  }

  .manual-editorial-pager {
    grid-template-columns: 1fr;
  }

  .manual-pager-next {
    grid-column: 1;
    align-items: flex-start;
    text-align: left;
  }

  .manual-pager-card {
    min-height: 44px;
  }

  .manual-pager-spacer {
    display: none;
  }
}

.detail-command-bar {
  margin-bottom: 10px;
}

.expense-header-table tbody tr:hover td,
.expense-rows-table tbody tr:hover td {
  background: var(--primary-tint-2);
}

.expense-rows-table tbody tr.expense-approval-row.pending td {
  background-color: #fff8eb !important;
  border-color: #fde7bd;
}

.expense-rows-table tbody tr.expense-approval-row.pending.company-card td {
  background-color: var(--primary-tint-4) !important;
  border-color: var(--primary-tint-10);
}

.expense-rows-table tbody tr.expense-approval-row.approved td {
  background-color: #ecfdf5 !important;
  border-color: #bbf7d0;
}

.expense-rows-table tbody tr.expense-approval-row.approved.company-card td {
  background-color: var(--primary-tint-5) !important;
  border-color: var(--primary-tint-10);
}

.expense-rows-table tbody tr.expense-approval-row.rejected td {
  background-color: #fff1f2 !important;
  border-color: #fecdd3;
}

.expense-header-table tbody tr.expense-note-state.pending td {
  background-color: #fff8eb !important;
  border-color: #fde7bd;
}

.expense-header-table tbody tr.expense-note-state.approved td {
  background-color: #ecfdf5 !important;
  border-color: #bbf7d0;
}

.expense-header-table tbody tr.expense-note-state.rejected td {
  background-color: #fff1f2 !important;
  border-color: #fecdd3;
}

.expense-header-table tbody tr.expense-note-state.pending td:first-child {
  box-shadow: inset 4px 0 0 #f59e0b;
}

.expense-header-table tbody tr.expense-note-state.approved td:first-child {
  box-shadow: inset 4px 0 0 #16a34a;
}

.expense-header-table tbody tr.expense-note-state.rejected td:first-child {
  box-shadow: inset 4px 0 0 #dc2626;
}

/* Chiusura aziendale nello storico assenze: sfondo giallino, distinto dalle richieste normali. */
tbody tr.is-company-closure-row > td {
  background-color: #fff6d6 !important;
}

.expense-rows-table tbody tr.expense-approval-row.reimbursable td:first-child {
  box-shadow: inset 4px 0 0 #16a34a;
}

.expense-rows-table tbody tr.expense-approval-row.company-card td:first-child {
  box-shadow: inset 4px 0 0 var(--primary);
}

.expense-rows-table tbody tr.expense-approval-row.neutral td {
  background: #f8fafc;
}

.expense-rows-table tbody tr.expense-approval-row:hover td {
  filter: brightness(.985);
}

.expense-approval-legend {
  align-items: center;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 850;
  gap: 8px;
  justify-content: flex-start;
  margin: 0 0 10px;
}

.expense-approval-cell {
  align-items: flex-end;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
  min-width: 96px;
}

.expense-approval-cell strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.expense-approval-cell span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.expense-approval-cell em {
  background: var(--primary-soft);
  border-radius: 999px;
  color: var(--primary-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  padding: 3px 7px;
}

.expense-approval-legend span {
  align-items: center;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  display: inline-flex;
  gap: 6px;
  line-height: 1;
  padding: 6px 9px;
}

.expense-approval-legend i {
  border-radius: 999px;
  display: inline-block;
  height: 10px;
  width: 18px;
}

.expense-approval-legend i.approved {
  background: #bbf7d0;
}

.expense-approval-legend i.pending {
  background: #fde7bd;
}

.expense-approval-legend i.rejected {
  background: #fecdd3;
}

.expense-approval-legend i.company-card {
  background: #bfdbfe;
}

.expense-filter-row th {
  background: var(--primary-tint-1);
  padding: 6px 8px;
}

.expense-filter-row .form-control,
.expense-filter-row .form-select {
  border-color: #dbe3ee;
  border-radius: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 650;
  min-height: 32px;
  min-width: 120px;
  padding: 5px 8px;
}

.expense-row-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0 16px;
}

.expense-row-toolbar label {
  color: #64748b;
  display: grid;
  font-size: .78rem;
  font-weight: 850;
  gap: 5px;
  text-transform: uppercase;
}

.expense-row-toolbar input,
.expense-row-toolbar select {
  min-width: 150px;
}

.expense-group-row td,
.smart-table-group-row td {
  background: #eaf4ff !important;
  border-block: 1px solid var(--primary-tint-10);
  color: var(--primary-ink);
  font-weight: 900;
  padding: 0 !important;
}

.expense-group-row.collapsed td,
.smart-table-group-row.collapsed td {
  background: #f8fafc !important;
}

.expense-group-toggle,
.smart-table-group-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  display: inline-flex;
  gap: 10px;
  min-height: 42px;
  padding: 8px 14px;
  text-align: left;
  width: calc(100% - 140px);
}

.expense-group-toggle:hover,
.expense-group-toggle:focus-visible,
.smart-table-group-toggle:hover,
.smart-table-group-toggle:focus-visible {
  color: var(--primary);
}

.expense-group-arrow,
.smart-table-group-arrow {
  align-items: center;
  background: var(--primary-tint-9);
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  width: 24px;
}

.expense-group-row em,
.smart-table-group-row em {
  align-items: center;
  color: #0f172a;
  display: inline-flex;
  float: none;
  font-style: normal;
  font-weight: 900;
  justify-content: flex-end;
  min-height: 42px;
  min-width: 120px;
  padding-right: 14px;
  vertical-align: middle;
}

.smart-table-group-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 0 12px;
}

.smart-table-selection-clear:hover,
.smart-table-selection-clear:focus-visible {
  color: var(--primary-strong);
}

.expense-sort-icon {
  color: var(--primary);
  display: inline-flex;
  height: 14px;
  line-height: 1;
  margin-left: 4px;
  vertical-align: -2px;
  width: 14px;
}

.expense-sort-icon svg {
  display: block;
  fill: none;
  height: 100%;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
  width: 100%;
}

.expense-mini-col {
  text-align: center;
  width: 34px;
}

.expense-row-dot {
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.expense-row-dot.open {
  background: #dcfce7;
  border-color: #86efac;
}

.expense-row-dot.closed {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.expense-header-table .row-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 120px;
  width: 100%;
  white-space: nowrap;
}

.expense-header-table .actions-col {
  min-width: 190px;
  text-align: right;
  width: 190px;
}

.expense-header-table .actions-cell {
  min-width: 190px;
  text-align: right;
  width: 190px;
}

.expense-header-table .expense-header-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(132px, 1fr) 34px;
  justify-content: end;
  justify-items: end;
  margin-left: auto;
  min-width: 172px;
  width: 100%;
}

/* Terzo slot per l'orologio di stato approvazione (note spese). */
.expense-header-table .expense-header-actions.expense-header-actions--status {
  grid-template-columns: minmax(132px, 1fr) 34px 24px;
  min-width: 202px;
}

.expense-header-table .expense-header-actions.single-action {
  grid-template-columns: minmax(132px, 1fr) 34px;
}

.expense-header-table .expense-action-main-slot {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  min-height: 28px;
  min-width: 132px;
}

.expense-header-table .expense-action-icon-slot {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  min-height: 28px;
  width: 34px;
}

.expense-rows-table .row-actions {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  min-width: 72px;
  width: 100%;
  white-space: nowrap;
}

.expense-rows-table .actions-col,
.expense-rows-table .actions-cell {
  min-width: 104px;
  text-align: right;
  width: 104px;
}

.expense-attachment-actions {
  justify-content: center;
  min-width: 72px;
}

.btn-xs {
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  padding: 4px 8px;
}

.btn-icon-only {
  align-items: center;
  display: inline-flex;
  justify-content: center;
}

.expense-icon-button {
  flex: 0 0 34px;
  font-size: 15px;
  height: 34px;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.blazor-edit-button {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.expense-approved-input {
  display: inline-block;
  min-width: 92px;
  max-width: 110px;
}

.expense-approved-readonly {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: flex-end;
  min-width: 90px;
  white-space: nowrap;
}

/* Alone colorato dietro l'importo approvato/rifiutato al posto della chip di testo:
   stesso significato (esito della riga), meno ingombro e allineamento piu' semplice
   con le altre colonne valuta. */
.expense-approved-amount {
  border-radius: 8px;
  padding: 3px 8px;
}

.expense-approved-amount.is-approved {
  background: var(--success-soft);
  color: var(--success);
}

.expense-approved-amount.is-rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Tono neutro per le righe a carta aziendale (nessuna approvazione richiesta) e per quelle
   non ancora decise: stesso alone delle altre, cosi' l'importo non resta "sospeso" da solo
   nella cella larga pensata per badge+importo, ma senza il significato verde/rosso. */
.expense-approved-amount.is-neutral {
  background: var(--surface-soft);
  color: var(--muted);
}

.expense-approval-progress {
  display: grid;
  gap: 4px;
  min-width: 230px;
  max-width: 280px;
}

.expense-approval-progress-line {
  align-items: baseline;
  color: #64748b;
  display: grid;
  font-size: 11px;
  font-weight: 850;
  gap: 8px;
  grid-template-columns: 58px minmax(92px, 1fr) 40px;
}

.expense-approval-progress-line strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
}

.expense-approval-progress-line em {
  color: var(--primary);
  font-style: normal;
  text-align: right;
}

.expense-approval-progress small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.expense-approval-meter {
  background: #e2e8f0;
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
}

.expense-approval-meter span {
  background: linear-gradient(90deg, var(--primary), #0f766e);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.expense-approval-meter.reimbursable span {
  background: linear-gradient(90deg, #059669, #16a34a);
}

.expense-icon-button span {
  display: block;
  font-weight: 950;
  transform: translateY(-1px);
}

.expense-icon-button .button-icon-svg,
.partner-icon-button .button-icon-svg {
  display: block;
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 18px;
}

.expense-icon-button.btn-primary:not(:disabled),
.expense-icon-button.btn-primary:not(:disabled) span {
  color: #fff;
}

.expense-new-note-button,
.expense-submit-button {
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
  padding-inline: 14px;
  white-space: nowrap;
}

.expense-new-note-button {
  min-height: 36px;
}

/* Dentro la riga della tabella rendiconti il bottone non deve imporre la propria altezza alla riga
   (36px, pensati per l'header pagina, la sforzavano oltre gli altri controlli della stessa riga):
   si adatta all'altezza naturale della riga come l'icona "Modifica testata" a fianco. */
.expense-submit-button {
  min-height: 28px;
  padding-block: 2px;
}

.expense-view-toggle.btn-light {
  background: #fff;
  border-color: #dbe3ee;
  color: #64748b;
}

.expense-view-toggle.btn-light:hover {
  background: var(--primary-tint-1);
  border-color: var(--primary-tint-10);
  color: var(--primary);
}

.expense-view-toggle:focus,
.expense-view-toggle:active {
  box-shadow: none;
}

.partner-icon-button {
  flex: 0 0 34px;
  font-size: 15px;
  font-weight: 950;
  height: 34px;
  line-height: 1;
  margin-left: 4px;
  padding: 0;
  text-decoration: none;
  width: 34px;
}

.partner-icon-button span {
  display: block;
  transform: translateY(-1px);
}

.partner-icon-button.btn-outline-danger {
  color: #dc2626;
}

.partner-icon-button.btn-outline-success {
  color: #059669;
}

.partner-icon-button:disabled {
  opacity: .45;
}

.partner-company-name-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}

.partner-company-name-button:hover,
.partner-company-name-button:focus-visible {
  color: var(--primary-strong);
  text-decoration: none;
}

.table-name-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.partner-companies-table a.table-name-link,
.partner-companies-table a.table-name-link:hover,
.partner-companies-table a.table-name-link:focus-visible {
  text-decoration: none !important;
}

.row-edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 24px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.row-edit-link:hover,
.row-edit-link:focus-visible {
  color: var(--primary-strong);
  text-decoration: none;
}

.data-table tbody tr :where(.row-edit-link, .row-edit-trigger) {
  opacity: 0;
  pointer-events: auto;
  transform: translateX(-2px);
  transition: opacity .12s ease, transform .12s ease;
}

.data-table tbody tr:hover :where(.row-edit-link, .row-edit-trigger),
.data-table tbody tr:focus-within :where(.row-edit-link, .row-edit-trigger),
.data-table tbody tr :where(.row-edit-link, .row-edit-trigger):focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

@media (hover: none) {
  .data-table tbody tr :where(.row-edit-link, .row-edit-trigger) {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.company-type-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 4px 8px;
  white-space: nowrap;
}

.company-type-badge.is-primary {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.company-type-badge.is-secondary {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #155e75;
}

.m365-config-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.m365-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.m365-test-link {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  text-decoration: none;
}

.m365-test-link:hover,
.m365-test-link:focus-visible {
  text-decoration: none;
}

.m365-test-link-icon {
  align-items: center;
  background: #e0f2fe;
  border-radius: 4px;
  color: #0369a1;
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  height: 22px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.expense-approval-surface .expense-header-table,
.expense-approval-surface .expense-rows-table {
  min-width: 1220px;
}

.expense-approval-surface .surface-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  white-space: nowrap;
}

.expense-title-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: #0f172a;
  cursor: pointer;
  display: inline;
  font: inherit;
  font-weight: inherit;
  padding: 0;
  text-decoration: none;
  text-align: left;
}

.expense-title-link:hover,
.expense-title-link:focus-visible {
  color: var(--primary);
  text-decoration: none;
}

.expense-title-link:disabled,
.expense-title-link[aria-disabled="true"] {
  pointer-events: none;
  cursor: wait;
  opacity: .7;
}

.expense-note-table .chip:empty {
  display: none;
}

.favorite-manage-list {
  display: grid;
  gap: 8px;
}

.favorite-manage-row {
  align-items: center;
  background: var(--primary-tint-1);
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 14px;
}

.favorite-manage-row.active {
  background: var(--primary-tint-5);
  border-color: #bcd7ff;
}

.favorite-manage-row strong {
  color: var(--text);
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.favorite-manage-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}

.expense-note-row.table-active > td {
  border-color: var(--primary-tint-10) !important;
  background: var(--primary-tint-4) !important;
}

.expense-note-row.table-active > td:first-child {
  box-shadow: inset 4px 0 var(--primary) !important;
}

.expense-detail-actions {
  max-width: none;
}

.expense-back-icon-button {
  min-width: 34px;
  max-width: 34px;
}

.expense-toolbar-nowrap {
  flex-wrap: nowrap;
  justify-content: flex-end;
  white-space: nowrap;
}

.expense-empty-state {
  min-height: 180px;
  padding: 22px;
  text-align: center;
}

.expense-editor-dialog .surface-head {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 251, 255, .96)),
    linear-gradient(90deg, rgba(var(--primary-rgb), .16), rgba(15, 118, 110, .12));
}

.expense-editor-dialog.attachments-dialog {
  width: min(1280px, calc(100vw - 48px));
  height: min(820px, calc(100dvh - 48px));
  max-height: min(820px, calc(100dvh - 48px));
}

.expense-editor-dialog.attachments-dialog .editor-body {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.expense-editor-dialog.attachments-dialog .surface-head p {
  display: none;
}

.expense-modal-section {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 12px;
  background: var(--primary-tint-1);
}

.expense-modal-section strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}

.expense-modal-section span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.expense-field-with-note {
  display: grid;
  gap: 6px;
}

.expense-field-with-note > span,
.expense-field-info span,
.expense-total-preview span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.expense-field-with-note > span strong {
  color: #0f172a;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: none;
}

.expense-field-info {
  align-content: center;
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fbff;
}

.expense-field-info strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.expense-field-info .btn {
  justify-self: start;
}

.expense-total-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d1fae5;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.expense-total-preview strong {
  color: #0f172a;
  font-size: 22px;
  font-weight: 950;
}

.expense-total-preview small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-left: auto;
}

.form-delete-action,
.expense-delete-form-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.form-delete-action > .btn,
.form-delete-action > .dxbl-btn {
  flex: 0 0 auto;
  width: auto;
}

.expense-payment-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.expense-payment-options > span {
  grid-column: 1 / -1;
}

.expense-attachment-field input[type="file"] {
  padding: 18px;
  border-style: dashed;
  background: var(--primary-tint-1);
}

.expense-selected-files {
  display: grid;
  gap: 8px;
}

.expense-selected-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 12px;
  background: var(--primary-tint-1);
}

.expense-selected-file span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.expense-selected-file strong {
  overflow: hidden;
  color: var(--text);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-selected-file small {
  color: var(--muted);
  font-weight: 800;
}

.expense-report-choice {
  max-width: 420px;
  margin-bottom: 4px;
}

.expense-limit-warning {
  border: 1px solid #fbbf24;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 14px;
}

.expense-table-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 950;
}

.expense-table-flag.on {
  background: #dcfce7;
  color: #047857;
}

.expense-table-flag.off {
  background: #f1f5f9;
  color: #64748b;
}

.expense-attachment-summary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 62px;
  font-weight: 950;
}

.expense-attachment-summary-button.empty {
  border-color: #dbe3ee;
  color: #64748b;
  background: #f8fafc;
}

.expense-existing-attachments {
  display: grid;
  gap: 8px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 12px;
  background: var(--primary-tint-1);
  padding: 10px;
}

.expense-existing-attachments > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.expense-attachment-modal,
.expense-attachment-list {
  display: grid;
  gap: 10px;
}

.expense-attachment-modal {
  align-items: stretch;
  /* Il componente rende al massimo 2 figli diretti (attachment-shell + modal-form-actions
     opzionale): con 3 righe l'auto-placement sposta le azioni nella riga 1fr, ancorate in
     basso con align-self:end, lasciando vuota la riga auto e uno spazio morto sopra al footer. */
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.expense-attachment-modal-split {
  column-gap: 12px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.expense-attachment-modal-listonly {
  grid-template-columns: minmax(0, 1fr);
}

.expense-attachment-modal-split .modal-form-actions {
  align-self: end;
  grid-column: 1 / -1;
}

.expense-attachment-list.compact {
  gap: 8px;
}

.expense-attachment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  background: #fff;
  padding: 9px 10px;
}

button.expense-attachment-item {
  color: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

button.expense-attachment-item:hover,
button.expense-attachment-item:focus-visible,
button.expense-attachment-item.active {
  background: var(--primary-tint-4);
  border-color: var(--primary-tint-13);
  outline: none;
}

.expense-attachment-preview-action {
  align-items: center;
  background: var(--primary-tint-4);
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-size: 22px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}

.expense-attachment-item > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.expense-attachment-item strong {
  overflow: hidden;
  color: #0f172a;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-attachment-item small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

/* Sezione "Scontrino / Allegati" nella scheda spesa: colonna destra con area di
   trascinamento, lista allegati e anteprima - vedi AreaCaricamentoAllegati.razor,
   AllegatoRigaSpesa.razor e AnteprimaAllegatoSpesa.razor. */
.expense-row-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 18px;
}

.expense-row-editor-attachments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  position: sticky;
  top: 84px;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: var(--primary-tint-1);
}

.expense-row-editor-attachments h3 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.expense-row-editor-footer {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.expense-attachment-dropzone-wrap {
  position: relative;
}

.expense-attachment-dropzone {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 150px;
  padding: 16px 12px;
  border: 1px dashed var(--primary-tint-13);
  border-radius: 12px;
  background: #fff;
  color: #475569;
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.expense-attachment-dropzone strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.expense-attachment-dropzone span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.expense-attachment-dropzone-icon {
  font-size: 20px;
  line-height: 1;
}

.expense-attachment-dropzone:hover,
.expense-attachment-dropzone:focus-visible,
.expense-attachment-dropzone.dragging {
  border-color: var(--primary);
  background: var(--primary-tint-4);
  outline: none;
}

.expense-attachment-dropzone.disabled {
  cursor: not-allowed;
  opacity: .55;
}

.expense-attachment-dropzone-hint {
  margin: 4px 0 0;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
}

.expense-attachment-dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.expense-attachment-empty {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.expense-attachment-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  background: #fff;
}

.expense-attachment-row.has-error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.expense-attachment-row-thumb {
  display: grid;
  place-items: center;
  width: 46px;
  height: 58px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  font-size: 11px;
  font-weight: 950;
  color: #64748b;
}

.expense-attachment-row-thumb.pdf {
  color: #dc2626;
  background: #fef2f2;
}

.expense-attachment-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.expense-attachment-row-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.expense-attachment-row-text strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-attachment-row-text small {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.expense-attachment-row.has-error .expense-attachment-row-text small {
  color: #b91c1c;
}

.expense-attachment-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.expense-attachment-row-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
}

.expense-attachment-row-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary-tint-9);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: expense-attachment-spin .7s linear infinite;
}

@keyframes expense-attachment-spin {
  to {
    transform: rotate(360deg);
  }
}

.expense-attachment-preview-body {
  display: grid;
  place-items: center;
  min-height: 260px;
  max-height: 70vh;
  overflow: auto;
}

.expense-attachment-preview-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.expense-attachment-preview-frame {
  width: 100%;
  height: 70vh;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 1180px) {
  .expense-row-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .expense-row-editor-attachments {
    position: static;
    max-height: none;
  }
}

.attachment-workspace.expense-attachment-modal {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.attachment-workspace.expense-attachment-modal-split,
.attachment-workspace.expense-attachment-modal-listonly {
  grid-template-columns: minmax(0, 1fr);
}

.attachment-workspace .modal-form-actions {
  align-self: end;
  grid-column: 1 / -1;
}

.attachment-shell {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  min-height: 0;
}

.attachment-shell.list-only {
  grid-template-columns: minmax(0, 1fr);
}

.attachment-browser,
.attachment-preview-pane {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  min-width: 0;
}

.attachment-browser {
  display: grid;
  gap: 12px;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.attachment-browser-list {
  align-content: start;
  display: grid;
  gap: 8px;
  grid-auto-rows: min-content;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.attachment-list-item {
  align-items: start;
  background: #fbfdff;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 72px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.attachment-list-item:hover,
.attachment-list-item:focus-visible,
.attachment-list-item.active {
  background: var(--primary-tint-4);
  border-color: var(--primary-tint-13);
  outline: none;
}

.attachment-list-item.active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.attachment-list-item:focus-visible {
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .16);
}

.attachment-type-badge {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  color: #2563eb;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  letter-spacing: .03em;
  width: 42px;
}

.attachment-list-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.attachment-list-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.attachment-list-text strong {
  color: #0f172a;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-list-text small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.attachment-list-context {
  display: grid;
  gap: 6px 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.attachment-list-context span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.attachment-list-context .wide {
  grid-column: 1 / -1;
}

.attachment-list-context small {
  color: #64748b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.attachment-list-context strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.attachment-preview-pane {
  background: var(--primary-tint-1);
  display: grid;
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 460px;
  overflow: hidden;
  padding: 12px;
}

.attachment-preview-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.attachment-preview-actions,
.attachment-zoom-control {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* .btn-danger e' sempre rosso in tutto il sito (scelta voluta altrove, per segnalare sempre
   l'azione distruttiva). Qui il pulsante Elimina sta affiancato a due azioni non distruttive
   (Apri/Scarica, azzurrine solo in hover) e il rosso fisso spiccava troppo, leggendosi come gia'
   attivo. Solo in questo riquadro diventa rosso solo in hover/focus, coerente con le altre due. */
.attachment-preview-actions .btn-danger {
  background: #fff !important;
  border-color: #fecaca !important;
  color: var(--danger) !important;
}

.attachment-preview-actions .btn-danger:hover,
.attachment-preview-actions .btn-danger:focus {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}

.attachment-toolbar-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
}

.attachment-zoom-control {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  color: #334155;
  flex-wrap: nowrap;
  min-height: 38px;
  padding: 0 12px;
}

.attachment-zoom-control input[type="range"] {
  accent-color: var(--primary);
  cursor: pointer;
  width: 118px;
}

.attachment-lens-icon {
  background: linear-gradient(currentColor, currentColor) 5px 6px / 7px 2px no-repeat;
  color: currentColor;
  display: inline-block;
  height: 19px;
  position: relative;
  width: 19px;
}

.attachment-lens-icon.plus {
  background:
    linear-gradient(currentColor, currentColor) 5px 6px / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 8px 3px / 2px 8px no-repeat;
}

.attachment-lens-icon::before {
  border: 2px solid currentColor;
  border-radius: 999px;
  content: "";
  height: 13px;
  left: 0;
  position: absolute;
  top: 0;
  width: 13px;
}

.attachment-lens-icon::after {
  background: currentColor;
  border-radius: 999px;
  bottom: 1px;
  content: "";
  height: 2px;
  position: absolute;
  right: 0;
  transform: rotate(45deg);
  transform-origin: center;
  width: 8px;
}

.attachment-zoom-value {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  min-width: 44px;
  text-align: center;
}

.attachment-preview-frame {
  background: #fff;
  border: 0;
  border-radius: 12px;
  display: block;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.attachment-preview-canvas {
  display: grid;
  height: 100%;
  justify-items: center;
  place-items: center;
  width: 100%;
}

.attachment-preview-viewport {
  background:
    linear-gradient(45deg, rgba(148, 163, 184, .10) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, .10) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, .10) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, .10) 75%),
    #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  border: 1px solid #e5edf7;
  display: block;
  overflow: auto;
  padding: 14px;
  text-align: center;
}

.attachment-preview-image {
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: none;
  max-width: none;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  transition: width .12s ease;
}

.attachment-preview-empty {
  align-content: center;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  display: grid;
  gap: 12px;
  height: 100%;
  justify-items: center;
  min-height: 0;
  padding: 24px;
  text-align: center;
}

/* Sostituisce interamente l'anteprima (immagine/PDF) mentre si conferma l'eliminazione, invece di
   affiancarla: prima il banner di conferma stava sopra un'anteprima ancora renderizzata sotto,
   lasciando un vuoto enorme nel riquadro (grid-template-rows: auto minmax(0, 1fr) del pane) e, per
   i PDF, anche l'errore di caricamento del viewer sotto il banner. */
.attachment-preview-confirm-delete {
  align-content: center;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  display: grid;
  height: 100%;
  justify-items: center;
  min-height: 0;
  padding: 24px;
}

.attachment-preview-confirm-delete > div {
  width: 100%;
  max-width: 360px;
}

.attachment-preview-empty strong {
  color: #0f172a;
  font-weight: 900;
}

.attachment-preview-empty span {
  color: #64748b;
  font-weight: 800;
}

.expense-rows-table td:last-child .row-actions {
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .expense-editor-dialog.attachments-dialog {
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .expense-attachment-modal-split {
    grid-template-columns: minmax(180px, 38%) minmax(0, 1fr);
  }

  .attachment-workspace.expense-attachment-modal-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .attachment-shell {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .attachment-browser {
    max-height: 230px;
  }

  .attachment-preview-pane {
    min-height: 420px;
  }

  .attachment-preview-toolbar {
    align-items: center;
    justify-content: flex-start;
  }

  .attachment-preview-actions,
  .attachment-zoom-control {
    justify-content: flex-start;
  }

  .attachment-zoom-control {
    width: 100%;
  }

  .attachment-zoom-control input[type="range"] {
    flex: 1;
    width: auto;
  }

}

.settings-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.settings-link-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-decoration: none;
}

.settings-link-card:hover {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-1);
  color: var(--primary);
}

.settings-link-card > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--primary-tint-10);
  border-radius: var(--radius);
  background: var(--primary-tint-4);
  color: var(--primary);
  font-weight: 950;
}

.settings-link-card strong,
.settings-link-card small {
  display: block;
  min-width: 0;
}

.settings-link-card small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timestamp-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.timestamp-rule {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.timestamp-rule span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.timestamp-rule strong {
  color: var(--text);
  font-size: 14px;
}

.timestamp-profile-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.timestamp-reason-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timestamp-profile-note {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
}

.timestamp-profile-details {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.timestamp-profile-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.timestamp-profile-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* flex-direction:row-reverse mostra interruttore-poi-etichetta pur restando nel DOM
   etichetta-poi-interruttore (DxCheckBox LabelPosition.Left): l'asse principale per
   "row-reverse" e' invertito, quindi senza questo justify-content il contenuto si
   impacchetta sul lato VISIVAMENTE destro della cella invece che a sinistra - visibile
   soprattutto nelle griglie impostazioni a piu' colonne, dove la cella e' piu' larga
   del contenuto (interruttore+etichetta finiva spostato a destra con un vuoto a
   sinistra, invece di restare allineato all'inizio riga come gli altri campi). */
.admin-presence-page {
  display: grid;
  gap: 24px;
}

.presence-title-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  padding: 18px 24px;
  border: 1px solid rgba(216, 230, 247, .92);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}

.presence-title-shell h2 {
  margin: 0;
  color: #1f2937;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.presence-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  /* Senza margine la barra filtri (Anno/Mese/Aggiorna) toccava le card del periodo subito sotto,
     sembravano un unico blocco compresso. */
  margin-bottom: 16px;
}

.presence-period-picker,
.presence-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.presence-period-picker {
  position: relative;
}

.presence-period-picker summary {
  cursor: pointer;
  list-style: none;
}

.presence-period-picker summary::-webkit-details-marker {
  display: none;
}

.presence-period-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 24;
  display: grid;
  grid-template-columns: minmax(210px, .75fr) minmax(340px, 1fr);
  gap: 22px;
  min-width: min(780px, calc(100vw - 96px));
  padding: 22px;
  border: 1px solid rgba(216, 230, 247, .98);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(15, 23, 42, .18);
}

.presence-preset-list {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-right: 18px;
  border-right: 1px solid var(--border);
}

/* Il markup usa <button>, non <a>: senza reset dei default nativi (bordo, sfondo, font) il preset
   restava un bottone di sistema grezzo, lo stile sotto non veniva mai applicato. */
.presence-preset-list button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.presence-preset-list button:hover {
  background: var(--primary-tint-5);
  color: var(--primary-strong);
}

.presence-period-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.presence-period-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-weight: 800;
}

.presence-date-field {
  display: grid;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.presence-date-field .form-control {
  min-height: 42px;
  border-radius: 999px;
  font-weight: 500;
}

.presence-period-button,
.presence-actions .btn {
  min-height: 46px;
  border-radius: 999px;
  padding-inline: 22px;
  font-weight: 900;
}

.presence-more-menu {
  position: relative;
  flex: 0 0 auto;
}

.presence-more-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #eef3f9;
  color: #334155;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.presence-more-menu summary::-webkit-details-marker {
  display: none;
}

.presence-more-menu[open] summary {
  border-color: rgba(var(--primary-rgb), .24);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.presence-more-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 232px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

.presence-more-list a,
.presence-more-list button {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.presence-more-list a:hover,
.presence-more-list button:hover {
  background: var(--primary-tint-3);
}

.presence-more-list button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.presence-day-strip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 28px 12px;
}

.day-strip-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.day-strip-page-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-strip-page-label strong {
  font-size: 14px;
  color: var(--text);
  text-transform: capitalize;
}

.day-strip-page-label span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.day-strip-cards {
  display: flex;
  gap: 5px;
  width: 100%;
}

.day-all-pill {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 64px;
  height: 52px;
  border: none;
  border-radius: 8px;
  background: #168bdc;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.day-all-pill-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: .85;
}

.day-all-pill-value {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.day-all-pill-count {
  font-size: 9px;
  font-weight: 700;
  opacity: .85;
}

.day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Su schermi larghi (una pagina ha al massimo 31 card, non serve mai andare a capo) le card si
     allargano per riempire tutto lo spazio della riga invece di restare compresse a sinistra con
     un vuoto enorme a destra; min/max evitano che diventino minuscole o spropositate. */
  flex: 1 1 0;
  min-width: 38px;
  max-width: 64px;
  height: 52px;
  border: 2px solid rgba(14, 165, 233, .72);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.day-card-weekday {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: .01em;
}

.day-card-number {
  font-size: 16px;
  font-weight: 900;
  color: #1f2937;
  line-height: 1.15;
  margin-top: 1px;
}

.day-card.is-selected {
  background: var(--primary-bright);
  border-color: var(--primary-bright);
}

.day-card.is-selected .day-card-weekday,
.day-card.is-selected .day-card-number {
  color: #fff;
}

.day-card.is-today:not(.is-selected) {
  box-shadow: 0 0 0 2px var(--primary-bright) inset;
  border-color: var(--primary-bright);
}

.day-card.is-today:not(.is-selected) .day-card-weekday {
  color: var(--primary-bright);
}

.day-card.is-future {
  background: #f1f5f9;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: .68;
}

.day-card.is-future .day-card-weekday,
.day-card.is-future .day-card-number {
  color: #94a3b8;
}

.day-page-nav {
  flex: none;
  width: 36px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.day-page-nav:hover:not(:disabled) {
  background: #f1f5f9;
}

.day-page-nav:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.presence-today-label {
  margin-top: -22px;
  color: #334155;
  font-weight: 900;
  text-align: center;
}

.presence-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 28px;
}

.presence-subnav .module-switcher {
  margin: 0;
}

.presence-table-panel {
  margin-inline: 28px;
  overflow: hidden;
}

.presence-table-panel .surface-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
}

.presence-table-panel .surface-head > div:first-child {
  display: flex;
  align-items: center;
}

.presence-table-panel .surface-head h2 {
  margin: 0;
}

.presence-table-panel .surface-actions {
  justify-content: end;
}

.presence-table-panel .table-responsive {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.presence-table-panel .table-filter-row th {
  background: #fff;
}

.presence-table-panel .table-filter-row input,
.presence-table-panel .table-filter-row select,
.presence-table-panel .table-filter-row .dxbl-text-edit {
  min-height: 44px;
  border-radius: 10px;
  font-weight: 750;
}

.presence-stamps-table {
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.presence-stamps-table thead th {
  border-bottom: 0;
}

.presence-stamps-table tbody tr > td {
  padding: 14px 12px;
  border-top: 1px solid #e8eef7;
  border-bottom: 1px solid #e8eef7;
  background: #fff;
}

.presence-stamps-table tbody tr > td:first-child {
  border-left: 1px solid #e8eef7;
  border-radius: 14px 0 0 14px;
}

.presence-stamps-table tbody tr > td:last-child {
  border-right: 1px solid #e8eef7;
  border-radius: 0 14px 14px 0;
}

.presence-stamps-table tbody tr:hover > td {
  background: var(--primary-tint-1);
}

.presence-stamps-table tbody tr.table-group-row > td,
.data-table tbody tr.table-group-row > td {
  padding: 9px 12px;
  border: 1px solid var(--primary-tint-10);
  background: var(--primary-tint-4);
  color: var(--primary-ink);
  box-shadow: none;
}

.presence-stamps-table tbody tr.table-group-row > td:first-child,
.data-table tbody tr.table-group-row > td:first-child {
  border-radius: 12px 0 0 12px;
}

.presence-stamps-table tbody tr.table-group-row > td:last-child,
.data-table tbody tr.table-group-row > td:last-child {
  border-radius: 0 12px 12px 0;
}

.table-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: min(100%, 460px);
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.table-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 950;
}

.table-group-label {
  display: inline-grid;
  gap: 1px;
}

.table-group-label small {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.table-group-collapsed-item {
  display: none;
}

.table-group-total-cell {
  color: #0f172a !important;
  font-size: 13px;
  font-weight: 950;
}

.table-group-row span {
  margin-right: 8px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.table-group-row strong {
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 900;
}

.table-group-row .table-group-chevron,
.table-group-row .table-group-label {
  margin-right: 0;
  letter-spacing: 0;
  text-transform: none;
}

.table-group-row .table-group-chevron {
  color: var(--primary-strong);
  font-size: 14px;
}


.presence-stamps-table tbody tr.presence-stamp-row-ok > td:first-child {
  box-shadow: inset 4px 0 rgba(5, 150, 105, .7);
}

.presence-stamps-table tbody tr.presence-stamp-row-missed > td {
  border-color: #fed7aa;
  background: #fffaf0;
}

.presence-stamps-table tbody tr.presence-stamp-row-missed > td:first-child {
  box-shadow: inset 4px 0 var(--warning);
}

.presence-stamps-table tbody tr.presence-stamp-row-problem > td {
  border-color: #fecdd3;
  background: #fff6f7;
}

.presence-stamps-table tbody tr.presence-stamp-row-problem > td:first-child {
  box-shadow: inset 4px 0 var(--danger);
}

.presence-person-cell strong,
.presence-job-cell strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.presence-job-cell span,
.presence-muted-cell {
  display: block;
  max-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.presence-day-mini,
.presence-time-chip {
  display: inline-grid;
  min-width: 74px;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 12px;
  background: var(--primary-tint-1);
}

.presence-day-mini strong,
.presence-time-chip strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.presence-day-mini span,
.presence-time-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.presence-time-chip {
  min-width: 92px;
  background: rgba(var(--primary-rgb), .06);
  border-color: rgba(var(--primary-rgb), .18);
}

.presence-time-chip strong {
  color: var(--primary-strong);
  font-size: 16px;
}

.presence-stamps-table .row-actions {
  justify-content: flex-end;
  min-width: 0;
}

/* Timbrature (attivita' + aggregate): righe a riga singola e stessa altezza (~32px) delle
   altre SmartTable. Appiattisce i "chip" riquadrati di Giorno/Effettiva e porta la commessa
   (codice + titolo) su un'unica riga con ellissi. Scoped a .presence-stamps-table: la
   dashboard "Ultime timbrature" usa .recent-stamps-table e resta invariata. */
.presence-stamps-table .presence-day-mini,
.presence-stamps-table .presence-time-chip {
  display: inline;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.presence-stamps-table .presence-day-mini strong,
.presence-stamps-table .presence-time-chip strong {
  font-size: 13.5px;
}

.presence-stamps-table .presence-job-cell {
  display: flex;
  gap: 6px;
  align-items: baseline;
  max-width: 100%;
}

.presence-stamps-table .presence-person-cell strong,
.presence-stamps-table .presence-job-cell strong {
  display: inline;
  flex: 0 0 auto;
  font-size: 13.5px;
}

.presence-stamps-table .presence-job-cell span {
  display: inline;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recent-stamps-surface {
  overflow: hidden;
}

.recent-stamps-surface .surface-head {
  align-items: center;
  margin-bottom: 16px;
}

.recent-stamps-table {
  min-width: 940px;
  border-spacing: 0 7px;
}

.recent-stamps-table thead th {
  color: #334155;
}

.recent-stamps-table .table-filter-row th {
  padding-block: 8px 12px;
}

.recent-stamps-table .table-filter-row input {
  min-height: 38px;
  border-radius: 999px;
  background: #fff;
}

.recent-stamps-table tbody tr > td {
  padding-block: 12px;
}

.recent-stamps-table .presence-day-mini.compact {
  min-width: 104px;
  padding: 8px 11px;
  background: #fff;
}

.recent-stamps-table .reason-chip {
  border: 1px solid rgba(245, 158, 11, .16);
  background: #fff8e6;
  color: #a16207;
}

.recent-hours {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 30px;
  border-radius: 999px;
  background: var(--primary-tint-5);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
}

.compact-empty-state {
  min-height: 132px;
  margin-top: 12px;
}

.user-permissions-panel {
  margin-top: 16px;
}

.user-permissions-table td:first-child {
  min-width: 260px;
}

.user-permissions-table td:first-child strong,
.user-permissions-table td:first-child span {
  display: block;
}

.user-permissions-table .form-select {
  min-width: 190px;
}

.user-permissions-actions {
  justify-content: space-between;
  margin-top: 14px;
}

.table-row-selected {
  background: var(--primary-tint-4) !important;
  box-shadow: inset 4px 0 var(--primary);
}

.status-strip {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--text);
  font-weight: 800;
}

.status-strip.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.status-strip.success {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.status-strip.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.site-procedure-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.admin-presence-modal .editor-dialog .surface-head {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  border-bottom: 0;
  background: #224e73;
  color: #fff;
  text-align: center;
}

.admin-presence-modal .editor-dialog .surface-head h2,
.admin-presence-modal .editor-dialog .surface-head p,
.admin-presence-modal .editor-dialog .surface-head .eyebrow {
  color: #fff;
}

.admin-presence-modal .editor-dialog .surface-head p {
  opacity: .86;
}

.admin-presence-modal .editor-dialog {
  border-radius: 16px;
}

.presence-qr-modal .editor-body {
  display: grid;
  gap: 18px;
}

.presence-qr-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.presence-qr-search .form-control {
  min-height: 52px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 750;
}

.presence-qr-list {
  display: grid;
  gap: 14px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding-right: 4px;
}

.presence-qr-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(216, 230, 247, .95);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .07);
}

.presence-qr-card h3 {
  margin: 4px 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.presence-qr-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.presence-qr-preview {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  border: 1px dashed #bfd4ee;
  border-radius: 12px;
  background: var(--primary-tint-1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.presence-qr-actions {
  display: grid;
  gap: 8px;
}

.presence-row-hidden {
  display: none;
}

.report-missing-stamp-dialog {
  width: min(720px, 100%);
}

.report-missing-stamp-dialog .surface-head {
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-tint-1) 100%);
}

.report-missing-stamp-summary {
  display: grid;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 14px;
  background: var(--primary-tint-4);
}

.report-missing-stamp-summary span {
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-missing-stamp-summary strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
}

.report-missing-stamp-summary small {
  color: var(--muted);
  font-weight: 750;
}

.report-missing-stamp-modal .form-control[readonly] {
  background: transparent;
  color: var(--text);
  font-weight: 850;
}

.signature-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.signature-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.signature-toolbar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signature-box textarea {
  border: 0;
  border-radius: 0;
}

/* Aziende (Partner backoffice): lower row height, no alternating-row striping; hover stays as-is. */
.table-column-title-with-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.table-header-refresh .partner-icon-button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  font-size: 12px;
}

.table-header-refresh .partner-icon-button .button-icon-svg {
  width: 16px;
  height: 16px;
}

.smart-table-header-action-button .button-icon-svg {
  width: 15px;
  height: 15px;
}

.smart-table-header-actions .dxbl-btn.partner-icon-button,
.smart-table-header-actions .dxbl-btn.smart-table-header-action-button {
  flex: 0 0 24px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.smart-table-header-actions .partner-icon-button > span,
.smart-table-header-actions .smart-table-header-action-button > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  transform: none;
}

.smart-table-header-actions .partner-icon-button .button-icon-svg,
.smart-table-header-actions .smart-table-header-action-button .button-icon-svg {
  width: 16px;
  height: 16px;
}

.partner-smart-table-inline {
  display: block;
  min-width: 0;
  width: 100%;
}

.partner-smart-table-inline .standard-table-shell.smart-table-shell {
  gap: 0;
}

.partner-smart-table-inline .standard-table-top-content {
  margin: 0;
}

.partner-smart-table-inline .smart-table-sort-button {
  font-weight: inherit;
  letter-spacing: inherit;
  text-align: left;
  justify-content: flex-start;
}

.partner-companies-table th,
.partner-companies-table td {
  padding-top: 3px;
  padding-bottom: 3px;
  line-height: 1.2;
  text-align: left;
}

.partner-companies-table tbody tr:nth-child(even) {
  background: transparent;
}

.partner-companies-table .edit-cell {
  width: 84px;
}

.partner-companies-table .actions-col,
.partner-companies-table .actions-cell,
.partner-companies-table .edit-cell {
  min-width: 84px;
  padding-right: 4px;
  padding-left: 4px;
  width: 84px;
}

.compact-management-table.data-table.partner-companies-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1080px;
}

.compact-management-table.data-table.partner-companies-table .refresh-col {
  min-width: 84px;
  width: 84px;
}

.compact-management-table.data-table.partner-companies-table .company-name-col {
  width: 22%;
}

.compact-management-table.data-table.partner-companies-table .company-vat-col {
  width: 11%;
}

.compact-management-table.data-table.partner-companies-table .company-status-col {
  width: 9%;
}

.compact-management-table.data-table.partner-companies-table .company-demo-expiry-col {
  width: 11%;
}

.compact-management-table.data-table.partner-companies-table .company-city-col {
  width: 12%;
}

.compact-management-table.data-table.partner-companies-table .company-province-col {
  width: 7%;
}

.compact-management-table.data-table.partner-companies-table .company-type-col {
  width: 10%;
}

.compact-management-table.data-table.partner-companies-table .company-linked-col {
  width: 18%;
}

.partner-companies-table .linked-companies-cell {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-search {
  min-height: 26px;
  min-width: 260px;
  padding: 2px 6px;
}

.standard-table-shell.has-table-pager > .table-responsive {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.table-responsive {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: #fff;
  max-width: 100%;
}

.table-responsive + .table-pager {
  margin-top: -1px;
}

.table-pager-actions .blazor-action-text-button {
  min-height: 36px;
}

.table-pager-size-select:focus {
  border-color: #7aa7ff;
  box-shadow: 0 0 0 3px rgba(43, 103, 255, 0.12);
}

.table-pager-size-select:disabled {
  color: #15243b;
  background-color: #fff;
  opacity: 1;
}

.data-table tbody tr.report-row-ok > td,
.table tbody tr.report-row-ok > td {
  border-color: #d1fae5;
  background: #ecfdf5;
}

.data-table tbody tr.report-row-ok > td:first-child,
.table tbody tr.report-row-ok > td:first-child {
  box-shadow: inset 4px 0 rgba(5, 150, 105, .72);
}

.data-table tbody tr.report-row-ok:hover > td,
.table tbody tr.report-row-ok:hover > td {
  border-color: #bbf7d0;
  background: #dcfce7;
}

.data-table tbody tr.report-row-planned > td,
.table tbody tr.report-row-planned > td {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-4);
}

.data-table tbody tr.report-row-planned > td:first-child,
.table tbody tr.report-row-planned > td:first-child {
  box-shadow: inset 4px 0 var(--primary);
}

.data-table tbody tr.report-row-planned:hover > td,
.table tbody tr.report-row-planned:hover > td {
  border-color: var(--primary-tint-13);
  background: var(--primary-tint-9);
}

.data-table tbody tr.report-row-problem > td,
.table tbody tr.report-row-problem > td {
  border-color: #fecdd3;
  background: var(--danger-soft);
}

.data-table tbody tr.report-row-problem > td:first-child,
.table tbody tr.report-row-problem > td:first-child {
  box-shadow: inset 4px 0 var(--danger);
}

.data-table tbody tr.report-row-problem:hover > td,
.table tbody tr.report-row-problem:hover > td {
  border-color: #fda4af;
  background: #fff1f2;
}

.data-table tbody tr.report-row-missed > td,
.table tbody tr.report-row-missed > td {
  border-color: #fed7aa;
  background: var(--warning-soft);
}

.data-table tbody tr.report-row-missed > td:first-child,
.table tbody tr.report-row-missed > td:first-child {
  box-shadow: inset 4px 0 var(--warning);
}

.data-table tbody tr.report-row-missed:hover > td,
.table tbody tr.report-row-missed:hover > td {
  border-color: #fdba74;
  background: #fff7ed;
}

.table-responsive:has(> .data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table)) {
  border: 0;
  border-radius: 14px;
  background: transparent;
}

/* La tabella riempie sempre il contenitore (width:100%, coerente con lo standard
   del sito: niente spazio vuoto a destra della card). Con table-layout:fixed la
   colonna "libera" (nessuna larghezza dichiarata) assorbirebbe TUTTO lo spazio
   in eccesso senza limite (verificato dal vivo: 800px+ per un semplice titolo
   su schermi larghi). Percentuale invece di nessuna larghezza: la colonna
   libera ora dichiara una % (vedi le singole TableColumnDefinition, es. Titolo/
   Cliente), che sotto table-layout:fixed si risolve rispetto alla larghezza
   fissa della tabella (100% del contenitore) invece che rispetto allo spazio
   residuo: cresce in proporzione allo schermo ma resta sempre entro un limite
   prevedibile, non diventa mai sproporzionata. */
.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

/* Colonna "libera" (nessuna larghezza dichiarata): con table-layout:fixed assorbe
   lo spazio residuo su schermi larghi. NOTA: min-width sulla singola cella non
   ha alcun effetto in fixed layout (verificato dal vivo: il browser la ignora
   e la colonna puo' schiacciarsi a 0px se la somma delle colonne fisse supera
   gia' da sola la larghezza disponibile). L'unico meccanismo che il layout
   fixed rispetta e' un min-width sulla tabella stessa, impostato piu' sotto
   per-tabella (somma colonne fisse + margine per la colonna libera): la
   tabella si allarga e scrolla invece di azzerare la colonna, coerente con la
   regola sito-wide sui filtri/celle non compressi oltre leggibilita'. */
.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .flex-col {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Eccezione alla regola sopra: le colonne "Messaggio" del log Sync Esterno sono testo libero
   generato dall'exe (errori/conflitti), spesso piu' lungo di una riga - troncarlo con ellipsis
   lo rende illeggibile proprio dove serve leggerlo per intero. PartnerSmartTable eredita comunque
   le classi generiche sopra (compact-management-table/expense-note-table), quindi va riaperto
   qui il wrap per le tre tabelle di quest'area. */
.data-table:is(.syncesterno-log-rows, .syncesterno-log-detail-table, .syncesterno-conflitti-rows) .flex-col {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.settings-table.data-table.connected-apps-table { min-width: 760px; }
.compact-management-table.data-table.standard-users-table { min-width: 1320px; }
.compact-management-table.data-table.user-company-dependency-table { min-width: 660px; }
.compact-management-table.data-table.expense-type-group-table { min-width: 480px; }
.compact-management-table.data-table.expense-note-type-table { min-width: 900px; }
.compact-management-table.data-table.expense-mileage-rate-table { min-width: 400px; }
.compact-management-table.data-table.expense-type-limit-table { min-width: 500px; }
.compact-management-table.data-table.company-work-schedule-table { min-width: 500px; }
.compact-management-table.data-table.user-work-schedule-table { min-width: 620px; }
.compact-management-table.data-table.selected-user-work-schedule-table { min-width: 440px; }
.compact-management-table.data-table.roles-permissions-table { min-width: 640px; }
.compact-management-table.data-table.commesse-rows-table { min-width: 900px; }
/* +130px rispetto al 1300px originale: compensa l'allargamento della colonna
   "Data" (110px -> 240px, vedi SmartTable.razor ApplyRangeFilterMinWidth) in
   modo che le colonne a testo libero (Descrizione/Tipo/Cliente/Commessa)
   mantengano la stessa quota di spazio residuo di prima invece di restringersi. */
.compact-management-table.data-table.expense-rows-icon-only-table { min-width: 1430px; }
/* .absences-table ha gia' un min-width dedicato e responsive (site.css, @media
   max-width:900px, min-width:1280px + wrapper overflow-x:auto): non duplicarlo
   qui per non interferire con quella soglia gia' verificata. */

.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) thead th {
  padding: 6px 8px;
  border-bottom: 0;
  background: var(--nh-table-head-bg, #f8fafc);
  color: var(--nh-table-head-color, #334155);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}

.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .table-filter-row th {
  padding: 2px 6px 3px;
  background: #f8fafc;
}

.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .table-filter-row input,
.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .table-filter-row select,
.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .table-filter-row .dxbl-text-edit,
.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .table-search {
  height: 28px;
  min-height: 28px;
  min-width: 0;
  padding: 1px 6px;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td {
  padding: var(--nh-table-cell-padding-y, 4px) var(--nh-table-cell-padding-x, 6px);
  border-top: 1px solid #e8eef7;
  border-bottom: 1px solid #e8eef7;
  background: #fff;
  font-size: 12.5px;
  line-height: 1.22;
  text-align: left;
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td,
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td {
  font-size: 13.5px;
  height: 30px;
  line-height: 1.22;
  padding: var(--nh-table-cell-padding-y, 3px) var(--nh-table-cell-padding-x, 6px);
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) thead th,
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) thead th {
  font-size: 12px;
  padding-inline: 6px;
  text-align: left;
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr,
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr {
  height: 31px;
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-header-filters th,
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-header-filters th {
  min-height: 31px;
  padding: 3px 6px;
  overflow: visible;
  overflow-x: clip; /* vedi .smart-table-header-filters th: niente scroll da filtri in colonne strette */
  text-align: left;
  vertical-align: middle;
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-header-filters :where(.smart-table-filter-control, input, select, .dxbl-text-edit),
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-header-filters :where(.smart-table-filter-control, input, select, .dxbl-text-edit) {
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  min-height: 28px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-header-filters .smart-table-range-filter,
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-header-filters .smart-table-range-filter {
  gap: 4px;
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-sort-button,
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .smart-table-sort-button {
  justify-content: flex-start;
  padding: 0;
  text-align: left;
}

/* Standard sito: una cella di tabella che contiene solo un badge (anche dentro uno span di tooltip) e' sempre centrata, qualunque sia il Kind della colonna. */
.data-table td:has(> :is(.status-pill, .chip):only-child),
.data-table td:has(> span:only-child > :is(.status-pill, .chip):only-child) {
  text-align: center;
}

body.partner-portal .partner-companies-table th,
body.partner-portal .partner-companies-table td {
  padding-top: 3px;
  padding-bottom: 3px;
}

body.partner-portal .compact-management-table.data-table tbody tr > td .muted-cell.d-block,
body.standard-portal .compact-management-table.data-table tbody tr > td .muted-cell.d-block {
  display: inline !important;
  margin-left: 6px;
  white-space: nowrap;
}

body.partner-portal .surface-head > .surface-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .table-filter-row .dxbl-text-edit input {
  min-height: 0;
  height: 22px;
  padding-block: 0;
  font-size: 12px;
  line-height: 1.2;
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) :where(.chip, .status-pill) {
  border-radius: 6px;
  min-height: 22px;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1;
}

/* Il badge stato della tabella Assenze usa .absence-status, non .chip/.status-pill:
   la base (min-height:26px, pensata per la vecchia riga non compatta) trascinava
   ancora la riga sopra il target 30-31px anche dopo aver compattato il bottone azione. */
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .absence-status {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .partner-icon-button {
  flex-basis: 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  min-width: 24px;
  margin-left: 0;
  font-size: 13px;
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .partner-action-button {
  min-height: 28px;
  padding-inline: 8px;
  border-radius: 8px;
  font-size: 12px;
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .row-actions {
  gap: 4px;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}

/* Colonna azioni sempre allineata a destra, indipendentemente da come e' reso il
   contenuto: cluster .row-actions (flex justify-end) OPPURE singola icona "grezza"
   (.row-edit-link/.row-edit-trigger) messa direttamente nella cella. Su un elemento
   inline il margin-left:auto si risolve a 0 e non allinea nulla, quindi la cella
   deve avere text-align:right: senza questa regola le tabelle con l'icona grezza
   (es. Utenti) mostravano la matita a sinistra mentre quelle con .row-actions a destra. */
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) :is(td.actions-col, td.actions-cell, td.edit-cell) {
  text-align: right;
}

.compact-management-table.data-table.expense-rows-table .actions-col,
.compact-management-table.data-table.expense-rows-table .actions-cell {
  /* Con table-layout:fixed questa e' la larghezza vincolante della colonna, non un
     suggerimento. !important necessario: SmartTable.razor scrive uno
     style="width:..." inline sull'elemento (da TableColumnDefinition.DefaultWidth
     o, se assente, da Kind), e lo style inline vince sempre su qualunque regola
     CSS esterna a parita' o minor peso.
     expense-note-table, absences-table e settings-table non sono piu' in questo
     elenco: le loro colonne azioni usano ora Kind (ActionsIconOnly/
     ActionsIconPlusButton in TableColumnDefinition), che scrive la larghezza
     corretta direttamente inline senza bisogno di override. Resta
     expense-rows-table perche' non ancora migrata a Kind. */
  text-align: right;
  width: 220px !important;
}

/* Tabella "Righe nota" (dettaglio di un singolo rendiconto): Tipo/Cliente/
   Commessa hanno ora larghezze fisse in base al contenuto (badge/nome corti),
   solo Descrizione resta a testo libero e assorbe lo spazio residuo. Somma
   colonne fisse (azioni 70 + data 240 + tipo 120 + cliente 150 + commessa 180
   + carta 80 + fattura 80 + valore 95 + allegati 92 = 1107) + ~220px per
   Descrizione. */
.compact-management-table.data-table.expense-detail-rows-table { min-width: 1330px; }

/* Tabella struttura Manuale/Guida: la colonna azioni usa Kind (ActionsIconOnly)
   in TableColumnDefinition, che scrive la larghezza corretta direttamente inline
   (vedi commento su expense-rows-table sopra) — qui serve solo l'allineamento,
   non piu' un override di larghezza: un vecchio !important fisso a 56px vinceva
   anche sullo style inline e faceva traboccare la toolbar Aggiorna/Esporta/
   Impostazioni nella colonna successiva quando questa colonna ospitava anche
   quella (bottone presente ma non piu' raggiungibile con un click reale). */
.compact-management-table.data-table.manual-structure-table .actions-col,
.compact-management-table.data-table.manual-structure-table .actions-cell {
  text-align: right;
}

.compact-management-table.data-table.manual-structure-table { min-width: 600px; }

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .partner-icon-button.row-edit-trigger {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--primary);
  flex-basis: 24px;
  height: 24px;
  min-height: 24px;
  min-width: 24px;
  width: 24px;
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .partner-icon-button.row-edit-trigger:hover,
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .partner-icon-button.row-edit-trigger:focus-visible {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--primary-strong);
}

/* Il bottone azione condiviso da tutte le SmartTable (Note spese, Commesse, Assenze,
   Impostazioni) usa .expense-icon-button, non .partner-icon-button: senza questo
   override restava a 34px (dimensione base non compatta) e trascinava l'intera riga
   a quell'altezza anche quando testo/padding richiedevano solo ~30px. */
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .expense-icon-button {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .expense-icon-button.row-edit-trigger {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--primary);
}

.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .expense-icon-button.row-edit-trigger:hover,
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .expense-icon-button.row-edit-trigger:focus-visible {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--primary-strong);
}

/* Come sopra per .expense-icon-button: il bottone "Allegati" nelle celle Note spese
   eredita solo le dimensioni base di .btn-sm (~26px), leggermente piu' alto del
   target compatto (~24px), e trascinava la riga a 34px invece di 30-31px. */
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .expense-attachment-summary-button {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 12px;
}

/* Gli "slot" della colonna azioni sulla tabella testata note spese/rendiconti
   (.expense-header-actions, usata quando la riga puo' avere sia un'azione
   principale sia l'icona di modifica) hanno min-height:28px pensato per la
   vecchia altezza riga non compatta: senza questo override restava sopra il
   target 24px del bottone icona e trascinava comunque la riga a ~35px. */
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .expense-action-main-slot,
.compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .expense-action-icon-slot {
  min-height: 24px;
}

.compact-management-table.data-table.partner-companies-table .actions-col,
.compact-management-table.data-table.partner-companies-table .actions-cell,
.compact-management-table.data-table.partner-companies-table .edit-cell {
  min-width: 84px;
  padding-right: 2px;
  padding-left: 2px;
  text-align: right;
  width: 84px;
}

body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td.actions-col :where(.row-edit-link, .row-edit-trigger),
body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td.actions-cell :where(.row-edit-link, .row-edit-trigger),
body.partner-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td.edit-cell :where(.row-edit-link, .row-edit-trigger),
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td.actions-col :where(.row-edit-link, .row-edit-trigger),
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td.actions-cell :where(.row-edit-link, .row-edit-trigger),
body.standard-portal .compact-management-table.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td.edit-cell :where(.row-edit-link, .row-edit-trigger) {
  margin-left: auto;
  margin-right: 0;
}

body.partner-portal .partner-company-form :where(.form-control, .form-select):not(:disabled),
body.partner-portal .partner-blazor-modal .admin-form :where(.form-control, .form-select):not(:disabled),
body.partner-portal .settings-detail-panel .admin-form :where(.form-control, .form-select):not(:disabled),
.standard-company-detail .partner-company-form :where(.form-control, .form-select):not(:disabled),
.standard-user-profile-detail .partner-company-form :where(.form-control, .form-select):not(:disabled) {
  font-weight: 500;
}

.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) tbody tr > td :where(strong, .partner-company-name-button) {
  font-weight: 650;
}

.data-table.partner-companies-table tbody tr:nth-child(even),
.table.partner-companies-table tbody tr:nth-child(even) {
  background: transparent;
}

.data-table.partner-companies-table tbody tr:nth-child(even) > td,
.table.partner-companies-table tbody tr:nth-child(even) > td {
  background: #fff;
}

.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) td > strong + .status-pill,
.data-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) td > strong + .chip {
  margin-left: 10px;
  vertical-align: middle;
}

.devexpress-grid-host {
  width: 100%;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) {
  border: 0;
  border-radius: 14px;
  background: transparent;
  overflow-x: auto;
}

.devexpress-grid-host .dx-datagrid {
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  font-family: inherit;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-datagrid {
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.devexpress-grid-host .dx-datagrid-headers {
  background: #f8fafc;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-datagrid-headers {
  border: 1px solid #e8eef7;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #f8fafc;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-header-row > td {
  padding: 10px 12px;
  border-color: #e8eef7;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-datagrid-filter-row > td {
  padding: 8px 10px 12px;
  border-color: #e8eef7;
  background: #f8fafc;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-datagrid-filter-row .dx-texteditor,
.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-datagrid-search-panel {
  min-height: 38px;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.devexpress-grid-host .dx-toolbar {
  padding: 8px;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-toolbar {
  padding: 0 0 10px;
  border: 0;
  background: transparent;
}

.devexpress-grid-host .dx-datagrid-search-panel {
  min-width: 220px;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-datagrid-rowsview {
  border: 0;
  background: transparent;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-datagrid-rowsview .dx-datagrid-table {
  border-collapse: separate;
  border-spacing: 0 8px;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-data-row > td {
  padding: 13px 12px;
  border-top: 1px solid #e8eef7;
  border-bottom: 1px solid #e8eef7;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  vertical-align: middle;
}

.devexpress-grid-host.compact-management-table:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-data-row > td {
  padding: 9px 10px;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-data-row.dx-row-alt > td {
  background: #f8fbff;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-data-row > td:first-child {
  border-left: 1px solid #e8eef7;
  border-radius: 14px 0 0 14px;
  box-shadow: inset 3px 0 #dbe3ee;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-data-row > td:last-child {
  border-right: 1px solid #e8eef7;
  border-radius: 0 14px 14px 0;
}

.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-data-row.dx-state-hover > td,
.devexpress-grid-host:is(.expense-note-table, .expense-rows-table, .commesse-rows-table, .settings-table, .absences-table, .compact-management-table) .dx-data-row:hover > td {
  border-color: #dbeafe;
  background: #f1f6ff;
}

/* Corpo commessa DevExpress (CommessaBodyEditor + harness di test): condiviso tra i due, non duplicare */
.commesse-devexpress-table-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.commesse-devexpress-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.65fr) minmax(220px, 1fr);
  gap: 12px;
  padding: 6px 8px;
  background: var(--primary-tint-1);
  border-bottom: 1px solid #cbd5e1;
}

.commesse-devexpress-tree .dxbl-grid-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.commesse-devexpress-tree .dxbl-grid-table > thead th,
.commesse-devexpress-tree .dxbl-grid-table > thead td,
.commesse-devexpress-tree .dxbl-grid-header {
  border-bottom-color: var(--border) !important;
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
  padding: 12px 14px;
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr {
  min-height: 44px;
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr > td {
  border-color: #eef2f7 !important;
  background: #fff !important;
  color: #1f2937;
  font-size: 13px;
  padding: 10px 14px;
  vertical-align: middle;
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr:nth-child(even) > td {
  background: var(--primary-tint-1) !important;
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr:hover > td {
  background: var(--primary-tint-3) !important;
  border-color: var(--primary-tint-9) !important;
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr:has(.row-title-main.selected) > td {
  background: var(--primary-soft) !important;
  border-color: var(--primary-tint-10) !important;
  color: var(--primary-strong);
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr:has(.tree-row-title.group) {
  font-weight: 800;
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr:has(.tree-row-title.standard) {
  font-weight: 600;
}

.commesse-devexpress-tree .dxbl-grid-table > tbody > tr > td:first-child {
  position: relative;
  border-left-color: transparent !important;
  box-shadow: none !important;
}

.tree-row-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding-left: 12px;
  color: inherit;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

/* Marker verticale che segue l'indentazione DevExpress: mostra la profondita' del nodo */
.tree-row-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 18px;
  width: 2px;
  border-radius: 999px;
  background: #cbd5e1;
  opacity: .8;
}

.tree-row-title.group::before {
  width: 3px;
  background: #ef4444;
  opacity: 1;
}

.row-title-main {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-title-main:hover,
.row-title-main:focus-visible {
  color: var(--primary-strong);
  text-decoration: none;
}

.row-title-main.selected {
  text-decoration: none;
}

.cell-muted {
  color: #8b99ad;
}

.commesse-devexpress-totals {
  display: grid;
  grid-template-columns: 300px 140px 260px 90px 80px 130px 130px 120px 130px 160px 100px 104px;
  align-items: center;
  gap: 0;
  border-top: 2px solid #cbd5e1;
  background: #f8fafc;
  overflow: hidden;
}

.commesse-devexpress-totals > * {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}

.commesse-devexpress-totals > *:first-child {
  justify-content: flex-end;
  text-transform: uppercase;
}

/* Placeholder "nessun totale applicabile" (es. costo/prezzo unitario): deve restare distinguibile
   da un totale vero anche senza passare il mouse sul tooltip. */
.commesse-totals-not-applicable {
  font-weight: 400;
  color: var(--text-muted, #6b7280);
}

.commesse-devexpress-inline-message {
  border: 1px solid #cbd9f2;
  border-radius: 12px;
  color: #24476f;
  padding: 10px 12px;
  font-weight: 700;
}

.commesse-devexpress-inline-message.error {
  border-color: #f3b6b6;
  color: #a32222;
  background: #fff7f7;
}

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  border: 1px solid rgba(37, 99, 235, 0.16);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-pill {
  border-radius: 6px;
}

/* In tutti i badge colorati il pallino sta a destra del testo (::before resta primo nel DOM). */
.status-pill:is(.success, .warning, .info, .danger),
.chip:is(.success, .warning, .info, .danger) {
  flex-direction: row-reverse;
}

.status-pill.success::before,
.status-pill.warning::before,
.status-pill.info::before,
.status-pill.danger::before,
.chip.success::before,
.chip.warning::before,
.chip.info::before,
.chip.danger::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.status-pill.success,
.chip.success {
  background: #f0fdf4;
  color: #047857;
  border-color: rgba(4, 120, 87, 0.18);
}

.status-pill.warning,
.chip.warning {
  background: #fffbeb;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.18);
}

.status-pill.info,
.chip.info {
  background: #eff6ff;
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.16);
}

.status-pill.danger,
.chip.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.18);
}

.status-pill.neutral,
.chip.neutral {
  background: #f1f5f9;
  color: #475569;
  border-color: rgba(71, 85, 105, 0.18);
}

/* Chip di suggerimento cliccabili sotto i campi "nome colonna" della Sincronizzazione esterna
   (SyncEsternoConfigurazioneDetail.razor): stesso ".chip" usato per i badge stato, reso cliccabile. */
.syncesterno-field-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.syncesterno-field-suggestions .chip {
  cursor: pointer;
  border: 1px dashed rgba(71, 85, 105, 0.35);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.syncesterno-field-suggestions .chip:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: rgba(71, 85, 105, 0.5);
}

.syncesterno-field-suggestions .chip:disabled {
  cursor: default;
  opacity: 0.5;
}

.syncesterno-defaults-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.syncesterno-defaults-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.syncesterno-summary-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.syncesterno-summary-list li {
  font-size: 13px;
  color: var(--text);
}

.syncesterno-summary-warning {
  color: var(--danger);
  font-weight: 600;
}

.muted-cell {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.report-stamp-list {
  display: block;
  max-width: 520px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
}

.report-stamp-cell-missed .report-stamp-list,
.report-stamp-cell-missed strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .18);
  color: #92400e;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .10), 0 8px 18px rgba(245, 158, 11, .12);
}

.report-stamp-cell-problem .report-stamp-list,
.report-stamp-cell-problem strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(220, 38, 38, .16);
  color: #991b1b;
  box-shadow: 0 0 0 5px rgba(220, 38, 38, .10), 0 8px 18px rgba(220, 38, 38, .12);
}

/* Legenda dei colori delle timbrature: usa le stesse classi delle celle in tabella, cosi' i colori coincidono sempre. */
.report-stamp-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 10px 0 14px;
}

.report-stamp-fix-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

/* Totale della giornata: apre il modale sulla sezione Ore (stesso aspetto del valore, solo cliccabile). */
#reports-table .report-total-edit-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.report-stamp-real-type {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

/* Pannello "Timbrature del giorno": lista ordinata con zone di rilascio tra le righe. */
.editor-dialog.report-day-editor-dialog {
  width: min(760px, 100%);
}

.report-day-editor-tabs {
  margin: 16px 0 0;
}

/* Altezza minima: il modale non cambia misura a scatti passando da una tab all'altra. */
.report-day-editor-body {
  min-height: 360px;
}

.report-day-editor-section {
  margin-top: 16px;
}

.report-day-editor-list {
  display: grid;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.report-day-editor-empty {
  margin: 16px 0 0;
  color: var(--muted);
}

.report-day-editor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.report-day-editor-row.is-draggable {
  cursor: grab;
}

.report-day-editor-row.is-dragging {
  opacity: .45;
}

.report-day-editor-row.is-editing {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.report-day-editor-grip {
  flex: 0 0 10px;
  height: 18px;
  color: var(--muted);
  background: radial-gradient(circle, currentColor 1.2px, transparent 1.6px) 0 0 / 5px 6px;
}

.report-day-editor-time {
  min-width: 48px;
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.report-day-editor-reason {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-day-editor-row .status-pill {
  flex: 0 0 auto;
}

.report-day-editor-list {
  gap: 6px;
}

.report-day-editor-row.is-draggable:active .report-day-editor-grip {
  cursor: grabbing;
}

/* Linea di inserimento sulla riga bersaglio (box-shadow: nessuno scatto di layout). */
.report-day-editor-row.is-drop-before {
  box-shadow: 0 -3px 0 0 var(--primary);
}

.report-day-editor-row.is-drop-after {
  box-shadow: 0 3px 0 0 var(--primary);
}

/* Durante il drag i figli non intercettano gli eventi: dragenter/drop arrivano sempre alla riga. */
.report-day-editor-list.is-dragging-any .report-day-editor-row > * {
  pointer-events: none;
}

/* Area fissa in fondo alla lista: rilascio dopo l'ultima timbratura. */
.report-day-editor-tail {
  min-height: 28px;
  border: 1px dashed transparent;
  border-radius: var(--radius);
}

.report-day-editor-tail.is-target {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.report-day-editor-tail.is-over {
  border-color: var(--primary);
  background: var(--primary);
}

.report-day-editor-add {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.report-day-editor-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.report-day-editor-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 12px;
  color: var(--muted);
}

.report-day-editor-nextday {
  font-weight: 800;
}

.report-day-editor-preview strong {
  color: var(--text);
}

.report-day-editor-preview.is-warning {
  padding: 8px 12px;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--text);
}

.report-missing-stamp-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 26px;
  border: 1px solid rgba(220, 38, 38, .32);
  border-radius: 999px;
  background: #fff;
  color: var(--danger);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  padding: 0 8px;
  text-decoration: none;
  box-shadow: 0 0 0 5px rgba(220, 38, 38, .10), 0 8px 18px rgba(220, 38, 38, .14);
  animation: reportMissingPulse 1.5s ease-in-out infinite;
}

.report-missing-stamp-action:hover,
.report-missing-stamp-action:focus {
  background: var(--danger);
  color: #fff;
  text-decoration: none;
}

@keyframes reportMissingPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(220, 38, 38, .10), 0 8px 18px rgba(220, 38, 38, .14);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(220, 38, 38, .08), 0 10px 22px rgba(220, 38, 38, .18);
  }
}

.report-stamp-cell-ok .report-stamp-list,
.report-stamp-cell-ok strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(5, 150, 105, .12);
  color: #065f46;
  box-shadow: 0 0 0 5px rgba(5, 150, 105, .08), 0 8px 18px rgba(5, 150, 105, .10);
}

.report-hours-under-expected {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 24px;
  min-width: 42px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, .18);
  color: #92400e;
  font-weight: 900;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .10), 0 8px 18px rgba(245, 158, 11, .12);
}

.report-inline-cell {
  min-width: 96px;
  width: 96px;
}

/* Larghezze esplicite per colonna (table-layout fixed): la somma coincide con il min-width.
   60 matita + 2x84 giorno + 150 nominativo + 4x116 timbrature + 3x76 ore + 5x80 numeri
   + 3x88 larghe + 2x104 causali + 120 stato = 2062px con tutte le colonne visibili (con colonne nascoste la pagina
   toglie il min-width e restano le larghezze delle colonne presenti). Celle di sola lettura: nessun input inline da contenere. */
#reports-table {
  table-layout: fixed;
  min-width: 2062px;
}

#reports-table th.report-col-edit { width: 60px; min-width: 60px; }
#reports-table td.report-edit-cell { text-align: center; }
/* La matita della giornata resta sempre visibile (di default le matite di riga compaiono solo in hover). */
#reports-table td.report-edit-cell .row-edit-trigger {
  opacity: 1;
  transform: none;
}

#reports-table th.report-col-day { width: 84px; min-width: 84px; }
#reports-table th.report-col-hours { width: 76px; min-width: 76px; }
#reports-table th.report-col-num { width: 80px; min-width: 80px; }
#reports-table th.report-col-wide { width: 88px; min-width: 88px; }

/* Colonne timbrature: larghezza fissa che contiene orario + tipo reale + icona allegato senza tagliarli. */
#reports-table .report-stamp-header {
  width: 116px;
  min-width: 116px;
}

#reports-table .report-stamp-with-attachments {
  flex-wrap: nowrap;
  white-space: nowrap;
}

#reports-table th,
#reports-table td {
  overflow: hidden;
  text-overflow: clip;
}

#reports-table thead th {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.16;
  vertical-align: bottom;
}

#reports-table .report-inline-cell {
  width: 126px;
  min-width: 126px;
  max-width: 126px;
}

#reports-table .report-definitive-edit-cell {
  width: 134px;
  min-width: 134px;
  max-width: 134px;
}

/* La colonna Definitivo e' larga 88px: l'input si adatta alla cella invece dei 76px fissi (padding cella 8px per lato). */
#reports-table .report-definitive-edit-cell .form-control {
  width: 100%;
  min-width: 0;
  max-width: none;
}

#reports-table .report-other-absence-cell {
  width: 166px;
  min-width: 166px;
  max-width: 166px;
  /* Come .report-schedule-action-cell: valore + pulsante "+ Pianifica" insieme possono superare i
     166px fissi della colonna, e #reports-table td ha overflow:hidden di default (table-layout:
     fixed) che altrimenti taglierebbe il pulsante a meta'. */
  overflow: visible;
  text-overflow: clip;
}

/* Causale 1 / Causale 2: ore sopra e nome in un badge piccolo sotto (ellipsis, tooltip col nome completo). */
#reports-table .report-cause-header,
#reports-table .report-cause-cell {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
}

#reports-table .report-cause-cell {
  white-space: nowrap;
}

#reports-table .report-cause-cell > span {
  display: block;
}

#reports-table .report-cause-hours {
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

#reports-table .report-cause-name {
  display: block;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  margin-top: 3px;
  padding: 2px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.2;
}

#reports-table .report-schedule-action-cell {
  width: 178px;
  min-width: 178px;
  max-width: 178px;
  overflow: visible;
  text-overflow: clip;
}

#reports-table .report-actions-header {
  width: 178px;
  min-width: 178px;
  max-width: 178px;
}

#reports-table .report-status-header,
#reports-table .report-status-cell {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  overflow: visible;
  text-overflow: clip;
}

#reports-table .report-status-header .form-control {
  min-width: 126px;
  width: 100%;
}

#reports-table .report-schedule-action-cell .btn,
#reports-table .report-status-cell .status-pill {
  white-space: nowrap;
}

.report-inline-cell .form-control,
.report-inline-cell .form-select,
.report-inline-edit-form .report-inline-schedule,
.report-inline-edit-form .report-inline-cancel {
  display: none;
}

.report-inline-cell .form-control,
.report-inline-cell .form-select,
.report-inline-edit-form .report-inline-schedule {
  min-height: 32px;
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.report-inline-edit-form .report-inline-schedule {
  min-width: 150px;
  text-align: left;
}

/* Colonna Orario (dashboard timbrature): stesso peso dei valori straordinario (.report-inline-value). */
#reports-table th.report-col-strong,
#reports-table td.report-col-strong {
  font-weight: 850;
}

.report-inline-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 32px;
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 850;
  box-sizing: border-box;
}

/* Definitivo diverso da quanto richiesto dall'utente (solo dashboard timbrature): stesso rosso con alone delle
   timbrature in problema (.report-stamp-cell-problem). Il segnale non e' solo cromatico: forma a pillola, alone,
   title e testo .visually-hidden con il valore richiesto. */
#reports-table td span.report-definitive-diff {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  min-width: 42px;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 8px;
  border-color: transparent;
  border-radius: 999px;
  background: rgba(220, 38, 38, .16);
  color: #991b1b;
  font-weight: 900;
  box-shadow: 0 0 0 5px rgba(220, 38, 38, .10), 0 8px 18px rgba(220, 38, 38, .12);
}

#reports-table .report-cause-cell > span.report-definitive-diff {
  display: inline-flex;
  margin-bottom: 2px;
}

/* Colonne straordinario modificabili in tabella (toggle "Sblocca colonne"): input a larghezza di colonna come il Definitivo. */
[data-report-inline-table].is-overtime-column-editing .report-overtime-edit-cell .form-control {
  display: inline-flex;
}

#reports-table .report-overtime-edit-cell .form-control {
  width: 100%;
  min-width: 0;
  max-width: none;
}

/* Cella modificabile con il valore appena rifiutato: bordo rosso (il messaggio sta nel title e nella striscia in cima). */
#reports-table .report-inline-cell .form-control[aria-invalid="true"] {
  border-color: #dc2626;
}

/* Sotto le colonne straordinario: sblocco campi e spostamento massivo, uno sopra l'altro. */
.report-overtime-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* Con una sola colonna straordinario la cella e' stretta: il combo non deve mantenere la larghezza intrinseca del campo. */
.report-overtime-controls > *,
.report-overtime-controls .blazor-combo-box.dxbl-text-edit,
.report-overtime-controls .blazor-combo-box .dxbl-text-edit-input {
  min-width: 0;
  max-width: 100%;
}

.report-schedule-action-cell {
  min-width: 310px;
}

.report-inline-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  max-width: 96px;
  height: 25px;
  border: 1px solid rgba(245, 158, 11, .34);
  border-radius: 999px;
  background: #fff7ed;
  color: #b45309;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  padding: 0 8px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, .10), 0 8px 18px rgba(245, 158, 11, .12);
  animation: reportInlineAddPulse 1.7s ease-in-out infinite;
}

.report-other-absence-cell {
  white-space: nowrap;
}

.report-other-absence-cell .report-inline-add {
  margin-left: 6px;
}

.report-column-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: var(--primary-tint-4);
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.report-column-toggle:hover,
.report-column-toggle:focus {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.table-filter-row [data-report-group-toggle] {
  width: 100%;
  min-width: 160px;
}

#reports-table .table-filter-row th {
  vertical-align: middle;
}

.report-inline-add:hover,
.report-inline-add:focus {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #fff;
}

@keyframes reportInlineAddPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(245, 158, 11, .10), 0 8px 18px rgba(245, 158, 11, .12);
  }

  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 8px rgba(245, 158, 11, .08), 0 10px 22px rgba(245, 158, 11, .16);
  }
}

.report-inline-edit-form {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 300px;
}

.report-inline-edit-form .btn {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

tr.is-inline-editing .report-inline-cell .form-control,
tr.is-inline-editing .report-inline-cell .form-select,
tr.is-inline-editing .report-inline-edit-form .report-inline-schedule,
tr.is-inline-editing .report-inline-edit-form .report-inline-cancel,
tr.is-schedule-editing .report-inline-edit-form .report-inline-schedule,
tr.is-schedule-editing .report-inline-edit-form .report-inline-cancel {
  display: inline-flex;
}

tr.is-inline-editing .report-inline-cell .report-inline-value,
tr.is-inline-editing .report-inline-cell .report-inline-add,
tr.is-inline-editing .report-inline-edit-form .report-inline-edit-button,
tr.is-schedule-editing .report-inline-edit-form .report-inline-edit-button {
  display: none;
}

tr.is-inline-editing > td,
tr.is-schedule-editing > td {
  background: var(--primary-tint-1) !important;
  box-shadow: inset 0 -1px var(--primary-tint-10);
}

[data-report-inline-table].is-definitive-column-editing .report-definitive-edit-cell .form-control {
  display: inline-flex;
}

[data-report-inline-table].is-definitive-column-editing .report-definitive-edit-cell .report-inline-value {
  display: none;
}

[data-report-inline-table].is-absence-group-editing .report-absence-edit-cell .form-control,
[data-report-inline-table].is-overtime-group-editing .report-overtime-edit-cell .form-control {
  display: inline-flex;
}

[data-report-inline-table].is-absence-group-editing .report-absence-edit-cell .report-inline-value,
[data-report-inline-table].is-overtime-group-editing .report-overtime-edit-cell .report-inline-value {
  display: none;
}

.report-empty-cell {
  min-width: 72px;
  background: rgba(246, 248, 251, 0.55);
}

.compact-actions {
  margin-top: 10px;
}

.actions-col {
  width: 1%;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* Slot a larghezza fissa per le azioni di riga condizionali: lo spazio resta riservato
   anche quando il pulsante non c'e', cosi' le icone restano incolonnate tra le righe. */
.row-action-slot {
  align-items: center;
  display: inline-flex;
  flex: 0 0 24px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

/* Azione visibile solo al passaggio del mouse sulla riga (opacity, non display:none, per
   non togliere lo slot dal layout). Senza hover (touch) e con il focus resta visibile. */
.row-action-hover {
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.data-table tbody tr:hover .row-action-hover,
.data-table tbody tr:focus-within .row-action-hover,
.row-action-hover:focus-within {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .row-action-hover {
    opacity: 1;
    pointer-events: auto;
  }
}

.inline-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.user-schedule-cell {
  min-width: 330px;
  max-width: 430px;
}

.user-schedule-current {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 8px;
}

.user-schedule-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.user-schedule-plan {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--primary-tint-1);
}

.user-schedule-plan summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
}

.user-schedule-plan ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.user-schedule-plan li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff;
  color: var(--text-main);
  font-size: 12px;
}

.user-schedule-plan li span {
  color: var(--text-muted);
  font-weight: 700;
}

.user-schedule-change-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 132px auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.user-schedule-change-form label {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.user-schedule-change-form .form-select,
.user-schedule-change-form .form-control {
  min-height: 34px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .user-schedule-cell {
    min-width: 280px;
  }

  .user-schedule-change-form {
    grid-template-columns: 1fr;
  }
}

.hours-input {
  width: 78px;
}

/* Aspetto unico di checkbox/interruttori (BlazorCheckboxField): interruttore a sinistra, etichetta a destra,
   allineati a sinistra nella cella e sulla riga dei campi vicini, etichetta normale (non in grassetto). */
.check-row,
.check-line,
.switch-line {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 38px;
}

.permission-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-grid.admin-grid-stack {
  grid-template-columns: minmax(0, 1fr);
}

.admin-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  margin-bottom: 14px;
}

.partner-inline-editor {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
}

.partner-inline-editor > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  list-style: none;
}

.partner-inline-editor > summary::-webkit-details-marker {
  display: none;
}

.partner-inline-editor > summary::after {
  content: "Apri";
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 999px;
  background: var(--primary-tint-4);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.partner-inline-editor[open] > summary {
  border-bottom: 1px solid var(--border);
}

.partner-inline-editor[open] > summary::after {
  content: "Chiudi";
  background: #fff;
  color: var(--muted);
}

.partner-inline-editor > form {
  margin: 0;
  padding: 14px;
}

.partner-inline-editor > form.form-grid {
  align-items: end;
}

.dashboard-filter-toolbar .form-grid {
  grid-template-columns: 150px 190px minmax(220px, 320px) auto;
  align-items: end;
}

.blazor-dashboard-shell {
  overflow: hidden;
  padding: 20px;
}

.blazor-dashboard-head {
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.blazor-dashboard-head p {
  max-width: 680px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.blazor-dashboard-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 260px;
}

.blazor-dashboard-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #dbe7f7;
  border-radius: 999px;
  background: #fff;
  color: #52627a;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.ok {
  background: #059669;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, .12);
}

.legend-dot.warning {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .14);
}

.legend-dot.danger {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
}

.blazor-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.blazor-dashboard-metrics .metric.compact {
  position: relative;
  min-height: 86px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid #dde8f5;
  background: linear-gradient(180deg, #fff 0%, var(--primary-tint-1) 100%);
  box-shadow: none;
}

.blazor-dashboard-metrics .metric.compact::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 13px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  opacity: .14;
}

.blazor-dashboard-metrics .metric.primary::after {
  background: var(--primary);
}

.blazor-dashboard-metrics .metric.success::after {
  background: #059669;
}

.blazor-dashboard-metrics .metric.muted::after {
  background: #64748b;
}

.blazor-dashboard-metrics .metric.danger::after {
  background: #dc2626;
}

.blazor-dashboard-metrics .metric.compact strong {
  font-size: 24px;
}

.blazor-grid-wrap {
  overflow-x: auto;
  border: 1px solid #dbe7f7;
  border-radius: 16px;
  background: #fff;
}

.nethub-blazor-grid {
  overflow: hidden;
  min-width: 1480px;
  border: 0;
  border-radius: 16px;
  background: #fff;
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr:nth-child(even) > td {
  background: var(--primary-tint-1);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr:hover > td {
  background: var(--primary-tint-5);
}

.nethub-blazor-grid .dxbl-grid-header-row > th,
.nethub-blazor-grid .dxbl-grid-filter-row > td {
  background: #f3f7fc;
}

.nethub-blazor-grid .dxbl-grid-header-row > th {
  padding: 6px 8px;
  color: #334155;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.nethub-blazor-grid .dxbl-grid-filter-row > td {
  padding: 2px 6px 3px;
}

.nethub-blazor-grid .dxbl-grid-filter-row input,
.nethub-blazor-grid .dxbl-grid-filter-row .dxbl-text-edit {
  height: 28px;
  min-height: 28px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.nethub-blazor-grid .dxbl-grid-filter-row .dxbl-text-edit input {
  min-height: 0;
  height: 22px;
  padding-block: 0;
  font-size: 12px;
  line-height: 1.2;
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr > td {
  padding: 5px 8px;
  line-height: 1.22;
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-ok > td {
  border-color: #d1fae5;
  background: #ecfdf5;
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-ok > td:first-child {
  box-shadow: inset 4px 0 rgba(5, 150, 105, .72);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-ok:hover > td {
  border-color: #bbf7d0;
  background: #dcfce7;
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-planned > td {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-4);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-planned > td:first-child {
  box-shadow: inset 4px 0 var(--primary);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-planned:hover > td {
  border-color: var(--primary-tint-13);
  background: var(--primary-tint-9);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-problem > td {
  border-color: #fecdd3;
  background: var(--danger-soft);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-problem > td:first-child {
  box-shadow: inset 4px 0 var(--danger);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-problem:hover > td {
  border-color: #fda4af;
  background: #fff1f2;
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-missed > td {
  border-color: #fed7aa;
  background: var(--warning-soft);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-missed > td:first-child {
  box-shadow: inset 4px 0 var(--warning);
}

.nethub-blazor-grid .dxbl-grid-table > tbody > tr.report-row-missed:hover > td {
  border-color: #fdba74;
  background: #fff7ed;
}

.time-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.time-chip.ok {
  color: #064e3b;
  background: #dff9ed;
  box-shadow: 0 0 0 6px rgba(5, 150, 105, .10);
}

.time-chip.missing {
  color: #92400e;
  background: #fff3d7;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, .10);
}

.status-chip.success {
  color: #047857;
  background: #dcfce7;
}

.status-chip.warning {
  color: #b45309;
  background: #fef3c7;
}

.status-chip.danger {
  color: #b91c1c;
  background: #fee2e2;
}

.blazor-empty-state {
  margin-top: 10px;
  border: 1px dashed #cbdcf1;
  border-radius: 16px;
  background: var(--primary-tint-1);
}

@media (max-width: 900px) {
  .blazor-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blazor-dashboard-legend {
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .blazor-dashboard-shell {
    padding: 14px;
  }

  .blazor-dashboard-metrics {
    grid-template-columns: 1fr;
  }
}

.partner-inline-editor + .table-responsive,
.partner-inline-editor + .info-callout {
  margin-top: 10px;
}

.work-surface > .surface-head p {
  max-width: 760px;
}

.admin-wide {
  grid-column: 1 / -1;
}

.procedure-capability-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.procedure-capability-panel > span {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.permission-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 999px;
  background: var(--primary-tint-1);
  color: #334155;
  font-weight: 800;
  white-space: nowrap;
}

.permission-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.mobile-badge {
  display: grid;
  width: min(100%, 520px);
  max-width: 520px;
  gap: 12px;
  margin: 0 auto;
}

.mobile-badge-head,
.mobile-hero-card,
.mobile-page-bar,
.mobile-mode-choice,
.mobile-user-card,
.location-panel,
.validation-panel,
.offline-panel,
.mobile-feedback-panel,
.mobile-confirm-panel,
.mobile-list-head,
.mobile-history-filter,
.mobile-record-list,
.mobile-bottom-actions,
.mobile-today-list,
.mobile-stamp-form {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-badge-head,
.mobile-hero-card,
.mobile-page-bar,
.mobile-mode-choice,
.location-panel,
.validation-panel,
.offline-panel,
.mobile-feedback-panel,
.mobile-confirm-panel,
.mobile-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.mobile-hero-card {
  align-items: flex-start;
  min-height: 128px;
  border-color: var(--primary-tint-10);
  background: linear-gradient(145deg, #ffffff 0%, var(--primary-tint-5) 100%);
}

.mobile-hero-logo {
  display: block;
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.mobile-hero-card h2 {
  margin: 4px 0 8px;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.mobile-page-bar {
  justify-content: flex-start;
  border-radius: 16px;
  background: #fff;
}

.mobile-page-bar .btn {
  flex: 0 0 auto;
}

.mobile-page-bar strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.mobile-mode-choice {
  display: grid;
  align-items: stretch;
  gap: 14px;
  padding: 16px;
}

.mobile-mode-choice h2 {
  margin: 2px 0 6px;
  color: var(--text);
  font-size: 24px;
  font-weight: 950;
}

.mobile-mode-choice p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.mobile-mode-grid {
  display: grid;
  gap: 10px;
}

.mobile-mode-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 18px;
  background: var(--primary-tint-1);
  padding: 14px;
  color: var(--text);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.mobile-mode-card:hover,
.mobile-mode-card:focus-visible {
  border-color: var(--primary-tint-13);
  box-shadow: 0 14px 28px rgba(var(--primary-rgb), .12);
  transform: translateY(-1px);
}

.mobile-mode-card.primary {
  border-color: var(--primary-tint-10);
  background: linear-gradient(135deg, var(--primary-tint-4) 0%, #ffffff 100%);
}

.mobile-mode-icon {
  display: inline-flex;
  grid-row: span 2;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--primary-tint-9);
  color: var(--primary);
  font-size: 14px;
  font-weight: 950;
}

.mobile-mode-card.primary .mobile-mode-icon {
  background: var(--primary);
  color: #fff;
}

.mobile-mode-card[data-mobile-mode="position"] .mobile-mode-icon {
  background: #dcfce7;
  color: #047857;
}

.mobile-mode-card strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.mobile-mode-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-form-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 14px;
  background: var(--primary-tint-1);
  padding: 8px 10px 8px 14px;
}

.mobile-form-mode-bar span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.mobile-badge.is-qr-mode .mobile-page-bar,
.mobile-badge.is-qr-mode .mobile-bottom-actions {
  display: none;
}

.mobile-badge.is-qr-mode .mobile-stamp-form {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.mobile-badge.is-qr-mode .mobile-stamp-form > :not(input):not(.mobile-form-mode-bar):not(.mobile-qr-scan) {
  display: none !important;
}

.mobile-badge.is-qr-mode .mobile-form-mode-bar {
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-badge.is-qr-mode .mobile-qr-scan {
  min-height: 360px;
  align-content: center;
  border-radius: 22px;
  padding: 16px;
}

.mobile-badge.is-qr-mode .mobile-qr-scan video {
  min-height: 300px;
}

.mobile-badge.is-qr-mode .mobile-qr-actions {
  grid-template-columns: 1fr;
}

.mobile-badge.is-qr-mode .mobile-qr-actions .btn {
  min-height: 52px;
}

.mobile-badge.is-qr-mode.is-qr-complete .mobile-qr-actions {
  display: none;
}

.mobile-badge:not(.is-qr-mode) .mobile-qr-scan,
.mobile-badge.is-position-mode .mobile-position-hidden,
.mobile-badge.is-position-mode .mobile-section-title,
.mobile-badge.is-position-mode .stamp-actions {
  display: none !important;
}

.mobile-badge-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.mobile-badge-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.connection-pill.is-offline {
  background: var(--warning-soft);
  color: #b45309;
}

.validation-panel {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.location-panel[hidden],
.validation-panel[hidden] {
  display: none;
}

.location-panel {
  align-items: stretch;
  border-color: #d8e6f7;
  background: var(--primary-tint-1);
}

.location-panel div {
  display: grid;
  gap: 4px;
}

.location-panel span {
  color: var(--text);
  font-weight: 850;
}

.location-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.validation-panel.is-valid {
  color: var(--success);
}

.validation-panel.is-warning {
  color: #b45309;
}

.validation-panel.is-invalid {
  color: var(--danger);
}

.mobile-feedback-panel {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.mobile-confirm-panel {
  border-color: var(--primary-tint-10);
  background: #fff;
}

.mobile-confirm-panel h2,
.mobile-list-head h2 {
  margin: 2px 0 6px;
  font-size: 20px;
  font-weight: 900;
}

.mobile-confirm-panel p,
.mobile-list-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.mobile-confirm-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.mobile-confirm-actions .btn {
  min-height: 44px;
  min-width: 0;
  width: 100%;
}

.mobile-confirm-actions .btn-outline-secondary {
  grid-column: 1;
  justify-self: start;
}

.mobile-confirm-actions .btn-primary,
.mobile-confirm-actions .btn-danger {
  grid-column: 2;
  justify-self: end;
}

.mobile-feedback-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.mobile-feedback-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.mobile-feedback-main strong,
.mobile-feedback-main div > span,
.mobile-feedback-main small {
  display: block;
}

.mobile-feedback-main strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.mobile-feedback-main div > span {
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 750;
}

.mobile-feedback-panel small,
.offline-panel small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-feedback-panel.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.mobile-feedback-panel.is-success .mobile-feedback-icon {
  background: var(--success);
}

.mobile-feedback-panel.is-success .mobile-feedback-main div > span {
  color: #166534;
}

.mobile-feedback-panel.is-loading {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.mobile-feedback-panel.is-loading .mobile-feedback-icon {
  background: var(--primary);
}

.mobile-feedback-panel.is-warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.mobile-feedback-panel.is-warning .mobile-feedback-icon {
  background: var(--warning);
}

.mobile-feedback-panel.is-warning .mobile-feedback-main div > span {
  color: #9a3412;
}

.mobile-feedback-panel.is-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.mobile-feedback-panel.is-error .mobile-feedback-icon {
  background: var(--danger);
}

.mobile-feedback-panel.is-error .mobile-feedback-main div > span,
.offline-panel small.is-error {
  color: var(--danger);
}

.stamp-actions .btn.is-loading {
  opacity: .88;
}

.stamp-actions .btn.is-selected {
  outline: 3px solid rgba(var(--primary-rgb), .18);
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), .16);
}

.mobile-stamp-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.mobile-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 16px;
  background: var(--primary-tint-1);
  padding: 12px;
}

.mobile-user-card label,
.mobile-user-card div {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 4px;
  margin: 0;
}

.mobile-user-card label,
.mobile-user-card div > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.mobile-user-card input {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.mobile-user-card strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.mobile-user-card small,
.mobile-user-card .form-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

.mobile-user-avatar {
  display: inline-flex;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary-tint-9);
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
}

.mobile-field {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.mobile-badge .form-control,
.mobile-badge .form-select {
  border-color: #dbe3ee;
  border-radius: 14px;
  min-height: 48px;
  font-weight: 500;
}

.mobile-qr-scan {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 16px;
  background: var(--primary-tint-1);
}

.mobile-qr-scan video {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 14px;
  background: #0f172a;
  object-fit: cover;
}

.mobile-qr-scan video[hidden] {
  display: none;
}

.mobile-qr-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-qr-actions .btn {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 900;
}

.mobile-qr-scan small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-qr-scan.is-scanning {
  border-color: var(--primary);
  background: var(--primary-tint-4);
}

.mobile-qr-scan.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.mobile-qr-scan.is-error {
  border-color: #fecaca;
  background: #fef2f2;
}

.mobile-qr-scan.is-success small {
  color: #166534;
}

.mobile-qr-scan.is-error small {
  color: var(--danger);
}

.mobile-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-section-title {
  display: grid;
  gap: 2px;
}

.mobile-section-title strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.mobile-switch-row {
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.mobile-today-list {
  padding: 16px;
}

.mobile-history-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 16px;
}

.mobile-record-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.mobile-record-summary {
  gap: 14px;
}

.mobile-record-day {
  display: grid;
  gap: 8px;
}

.mobile-record-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-record-day header strong {
  color: var(--primary);
}

.mobile-record-item {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe3ee;
  border-left: 5px solid #86efac;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.mobile-record-item.is-missed {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.mobile-record-item.is-absence {
  border-left-color: var(--primary);
  background: var(--primary-tint-4);
}

.mobile-record-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-record-item strong,
.mobile-record-item span {
  display: block;
}

.mobile-record-item .status-pill,
.mobile-record-item .chip {
  display: inline-flex;
}

.mobile-record-time {
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
}

.mobile-record-label {
  font-size: 20px;
  line-height: 1.1;
}

.mobile-record-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-record-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-record-detail span {
  min-width: 0;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.mobile-record-detail strong {
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.mobile-record-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.mobile-history-section {
  display: grid;
  gap: 12px;
}

.mobile-empty-state {
  display: grid;
  gap: 4px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.mobile-empty-state strong {
  color: var(--text);
}

.mobile-action-grid {
  display: grid;
  gap: 12px;
}

.mobile-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  min-height: 92px;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.mobile-action-icon {
  display: inline-flex;
  flex: 0 0 54px;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
  font-weight: 900;
}

.mobile-action-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mobile-action-card strong {
  font-size: 20px;
  font-weight: 900;
}

.mobile-action-card small,
.mobile-record-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-action-card:focus,
.mobile-action-card:hover {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-4);
  color: var(--text);
  transform: translateY(-1px);
}

.mobile-install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  border: 1px solid var(--primary-tint-10);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary-tint-4) 0%, #ffffff 100%);
  padding: 16px;
  box-shadow: var(--shadow);
}

.mobile-install-card strong,
.mobile-install-card small {
  display: block;
}

.mobile-install-card strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
}

.mobile-install-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-bottom-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  padding: 14px;
}

.mobile-today-list .surface-head {
  margin-bottom: 12px;
}

.mobile-today-list .table {
  min-width: 520px;
}

.stamp-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
}

.stamp-actions .btn {
  min-height: 64px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 900;
  white-space: normal;
}

.mobile-expense-panel,
.mobile-expense-total-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-expense-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 16px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
  list-style: none;
}

.mobile-expense-panel summary::-webkit-details-marker {
  display: none;
}

.mobile-expense-panel summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 950;
}

.mobile-expense-panel[open] summary::after {
  content: "-";
}

.mobile-expense-form {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0 0 18px 18px;
  box-shadow: none;
}

.mobile-expense-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.mobile-expense-chip {
  display: grid;
  flex: 0 0 min(78%, 260px);
  gap: 4px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.mobile-expense-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-tint-4);
  box-shadow: 0 12px 24px rgba(var(--primary-rgb), .14);
}

.mobile-expense-chip strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-expense-chip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.mobile-expense-total-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.mobile-expense-total-card h2 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}

.mobile-expense-total-card p,
.mobile-expense-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-expense-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mobile-expense-totals span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 1px solid #e5edf7;
  border-radius: 14px;
  background: var(--primary-tint-1);
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.mobile-expense-totals strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.mobile-expense-list {
  padding: 0;
}

.mobile-expense-attachments {
  display: grid;
  gap: 8px;
}

.mobile-expense-attachments span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  background: var(--primary-tint-1);
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.mobile-expense-attachments a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.mobile-expense-inline-edit {
  border-top: 1px solid #edf2f7;
  padding-top: 8px;
}

.mobile-expense-inline-edit > summary {
  cursor: pointer;
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
  list-style: none;
}

.mobile-expense-delete {
  display: grid;
  margin-top: 8px;
}

.mobile-focus-panel,
.mobile-expense-head,
.mobile-expense-detail,
.mobile-expense-editor {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-expense-head,
.mobile-expense-detail,
.mobile-expense-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.mobile-expense-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: linear-gradient(145deg, #ffffff 0%, var(--primary-tint-1) 100%);
}

.mobile-expense-head h2,
.mobile-expense-detail-head h2,
.mobile-expense-editor h2 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0;
}

.mobile-expense-head p,
.mobile-expense-detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mobile-expense-note-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.mobile-expense-note-card {
  display: grid;
  flex: 0 0 min(82%, 280px);
  gap: 4px;
  min-height: 118px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  color: var(--text);
  text-align: left;
  scroll-snap-align: start;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .04);
}

.mobile-expense-note-card.is-active {
  border-color: var(--primary);
  background: linear-gradient(145deg, var(--primary-tint-4) 0%, #ffffff 100%);
  box-shadow: 0 14px 30px rgba(var(--primary-rgb), .14);
}

.mobile-expense-note-card span,
.mobile-expense-note-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-expense-note-card strong,
.mobile-expense-row-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-expense-note-card b {
  justify-self: start;
  border-radius: 999px;
  background: var(--primary-soft);
  padding: 5px 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
}

.mobile-expense-detail {
  border-top: 4px solid var(--primary);
}

.mobile-expense-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.mobile-expense-inline-actions,
.mobile-expense-row-actions,
.mobile-approval-edit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mobile-expense-row-list {
  display: grid;
  gap: 10px;
}

.mobile-expense-row-card {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe3ee;
  border-left-width: 4px;
  border-radius: 18px;
  background: #fff;
  padding: 12px;
}

.mobile-expense-row-card.is-reimbursable,
.mobile-expense-row-card.is-pending {
  border-left-color: var(--primary);
  background: var(--primary-tint-1);
}

.mobile-expense-row-card.is-card,
.mobile-expense-row-card.is-approved {
  border-left-color: #059669;
  background: #f0fdf4;
}

.mobile-expense-row-card.is-rejected {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.mobile-expense-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 10px;
}

.mobile-expense-row-main span,
.mobile-expense-row-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mobile-expense-row-main b {
  grid-row: span 2;
  justify-self: end;
  align-self: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.mobile-expense-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mobile-expense-row-meta span {
  border-radius: 999px;
  background: #eef3f9;
  padding: 4px 8px;
}

.mobile-expense-editor {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-1);
}

.mobile-expense-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-expense-switches label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 900;
}

.mobile-expense-switches input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.mobile-expense-two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-expense-rate {
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
}

.mobile-expense-rate small,
.mobile-expense-total-card span,
.mobile-expense-total-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mobile-expense-rate strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}

.mobile-approval-edit {
  justify-content: stretch;
}

.mobile-approval-edit label {
  display: grid;
  flex: 1;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

@media (max-width: 420px) {
  .mobile-expense-two-cols,
  .mobile-expense-switches,
  .mobile-expense-totals {
    grid-template-columns: 1fr;
  }

  .mobile-expense-detail-head,
  .mobile-expense-head {
    grid-template-columns: 1fr;
  }

  .mobile-expense-inline-actions,
  .mobile-expense-row-actions {
    justify-content: flex-start;
  }
}

.auth-panel {
  max-width: 520px;
}

.auth-brand {
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.auth-brand img {
  display: block;
  width: min(260px, 82%);
  height: auto;
}

.auth-link {
  color: var(--primary);
  font-size: .92rem;
  font-weight: 800;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.blazor-auth-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.blazor-auth-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.blazor-auth-copy p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.auth-actions-row {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr minmax(160px, auto);
  align-items: center;
  gap: 12px;
}

.auth-actions-row .btn-outline-secondary {
  grid-column: 1;
  justify-self: start;
}

.auth-actions-row .btn-primary {
  grid-column: 3;
  justify-self: end;
}

@media (max-width: 420px) {
  .auth-actions-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .auth-actions-row .btn-outline-secondary,
  .auth-actions-row .btn-primary {
    grid-column: 1;
    justify-self: stretch;
  }
}

.m365-login-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

/* Reso come <button> dentro il form di login (serve a inviare l'email in POST): i button non
   ereditano font e non hanno il cursore a mano, quindi vanno riallineati esplicitamente. */
.m365-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid #8c8c8c;
  border-radius: var(--radius);
  color: #1f1f1f;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
}

.m365-login-button:hover,
.m365-login-button:focus {
  background: #f3f2f1;
  border-color: #666;
  color: #1f1f1f;
  text-decoration: none;
}

.m365-login-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.m365-login-logo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.m365-login-logo-square {
  display: block;
  width: 9px;
  height: 9px;
}

.m365-login-logo-red {
  background: #f25022;
}

.m365-login-logo-green {
  background: #7fba00;
}

.m365-login-logo-blue {
  background: #00a4ef;
}

.m365-login-logo-yellow {
  background: #ffb900;
}

.alert {
  border-radius: var(--radius);
}

.confirm-modal:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.confirm-dialog {
  width: min(460px, 100%);
  padding: 20px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr minmax(120px, auto);
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.confirm-actions .btn-danger,
.confirm-actions .btn-primary {
  grid-column: 3;
  justify-self: end;
}

.confirm-actions .btn-outline-secondary {
  grid-column: 1;
  justify-self: start;
}

@media (min-width: 1180px) {
  body.sidebar-open .content {
    padding-left: calc(var(--sidebar-width) + 16px);
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-height: 820px) {
  .sidebar {
    left: 0;
    top: var(--topbar-height);
    bottom: 0;
    max-height: calc(100dvh - var(--topbar-height));
    padding: 10px 0;
  }

  .brand {
    min-height: 42px;
    gap: 9px;
  }

  .brand-mark,
  .avatar,
  .company-logo {
    width: 36px;
    height: 36px;
  }

  .brand-mark {
    flex-basis: 36px;
  }

  .sidebar-user {
    grid-template-columns: 36px minmax(0, 1fr) 9px;
    gap: 8px;
    margin: 10px 0;
    padding: 8px;
  }

  .sidebar-company {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
  }

  .menu-search {
    margin-bottom: 8px;
  }

  .menu-search input {
    min-height: 34px;
    padding-block: 6px;
  }

  .nav-section {
    margin: 8px 6px 1px;
  }

  .nav-stack a {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 36px;
    padding: 4px 8px;
    font-size: 13px;
  }

  .nav-row .nav-link-main {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  body:not(.sidebar-open) .nav-row {
    display: block;
  }

  body:not(.sidebar-open) .nav-stack a,
  body:not(.sidebar-open) .nav-row .nav-link-main {
    display: flex;
    min-height: 58px;
    padding: 6px 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 8.5px;
    line-height: 1.1;
    text-align: center;
  }

  body:not(.sidebar-open) .nav-link-main > span:last-child {
    width: 72px;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
  }

  .nav-favorites-sublist {
    margin-left: 36px;
  }

  .sidebar-footer {
    gap: 8px;
    padding-top: 8px;
  }

  .portal-preview-switch {
    gap: 6px;
    padding: 8px;
  }

  .language-select select {
    min-height: 32px;
  }
}

@media (max-width: 1180px) {
  .metric-grid,
  .dashboard-grid,
  .admin-grid,
  .expense-summary-grid,
  .settings-form-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .permission-box,
  .list-filter-grid,
  .timestamp-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .content {
    padding: calc(var(--topbar-height) + 14px) 14px 68px;
  }

  .topbar,
  .page-hero,
  .settings-page-head,
  .surface-head,
  .settings-panel-head,
  .table-toolbar-split,
  .mobile-badge-head,
  .location-panel,
  .offline-panel,
  .mobile-feedback-panel,
  .mobile-confirm-panel,
  .mobile-list-head,
  .mobile-record-item {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .page-hero.blazor-page-hero,
  .page-hero.partner-blazor-head,
  .page-hero.standard-blazor-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-toolbar-left,
  .table-toolbar-right {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }

  .metric-grid,
  .dashboard-grid,
  .admin-grid,
  .expense-notes-grid,
  .expense-summary-grid,
  .expense-approval-filters,
  .settings-form-shell,
  .settings-form-grid,
  .company-two-factor-grid,
  .list-filter-grid,
  .form-grid,
  .copy-row,
  .permission-box,
  .admin-form,
  .stamp-actions,
  .timestamp-profile-grid {
    grid-template-columns: 1fr;
  }

  .mobile-history-filter {
    grid-template-columns: 1fr;
  }

  .mobile-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mobile-confirm-actions .btn,
  .mobile-record-meta {
    width: 100%;
  }

  .mobile-record-meta {
    align-items: stretch;
  }

  .surface-actions,
  .company-two-factor-actions,
  .settings-actions {
    justify-content: flex-start;
  }

  body.partner-portal .surface-head > .surface-actions {
    justify-content: flex-end;
    margin-left: auto;
  }

  .expense-context-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .expense-context-brand {
    justify-content: flex-start;
    text-align: left;
  }

  .approval-amount-form {
    justify-content: flex-start;
  }

  .field.span-2,
  .form-grid-wide {
    grid-column: auto;
  }

  .table-search {
    width: 100%;
    min-width: 0;
  }

  .presence-command-bar,
  .presence-subnav,
  .presence-table-panel .surface-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
    padding-inline: 14px;
  }

  .presence-period-picker,
  .presence-actions {
    flex-wrap: wrap;
  }

  .presence-period-panel {
    position: fixed;
    top: 92px;
    right: 14px;
    left: 14px;
    grid-template-columns: 1fr;
    min-width: 0;
    max-height: calc(100vh - 120px);
    overflow: auto;
  }

  .presence-preset-list {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .presence-period-fields {
    grid-template-columns: 1fr;
  }

  .presence-period-button,
  .presence-actions .btn {
    flex: 1 1 180px;
  }

  .presence-day-strip {
    padding-inline: 14px;
    flex-wrap: wrap;
  }

  .day-strip-cards {
    flex-wrap: wrap;
    width: auto;
  }

  .day-card {
    flex: 0 0 38px;
  }

  .expense-month-card {
    min-width: 132px;
  }

  .expense-payment-options {
    grid-template-columns: 1fr;
  }

  .expense-summary-card {
    min-height: 78px;
  }

  .presence-table-panel {
    margin-inline: 0;
  }

  .presence-qr-card {
    grid-template-columns: 1fr;
  }

  .presence-qr-preview {
    width: 100%;
    min-height: 160px;
  }

  .editor-modal,
  .confirm-modal {
    align-items: end;
    padding: 10px;
  }

  .editor-dialog,
  .confirm-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .editor-dialog .surface-head {
    padding: 14px;
  }

  .editor-body {
    padding: 14px;
  }

  .editor-dialog.wide .form-grid,
  .editor-dialog .form-grid,
  .settings-detail-panel .form-grid,
  .settings-detail-panel .settings-form-grid,
  .expense-note-editor-page .form-grid,
  .expense-row-editor-page .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-form-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .modal-form-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .modal-form-actions .btn[data-close-modal],
  .modal-form-actions .btn-outline-secondary {
    grid-column: 1;
  }

  .modal-form-actions .btn[type="submit"],
  .modal-form-actions .btn-primary,
  .modal-form-actions .btn-danger {
    grid-column: 2;
  }

  .modal-form-actions.has-danger {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-form-main-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-left: 0;
    width: 100%;
  }

  .modal-form-actions:not(.has-danger) .modal-form-main-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .modal-form-actions.has-danger > .btn-danger {
    width: 100%;
  }

  .confirm-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .confirm-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .confirm-actions .btn-danger,
  .confirm-actions .btn-primary {
    grid-column: 2;
  }

  .confirm-actions .btn-outline-secondary {
    grid-column: 1;
  }

}

.partner-blazor-head,
.partner-blazor-nav {
  margin-bottom: 14px;
}

.partner-blazor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.partner-blazor-tabs .btn {
  min-height: 38px;
}

.partner-blazor-modal .editor-dialog {
  max-width: min(1100px, calc(100vw - 40px));
}

.partner-blazor-modal .status-strip {
  margin: 0 24px 16px;
}

.two-factor-panel {
  max-width: 760px;
  gap: 18px;
}

.two-factor-panel.single-method {
  max-width: 760px;
}

.two-factor-heading h1 {
  margin: 4px 0 6px;
  font-size: 1.55rem;
}

.two-factor-heading p,
.two-factor-setup-page .section-heading p {
  color: var(--muted);
  margin: 0;
}

.two-factor-setup-page {
  display: grid;
  gap: 14px;
  width: min(100%, 980px);
  margin: 0 auto;
}

.two-factor-setup-head,
.two-factor-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.two-factor-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.two-factor-setup-head h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}

.two-factor-account {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.two-factor-account span {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.two-factor-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.two-factor-state.is-active {
  background: var(--success-soft);
  color: var(--success);
}

.two-factor-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.two-factor-authenticator-card[hidden] {
  display: none !important;
}

.two-factor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.two-factor-card-head h3 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.two-factor-setup-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--primary-tint-1);
}

.two-factor-authenticator-grid > .two-factor-setup-card {
  padding: 12px;
}

.two-factor-qr-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid #d8e6f7;
  border-radius: 16px;
  background: #fff;
}

.two-factor-qr-block p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.two-factor-qr-preview {
  display: grid;
  place-items: center;
  flex: 0 0 180px;
  width: 184px;
  height: 184px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.two-factor-qr-preview svg,
.two-factor-qr-preview canvas,
.two-factor-qr-image {
  width: 156px;
  height: 156px;
  display: block;
}

.two-factor-qr-preview span {
  color: var(--muted);
  font-weight: 900;
}

.two-factor-guided-setup {
  display: grid;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.two-factor-guided-setup ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.two-factor-manual-key {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d8e6f7;
  border-radius: var(--radius);
  background: #fff;
}

.two-factor-manual-key span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.two-factor-manual-key strong {
  overflow-wrap: anywhere;
}

.two-factor-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.two-factor-panel.single-method .two-factor-method-grid {
  grid-template-columns: minmax(0, 1fr);
}

.two-factor-method-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.two-factor-panel.single-method .two-factor-method-card {
  display: grid;
  align-items: stretch;
}

.two-factor-panel.single-method .two-factor-setup-card {
  width: min(100%, 420px);
  justify-self: center;
}

.two-factor-panel.single-method .two-factor-form {
  width: min(100%, 360px);
  justify-self: center;
}

.two-factor-panel.single-method .auth-code-input {
  width: 100%;
  max-width: 100%;
}

.two-factor-panel.single-method .modal-actions {
  justify-content: center;
}

.two-factor-status-card {
  text-align: center;
}

.two-factor-status-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.selectable-method-card {
  cursor: pointer;
}

.selectable-method-card:hover,
.selectable-method-card:focus-within {
  border-color: var(--primary-tint-10);
  background: var(--primary-tint-1);
}

.selectable-method-card input {
  flex: 0 0 auto;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.selectable-method-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), .18);
}

.selectable-method-card.is-disabled {
  opacity: .58;
  cursor: not-allowed;
}

.selectable-method-card.is-disabled:hover,
.selectable-method-card.is-disabled:focus-within {
  border-color: var(--border);
  background: #fff;
  box-shadow: none;
}

.two-factor-method-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.two-factor-method-copy strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.two-factor-method-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.two-factor-method-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.two-factor-method-title strong {
  font-size: 1.05rem;
  color: var(--text);
}

.two-factor-email-hint {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.two-factor-send-email-form {
  margin: 0;
}

.two-factor-authenticator-card {
  gap: 14px;
}

.two-factor-authenticator-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.two-factor-code-form {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-self: stretch;
}

.two-factor-code-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.two-factor-code-form .modal-actions,
.two-factor-preference-card .modal-actions {
  margin-top: 0;
}

.two-factor-setup-card .field-caption {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-secret-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  letter-spacing: .06em;
}

.auth-code-input {
  max-width: 260px;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-align: center;
}

.two-factor-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

@media (max-width: 760px) {
  .two-factor-setup-page {
    width: 100%;
  }

  .two-factor-setup-head,
  .two-factor-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .two-factor-setup-head,
  .two-factor-card {
    padding: 16px;
  }

  .two-factor-setup-head h2 {
    font-size: 22px;
  }

  .two-factor-account {
    justify-content: flex-start;
  }

  .two-factor-account span {
    max-width: 100%;
  }

  .two-factor-method-grid,
  .two-factor-authenticator-grid {
    grid-template-columns: 1fr;
  }

  .two-factor-qr-preview {
    justify-self: center;
  }

  .auth-code-input {
    max-width: 100%;
  }
}

.mobile-app-shell {
  width: min(100%, 460px);
  min-height: 100dvh;
  align-content: start;
  padding: max(10px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom));
}

.mobile-app-shell .mobile-app-frame {
  display: grid;
  gap: 12px;
}

.mobile-app-shell .mobile-hero-card {
  min-height: 104px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .32), transparent 28%),
    linear-gradient(135deg, #0f766e 0%, var(--primary) 100%);
  color: #fff;
}

.mobile-app-shell .mobile-hero-card h2,
.mobile-app-shell .mobile-hero-card p,
.mobile-app-shell .mobile-hero-card .eyebrow {
  color: #fff;
}

.mobile-app-shell .mobile-hero-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.mobile-app-action-card {
  position: relative;
  min-height: 86px;
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
}

.mobile-app-action-card.is-primary {
  border-color: rgba(var(--primary-rgb), .24);
  background: linear-gradient(135deg, #fff 0%, var(--primary-tint-5) 100%);
}

.mobile-app-action-card::after {
  content: ">";
  margin-left: auto;
  color: #94a3b8;
  font-size: 22px;
  font-weight: 900;
}

.mobile-app-page-bar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 12;
  border-radius: 22px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .10);
}

@media (max-width: 520px) {
  body.mobile-kiosk .content {
    padding: 0;
  }

  .mobile-app-shell {
    width: 100%;
  }

  .mobile-app-action-card {
    padding: 16px;
  }
}

/* Mobile app restyle: shell ispirata a UI kit mobile, funzioni Blazor invariate. */
body.mobile-kiosk {
  background:
    radial-gradient(circle at 50% -12%, rgba(var(--primary-rgb), .16), transparent 34%),
    linear-gradient(180deg, #f8f7fa 0%, #eef3f9 100%);
}

body.mobile-kiosk .content {
  width: min(100%, 480px);
  padding: 0;
}

.mobile-app-shell {
  width: min(100%, 430px);
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(106px + env(safe-area-inset-bottom));
}

.mobile-app-shell .mobile-app-frame {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: calc(100dvh - 106px);
}

.mobile-app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  border: 1px solid rgba(219, 227, 238, .92);
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  padding: 10px 12px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
  backdrop-filter: blur(12px);
}

.mobile-app-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.mobile-app-brand img {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
}

.mobile-app-brand div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.mobile-app-brand strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.05;
}

.mobile-app-brand span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-app-avatar,
.mobile-home-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, #10b981 0%, #0f766e 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 12px 24px rgba(15, 118, 110, .18);
}

.mobile-app-content {
  display: grid;
  align-content: start;
  gap: 14px;
}

.mobile-home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 156px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, .22), transparent 28%),
    linear-gradient(145deg, #211b2a 0%, #0f172a 48%, #0f766e 100%);
  padding: 24px 22px;
  color: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, .22);
}

.mobile-home-hero .eyebrow,
.mobile-home-hero p,
.mobile-home-hero h2 {
  color: #fff;
}

.mobile-home-hero h2 {
  margin: 4px 0 7px;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.02;
}

.mobile-home-hero p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  opacity: .82;
  text-transform: capitalize;
}

.mobile-home-count {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
}

.mobile-app-shell .mobile-action-grid {
  gap: 12px;
}

.mobile-app-action-card {
  min-height: 104px;
  border: 1px solid rgba(219, 227, 238, .95);
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  padding: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.mobile-app-action-card.is-primary {
  border-color: rgba(var(--primary-rgb), .22);
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-tint-5) 100%);
}

.mobile-action-icon {
  border-radius: 20px;
  background: #f1f5f9;
  color: var(--primary);
  font-size: 17px;
}

.mobile-app-action-card.is-primary .mobile-action-icon {
  background: linear-gradient(135deg, var(--primary) 0%, #0f766e 100%);
  color: #fff;
}

.mobile-action-card strong {
  font-size: 19px;
  line-height: 1.1;
}

.mobile-action-card small {
  line-height: 1.35;
}

.mobile-app-action-card::after {
  content: ">";
  align-self: center;
  margin-left: auto;
  color: #94a3b8;
  font-size: 24px;
  font-weight: 950;
}

.mobile-app-nav {
  position: fixed;
  right: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(calc(100vw - 28px), 402px);
  transform: translateX(50%);
  border: 1px solid rgba(219, 227, 238, .96);
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  padding: 8px;
  box-shadow: 0 22px 46px rgba(15, 23, 42, .16);
  backdrop-filter: blur(14px);
}

.mobile-app-nav-item {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: #64748b;
  font-weight: 900;
}

.mobile-app-nav-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #f1f5f9;
  color: inherit;
  font-size: 11px;
  font-weight: 950;
}

.mobile-app-nav-item small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-app-nav-item.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, #0f766e 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(var(--primary-rgb), .22);
}

.mobile-app-nav-item.is-active span {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.mobile-app-page-bar {
  position: static;
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 2px;
  box-shadow: none;
}

.mobile-app-page-bar .btn {
  width: auto;
  min-width: 74px;
  height: 42px;
  border-radius: 16px;
  background: #fff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

.mobile-app-page-bar strong {
  color: #0f172a;
  font-size: 20px;
  line-height: 1.08;
}

.mobile-focus-panel,
.mobile-app-shell .mobile-stamp-form,
.mobile-app-shell .mobile-record-list,
.mobile-app-shell .mobile-list-head,
.mobile-app-shell .mobile-history-filter,
.mobile-app-shell .mobile-today-list,
.mobile-confirm-panel,
.mobile-feedback-panel {
  border-color: rgba(219, 227, 238, .95);
  border-radius: 26px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.mobile-app-shell .mobile-stamp-form {
  gap: 14px;
  padding: 16px;
}

.mobile-mode-choice {
  border-radius: 26px;
  padding: 18px;
}

.mobile-mode-choice h2 {
  font-size: 25px;
  line-height: 1.05;
}

.mobile-mode-card {
  min-height: 92px;
  border-radius: 24px;
  background: #f8fafc;
  padding: 14px;
}

.mobile-mode-card.primary {
  background: linear-gradient(135deg, var(--primary-tint-4) 0%, #ffffff 100%);
}

.mobile-mode-icon {
  border-radius: 18px;
}

.mobile-user-card,
.location-panel,
.mobile-switch-row,
.mobile-info-strip {
  border-radius: 22px;
  background: #f8fbff;
}

.mobile-info-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #dbeafe;
  padding: 12px 14px;
}

.mobile-info-strip span {
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.mobile-info-strip strong {
  color: #0f172a;
  font-weight: 950;
}

.mobile-badge .form-control,
.mobile-badge .form-select {
  min-height: 56px;
  border-radius: 18px;
  background-color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.mobile-badge textarea.form-control {
  min-height: 92px;
}

.mobile-app-shell .btn-primary {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  border-radius: 18px;
  font-weight: 950;
}

.mobile-app-shell .btn-outline-secondary,
.mobile-app-shell .btn-outline-primary {
  border-radius: 18px;
  font-weight: 950;
}

.mobile-app-shell .expense-icon-button {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 16px;
  font-size: 18px;
}

.mobile-app-shell .mobile-refresh-button {
  align-self: stretch;
  min-height: 56px;
}

.mobile-app-shell .mobile-secondary-action {
  min-height: 54px;
  border-radius: 18px;
  font-weight: 950;
}

.mobile-feedback-panel {
  padding: 14px;
}

.mobile-feedback-icon {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

.mobile-record-item {
  border-radius: 22px;
  padding: 14px;
}

.mobile-record-time {
  font-size: 24px;
}

.mobile-record-detail {
  grid-template-columns: 1fr 1fr;
}

.mobile-install-card {
  margin-top: 0;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #ecfeff 100%);
}

@media (max-width: 390px) {
  .mobile-app-shell {
    padding-inline: 10px;
  }

  .mobile-home-hero {
    min-height: 142px;
    padding: 20px;
  }

  .mobile-home-hero h2 {
    font-size: 27px;
  }

  .mobile-action-icon {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  .mobile-action-card strong {
    font-size: 17px;
  }

  .mobile-app-nav {
    width: calc(100vw - 20px);
    padding: 7px;
  }

  .mobile-app-nav-item {
    min-height: 54px;
    border-radius: 17px;
  }

  .mobile-app-nav-item span {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .mobile-app-nav-item small {
    font-size: 8.8px;
  }

  .mobile-record-detail,
  .mobile-date-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile app responsive final pass: ottimizzato per 360, 375, 390, 414, 430, 480 e tablet stretti. */
body.mobile-kiosk,
body.mobile-kiosk * {
  box-sizing: border-box;
}

body.mobile-kiosk {
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -16%, rgba(var(--primary-rgb), .18), transparent 32%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}

body.mobile-kiosk .content {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

body.mobile-kiosk .mobile-app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) clamp(10px, 3.2vw, 18px) calc(108px + env(safe-area-inset-bottom));
}

body.mobile-kiosk .mobile-app-shell .mobile-app-frame,
body.mobile-kiosk .mobile-app-content,
body.mobile-kiosk .mobile-action-copy,
body.mobile-kiosk .mobile-app-brand,
body.mobile-kiosk .mobile-app-brand div,
body.mobile-kiosk .mobile-profile-strip > div,
body.mobile-kiosk .mobile-record-main,
body.mobile-kiosk .mobile-record-detail,
body.mobile-kiosk .mobile-section-title,
body.mobile-kiosk .mobile-list-head,
body.mobile-kiosk .mobile-history-filter,
body.mobile-kiosk .mobile-date-row {
  min-width: 0;
}

body.mobile-kiosk .mobile-app-top,
body.mobile-kiosk .mobile-home-hero,
body.mobile-kiosk .mobile-profile-strip,
body.mobile-kiosk .mobile-focus-panel,
body.mobile-kiosk .mobile-stamp-form,
body.mobile-kiosk .mobile-list-head,
body.mobile-kiosk .mobile-history-filter,
body.mobile-kiosk .mobile-today-list,
body.mobile-kiosk .mobile-record-list,
body.mobile-kiosk .mobile-feedback-panel,
body.mobile-kiosk .mobile-install-card {
  width: 100%;
  max-width: 100%;
}

body.mobile-kiosk .mobile-app-top {
  min-height: 62px;
  border-radius: clamp(20px, 5vw, 28px);
  padding: 10px 12px;
}

body.mobile-kiosk .mobile-app-brand img {
  width: clamp(38px, 10vw, 46px);
  height: clamp(38px, 10vw, 46px);
  border-radius: 14px;
}

body.mobile-kiosk .mobile-app-brand strong,
body.mobile-kiosk .mobile-profile-strip strong,
body.mobile-kiosk .mobile-record-time,
body.mobile-kiosk .mobile-record-subtitle,
body.mobile-kiosk .mobile-record-detail span,
body.mobile-kiosk .mobile-field,
body.mobile-kiosk .mobile-badge .form-control,
body.mobile-kiosk .mobile-badge .form-select {
  overflow-wrap: anywhere;
}

body.mobile-kiosk .mobile-app-brand span,
body.mobile-kiosk .mobile-app-context,
body.mobile-kiosk .mobile-profile-strip strong,
body.mobile-kiosk .mobile-profile-strip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-kiosk .mobile-app-context {
  max-width: min(34vw, 148px);
  min-width: 0;
  justify-content: center;
}

body.mobile-kiosk .mobile-home-hero {
  min-height: clamp(132px, 36vw, 166px);
  border-radius: clamp(26px, 7vw, 34px);
  padding: clamp(18px, 5vw, 24px);
}

body.mobile-kiosk .mobile-home-hero h2 {
  font-size: clamp(26px, 7.8vw, 34px);
  letter-spacing: 0;
}

body.mobile-kiosk .mobile-profile-strip,
body.mobile-kiosk .mobile-user-card,
body.mobile-kiosk .mobile-info-strip,
body.mobile-kiosk .location-panel,
body.mobile-kiosk .mobile-mode-card,
body.mobile-kiosk .mobile-record-item {
  border-radius: clamp(18px, 5vw, 24px);
}

body.mobile-kiosk .mobile-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 3vw, 14px);
}

body.mobile-kiosk .mobile-action-grid .mobile-app-action-card:first-child {
  grid-column: 1 / -1;
}

body.mobile-kiosk .mobile-app-action-card {
  display: flex;
  min-width: 0;
  min-height: clamp(98px, 27vw, 124px);
  border-radius: clamp(22px, 6vw, 28px);
  padding: clamp(13px, 3.8vw, 18px);
}

body.mobile-kiosk .mobile-app-action-card::after {
  flex: 0 0 auto;
}

body.mobile-kiosk .mobile-action-icon {
  flex-basis: clamp(44px, 12vw, 54px);
  width: clamp(44px, 12vw, 54px);
  height: clamp(44px, 12vw, 54px);
  border-radius: clamp(15px, 4.5vw, 20px);
  font-size: clamp(13px, 4vw, 18px);
}

body.mobile-kiosk .mobile-action-card strong {
  font-size: clamp(16px, 4.8vw, 20px);
  line-height: 1.1;
}

body.mobile-kiosk .mobile-action-card small {
  font-size: clamp(12px, 3.4vw, 13.5px);
}

body.mobile-kiosk .mobile-app-page-bar {
  min-height: 50px;
  gap: 10px;
}

body.mobile-kiosk .mobile-app-page-bar .btn {
  flex: 0 0 auto;
  min-width: 52px;
  height: 42px;
  padding-inline: 12px;
}

body.mobile-kiosk .mobile-app-page-bar strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  font-size: clamp(18px, 5vw, 22px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-kiosk .mobile-app-page-bar .eyebrow {
  display: block;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-kiosk .mobile-stamp-form,
body.mobile-kiosk .mobile-mode-choice,
body.mobile-kiosk .mobile-list-head,
body.mobile-kiosk .mobile-history-filter,
body.mobile-kiosk .mobile-today-list {
  padding: clamp(14px, 4vw, 18px);
}

body.mobile-kiosk .mobile-mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.mobile-kiosk .mobile-field {
  display: grid;
  gap: 7px;
}

body.mobile-kiosk .mobile-badge .form-control,
body.mobile-kiosk .mobile-badge .form-select {
  width: 100%;
  min-height: 54px;
  font-size: 16px;
}

body.mobile-kiosk .mobile-badge input[type="file"].form-control {
  min-height: auto;
  border-style: dashed;
  padding: 16px;
  line-height: 1.35;
}

body.mobile-kiosk .mobile-date-row,
body.mobile-kiosk .mobile-record-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.mobile-kiosk .mobile-record-list {
  display: grid;
  gap: 10px;
}

body.mobile-kiosk .mobile-record-main {
  gap: 10px;
}

body.mobile-kiosk .mobile-record-time {
  font-size: clamp(20px, 6vw, 25px);
}

body.mobile-kiosk .mobile-record-detail span {
  min-width: 0;
}

body.mobile-kiosk .mobile-primary-action,
body.mobile-kiosk .mobile-app-shell .btn-primary,
body.mobile-kiosk .mobile-app-shell .btn-outline-primary,
body.mobile-kiosk .mobile-app-shell .btn-outline-secondary {
  min-height: 48px;
}

body.mobile-kiosk .mobile-qr-actions,
body.mobile-kiosk .mobile-confirm-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.mobile-kiosk .mobile-confirm-panel {
  width: min(440px, calc(100vw - 24px));
  bottom: calc(92px + env(safe-area-inset-bottom));
}

body.mobile-kiosk .mobile-app-nav {
  right: 50%;
  width: min(448px, calc(100vw - 20px));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  transform: translateX(50%);
}

body.mobile-kiosk .mobile-app-nav-item {
  min-width: 0;
  min-height: clamp(52px, 14vw, 60px);
  padding: 5px 3px;
}

body.mobile-kiosk .mobile-app-nav-item small {
  max-width: 100%;
}

@media (min-width: 481px) and (max-width: 768px) {
  body.mobile-kiosk .mobile-app-shell {
    max-width: 520px;
    padding-inline: 20px;
  }

  body.mobile-kiosk .mobile-app-nav {
    width: min(492px, calc(100vw - 36px));
  }
}

@media (min-width: 769px) {
  body.mobile-kiosk .mobile-app-shell {
    max-width: 640px;
    padding-inline: 24px;
  }

  body.mobile-kiosk .mobile-app-nav {
    width: min(592px, calc(100vw - 48px));
  }

  body.mobile-kiosk .mobile-home-hero {
    min-height: 176px;
  }

  body.mobile-kiosk .mobile-record-detail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  body.mobile-kiosk .mobile-app-shell {
    max-width: 720px;
  }

  body.mobile-kiosk .mobile-app-nav {
    width: min(660px, calc(100vw - 64px));
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  body.mobile-kiosk .mobile-app-shell {
    max-width: min(760px, 100vw);
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.mobile-kiosk .mobile-app-frame,
  body.mobile-kiosk .mobile-app-content {
    gap: 10px;
  }

  body.mobile-kiosk .mobile-home-hero {
    min-height: 112px;
    padding-block: 16px;
  }

  body.mobile-kiosk .mobile-home-hero h2 {
    font-size: clamp(24px, 5vw, 30px);
  }

  body.mobile-kiosk .mobile-app-action-card {
    min-height: 90px;
  }

  body.mobile-kiosk .mobile-app-nav {
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

@media (min-resolution: 2dppx) {
  body.mobile-kiosk .mobile-app-top,
  body.mobile-kiosk .mobile-home-hero,
  body.mobile-kiosk .mobile-app-action-card,
  body.mobile-kiosk .mobile-stamp-form,
  body.mobile-kiosk .mobile-record-item,
  body.mobile-kiosk .mobile-app-nav {
    box-shadow: 0 16px 34px rgba(15, 23, 42, .10);
  }
}

@media (max-width: 430px) {
  body.mobile-kiosk .mobile-app-shell {
    max-width: 100%;
  }

  body.mobile-kiosk .mobile-app-context {
    max-width: 30vw;
  }
}

@media (max-width: 390px) {
  body.mobile-kiosk .mobile-action-grid {
    grid-template-columns: 1fr;
  }

  body.mobile-kiosk .mobile-action-grid .mobile-app-action-card:first-child {
    grid-column: auto;
  }

  body.mobile-kiosk .mobile-date-row,
  body.mobile-kiosk .mobile-record-detail {
    grid-template-columns: 1fr;
  }

  body.mobile-kiosk .mobile-app-brand strong {
    font-size: 15px;
  }

  body.mobile-kiosk .mobile-app-brand span {
    font-size: 11px;
  }
}

@media (max-width: 375px) {
  body.mobile-kiosk .mobile-app-shell {
    padding-inline: 9px;
  }

  body.mobile-kiosk .mobile-app-top {
    gap: 8px;
    padding-inline: 10px;
  }

  body.mobile-kiosk .mobile-app-context {
    display: none;
  }

  body.mobile-kiosk .mobile-home-count {
    width: 52px;
    height: 52px;
  }

  body.mobile-kiosk .mobile-app-nav {
    width: calc(100vw - 14px);
    padding: 6px;
  }
}

@media (max-width: 360px) {
  body.mobile-kiosk .mobile-app-shell {
    padding-inline: 8px;
  }

  body.mobile-kiosk .mobile-app-brand img,
  body.mobile-kiosk .mobile-app-avatar {
    width: 38px;
    height: 38px;
  }

  body.mobile-kiosk .mobile-app-nav-item small {
    font-size: 8px;
  }

  body.mobile-kiosk .mobile-mode-card,
  body.mobile-kiosk .mobile-record-item,
  body.mobile-kiosk .mobile-profile-strip {
    padding: 12px;
  }
}

/* Override finale del menu Blazor: evita che le vecchie regole MVC su .nav-stack deformino la sidebar. */
body:not(.sidebar-open) .shell-nav .shell-primary-link,
body:not(.sidebar-open) .shell-nav .shell-menu-group summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 62px;
  padding: 7px 0;
  text-align: center;
}

body:not(.sidebar-open) .shell-nav .shell-primary-link > span:nth-child(2),
body:not(.sidebar-open) .shell-nav .shell-menu-group summary > span:nth-child(2) {
  display: block;
  width: 84px;
  max-width: 84px;
  overflow: hidden;
  color: #7c7f83;
  font-size: 7.2px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

body:not(.sidebar-open) .shell-nav .shell-menu-chevron,
body:not(.sidebar-open) .shell-nav .shell-menu-children {
  display: none;
}

body:not(.sidebar-open) .sidebar,
body:not(.sidebar-open) .nav-stack {
  scrollbar-width: none;
}

body:not(.sidebar-open) .sidebar::-webkit-scrollbar,
body:not(.sidebar-open) .nav-stack::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.sidebar-open .shell-nav .shell-primary-link,
body.sidebar-open .shell-nav .shell-menu-group summary {
  grid-template-columns: 28px minmax(0, 1fr) 14px;
  gap: 8px;
  min-height: 50px;
  padding: 8px 8px 8px 2px;
  font-size: 11.5px;
  text-align: left;
}

body.sidebar-open .shell-nav .shell-menu-group {
  display: block;
}

body.sidebar-open .shell-nav .shell-primary-link > span:nth-child(2),
body.sidebar-open .shell-nav .shell-menu-group summary > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

body.sidebar-open .shell-nav .shell-menu-children {
  min-width: 0;
  /* Niente padding a destra: lo sfondo della voce corrente arriva fino al bordo, come le righe dei gruppi. */
  padding-right: 0;
  /* Allinea il testo delle voci sotto la label sopra. L'header (summary) qui parte a 38px (2px
     padding + 28px colonna icona + 8px gap, vedi la regola per .shell-menu-group summary/
     .shell-primary-link con sidebar aperta). Il link sotto e' ancora sotto l'effetto della vecchia
     regola legacy ".nav-stack a" (stessa specificita' di ".shell-menu-children a", dichiarata dopo
     nel foglio: vince lei), che gli da' il suo stesso padding-left di 2px: 36+2=38. Se il padding
     dell'header cambia ancora, questo valore va ricalcolato di conseguenza (misurato dal vivo, non
     a occhio: le due colonne sono calcolate indipendentemente e vanno tenute sincronizzate a mano).
     Non toccare la specificita' di ".shell-menu-children a" per risolvere la cosa "alla radice":
     cambia anche font/peso/altezza riga rispetto a quanto visto finora, che deve restare invariato. */
  padding-left: 36px;
  /* Voci del sottomenu a contatto, senza spazio bianco tra una e l'altra ne' sotto la riga del gruppo. */
  gap: 0;
  padding-top: 0;
}

/* Gruppo aperto: la riga del gruppo ha l'angolo in basso dritto, cosi' si fonde con la prima voce del sottomenu. */
body.sidebar-open .shell-nav .shell-menu-group[open] > summary {
  border-bottom-right-radius: 0;
}

/* NIENTE transizione qui: un tentativo con max-height/opacity animati rompeva il calcolo
   dell'altezza per il grid esterno (.nav-stack/.shell-nav, grid-auto-rows:max-content) - la voce
   di menu successiva restava posizionata come se il gruppo appena aperto avesse ancora l'altezza
   del solo sommario, sovrapponendosi al sottomenu invece di scendere sotto ("scalini"/spaziatura
   non uniforme). display:none/grid istantaneo non ha questo problema: il grid esterno vede
   l'altezza reale del contenuto fin dal primo frame. */
body.sidebar-open .shell-nav .shell-menu-group:not([open]) > .shell-menu-children {
  display: none;
}

body.sidebar-open .shell-nav .shell-menu-group[open] > .shell-menu-children {
  display: grid;
}

body.sidebar-open .shell-nav .shell-menu-children a {
  /* Lo sfondo (hover/voce corrente) parte dal bordo sinistro della sidebar come nelle voci di primo
     livello: margine negativo pari al padding-left di .shell-menu-children (36px) e stesso valore
     aggiunto al padding della voce, cosi' il testo resta dov'e' (36 + 2 = 38px). Se cambia il
     padding-left di .shell-menu-children vanno aggiornati anche questi tre valori. */
  margin-left: -36px;
  /* Angoli dritti: con il raggio gli spigoli lasciavano un vuoto bianco tra due voci colorate adiacenti. */
  border-radius: 0;
  padding-left: 38px;
  /* Font esplicito: senza, vinceva ".nav-stack a" (16px, 13px solo con finestra bassa) e le voci
     risultavano piu' grandi dei titoli dei gruppi. */
  font-size: 13px;
  /* display:flex + align-items:center (non solo block) perche' la vecchia regola generica
     ".nav-stack a" (stessa specificita' di ".shell-menu-children a", dichiarata dopo nel foglio:
     vince lei per le proprieta' non coperte qui) le impone anche un padding/min-height calcolati
     per un layout con align-items:center funzionante - con solo "block" il testo restava ancorato
     in alto nel box invece di centrarsi verticalmente, visibile appena la voce ha uno sfondo
     colorato (hover/voce corrente). Con flex, il centraggio resta corretto qualunque
     padding/min-height finisca per vincere da quella regola legacy, senza dover ricalcolare
     nulla a mano se cambia ancora. */
  display: flex;
  align-items: center;
  max-width: calc(100% + 36px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-transform: none;
}

@media (max-height: 820px) {
  body.sidebar-open .shell-nav .shell-menu-children a {
    font-size: 12.5px;
  }
}

body.sidebar-open .shell-nav .shell-menu-children a > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

body.sidebar-open .sidebar {
  padding-top: 0;
}

body.sidebar-open .shell-nav {
  padding-top: 0;
}

body:not(.sidebar-open) .shell-nav .shell-menu-group.shell-flyout-open summary {
  background: linear-gradient(90deg, var(--primary-nav-from) 0%, var(--primary-nav-to) 100%);
  color: #fff;
}

body:not(.sidebar-open) .shell-nav .shell-primary-link.active > span:nth-child(2),
body:not(.sidebar-open) .shell-nav .shell-menu-group.active > summary > span:nth-child(2),
body:not(.sidebar-open) .shell-nav .shell-menu-group.shell-flyout-open > summary > span:nth-child(2) {
  color: #fff;
}

/* Gruppo "corrente" ma con sfondo trasparente (un altro gruppo e' aperto, vedi .has-expanded-group): l'etichetta bianca
   di sopra diventava invisibile su sfondo chiaro. Qui resta grigia, come le altre voci non evidenziate. */
body:not(.sidebar-open) .shell-nav.has-expanded-group .shell-menu-group.active:not(.is-expanded):not(.shell-flyout-open) > summary:not(:hover):not(:focus-visible) > span:nth-child(2) {
  color: #7c7f83;
}

.shell-menu-flyout {
  display: grid;
  position: fixed;
  top: var(--topbar-height);
  bottom: 0;
  left: var(--sidebar-collapsed-width);
  z-index: 1045;
  width: min(260px, calc(100vw - var(--sidebar-collapsed-width) - 14px));
  height: calc(100dvh - var(--topbar-height));
  max-height: none;
  /* align-content:start, non center: il pannello e' alto quanto tutto lo schermo (per allinearsi
     visivamente alla sidebar principale), ma il contenuto (titolo + pochi link) e' sempre corto -
     centrarlo verticalmente lasciava un vuoto enorme sopra, col titolo che sembrava "perso" a meta'
     schermo invece di comparire subito sotto la topbar come un vero menu a comparsa. */
  align-content: start;
  gap: 14px;
  padding: 32px 28px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid #dbe3ee;
  border-right: 1px solid #dbe3ee;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: 16px 0 34px rgba(15, 23, 42, .08);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity .14s ease, transform .14s ease;
}

.shell-menu-flyout.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

body.sidebar-open .shell-menu-flyout {
  display: none;
}

.shell-menu-flyout .shell-flyout-title {
  display: block;
  position: relative;
  min-width: 0;
  padding: 0 0 22px;
  overflow: hidden;
  border-bottom: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.shell-menu-flyout .shell-flyout-title::before {
  position: absolute;
  top: -26px;
  left: -28px;
  width: 2px;
  height: 54px;
  background: var(--primary-nav-from);
  content: "";
}

.shell-menu-flyout a,
.shell-menu-flyout .shell-empty-item {
  display: block;
  min-height: 40px;
  padding: 8px 10px;
  overflow: hidden;
  border-radius: 8px;
  color: #1f2937;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.shell-menu-flyout a > span {
  text-transform: none;
}

.shell-menu-flyout a:hover,
.shell-menu-flyout a:focus-visible,
.shell-menu-flyout a.active {
  background: linear-gradient(90deg, var(--primary-nav-from) 0%, var(--primary-nav-to) 100%);
  color: #fff;
}

.table-link-button {
  display: inline-flex;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  text-align: left;
}

.table-link-button:hover,
.table-link-button:focus-visible {
  color: var(--primary-strong);
  text-decoration: none;
}

.user-detail-summary-head {
  justify-content: flex-end;
}

.expense-note-choice-list {
  display: grid;
  gap: 10px;
}

.expense-note-choice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .05);
}

.expense-note-choice-card:hover,
.expense-note-choice-card:focus-visible {
  border-color: var(--primary-tint-13);
  background: var(--primary-tint-1);
}

.expense-note-choice-card span:first-child {
  display: grid;
  gap: 3px;
}

.expense-note-choice-card small {
  color: #64748b;
  font-weight: 700;
}

/* Mobile app UX refresh: overrides kept at the end to avoid changing desktop/MVC behavior. */
.mobile-app-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mobile-app-context {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--primary-tint-9);
  border-radius: 999px;
  background: var(--primary-tint-4);
  padding: 0 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

select.mobile-app-context {
  cursor: pointer;
  appearance: none;
  line-height: 1;
  padding-right: 28px;
  background-color: var(--primary-tint-4);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.mobile-home-count {
  display: grid;
  place-items: center;
  gap: 0;
  text-align: center;
}

.mobile-home-count strong {
  display: block;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.mobile-home-count small {
  display: block;
  color: rgba(255, 255, 255, .78);
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.mobile-profile-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(219, 227, 238, .95);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  padding: 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .06);
}

.mobile-profile-strip > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.mobile-profile-strip span:not(.mobile-user-avatar) {
  color: #64748b;
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
}

.mobile-profile-strip strong,
.mobile-profile-strip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-profile-strip strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
}

.mobile-profile-strip small {
  color: #64748b;
  font-weight: 800;
}

.mobile-app-shell .mobile-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mobile-app-shell .mobile-action-grid .mobile-app-action-card:first-child {
  grid-column: 1 / -1;
}

.mobile-app-action-card {
  align-items: flex-start;
  min-height: 116px;
}

.mobile-app-action-card .mobile-action-copy {
  align-self: stretch;
}

.mobile-app-action-card strong {
  overflow-wrap: normal;
  word-break: normal;
}

.mobile-primary-action {
  width: 100%;
  min-height: 58px;
  border-radius: 20px;
  font-weight: 950;
}

.mobile-app-page-bar .btn span {
  font-size: 19px;
  line-height: 1;
}

.location-panel {
  border: 1px solid var(--primary-tint-9);
}

.location-panel.is-ready {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.location-panel.is-ready span {
  color: #047857;
}

.location-panel.is-needed {
  border-color: #fde68a;
  background: #fffbeb;
}

.location-panel.is-needed span {
  color: #92400e;
}

.mobile-confirm-panel {
  position: fixed;
  right: auto;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 1080;
  width: min(402px, calc(100vw - 24px));
  transform: translateX(-50%);
  border-color: var(--primary-tint-10);
  padding: 18px;
}

.mobile-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-confirm-actions .expense-icon-button {
  width: 100%;
  min-width: 0;
  height: 54px;
}

.mobile-absence .mobile-switch-row {
  justify-content: space-between;
  min-height: 58px;
  border: 1px solid var(--primary-tint-9);
  padding: 13px 14px;
}

.mobile-qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.mobile-qr-actions .expense-icon-button {
  width: 100%;
  height: 54px;
}

@media (max-width: 390px) {
  .mobile-app-shell .mobile-action-grid {
    grid-template-columns: 1fr;
  }

  .mobile-app-shell .mobile-action-grid .mobile-app-action-card:first-child {
    grid-column: auto;
  }

  .mobile-app-nav {
    grid-template-columns: repeat(5, minmax(48px, 1fr));
    overflow-x: auto;
  }
}

/* Mobile app action cards: testi leggibili e area touch stabile. */
body.mobile-kiosk .mobile-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 3vw, 14px);
}

body.mobile-kiosk .mobile-action-grid .mobile-app-action-card:first-child {
  grid-column: 1 / -1;
}

body.mobile-kiosk .mobile-app-action-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  min-width: 0;
  min-height: clamp(118px, 30vw, 136px);
  padding: clamp(14px, 3.8vw, 18px) 42px clamp(14px, 3.8vw, 18px) clamp(14px, 3.8vw, 18px);
  cursor: pointer;
  touch-action: manipulation;
}

body.mobile-kiosk .mobile-app-action-card.is-primary {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: clamp(96px, 24vw, 112px);
  column-gap: 14px;
}

body.mobile-kiosk .mobile-app-action-card:disabled {
  cursor: not-allowed;
  opacity: .58;
}

body.mobile-kiosk .mobile-app-action-card::after {
  position: absolute;
  right: 14px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
}

body.mobile-kiosk .mobile-action-icon {
  flex: none;
  margin-bottom: 12px;
}

body.mobile-kiosk .mobile-app-action-card.is-primary .mobile-action-icon {
  margin-bottom: 0;
}

body.mobile-kiosk .mobile-action-copy {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 5px;
  text-align: left;
}

body.mobile-kiosk .mobile-action-card strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #0f172a;
  font-size: clamp(15px, 4.45vw, 20px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

body.mobile-kiosk .mobile-app-action-card.is-primary strong {
  font-size: clamp(20px, 5.6vw, 25px);
}

body.mobile-kiosk .mobile-action-card small {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #64748b;
  font-size: clamp(11px, 3.15vw, 13px);
  line-height: 1.28;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: normal;
  word-break: normal;
}

body.mobile-kiosk .mobile-app-nav-item {
  cursor: pointer;
  touch-action: manipulation;
}

@media (max-width: 360px) {
  body.mobile-kiosk .mobile-app-action-card {
    min-height: 112px;
    padding-right: 36px;
  }

  body.mobile-kiosk .mobile-action-icon {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    border-radius: 15px;
    font-size: 13px;
  }

  body.mobile-kiosk .mobile-action-card strong {
    font-size: 14px;
  }

  body.mobile-kiosk .mobile-action-card small {
    font-size: 10.8px;
  }
}

/* Trackzyn-inspired mobile app skin. Scoped to mobile-kiosk so desktop remains untouched. */
body.mobile-kiosk {
  --mh-bg: #f8f5fb;
  --mh-bg-soft: #f1ebf7;
  --mh-surface: rgba(255, 255, 255, .96);
  --mh-surface-soft: #fbf8ff;
  --mh-text: #211b2a;
  --mh-muted: #81788e;
  --mh-border: #e8e0ef;
  --mh-primary: #8b5cf6;
  --mh-primary-strong: #6d3edb;
  --mh-primary-soft: #f0e9ff;
  --mh-success: #16a34a;
  --mh-warning: #f59e0b;
  --mh-danger: #dc2626;
  --mh-shadow: 0 20px 46px rgba(35, 26, 54, .12);
  --mh-shadow-soft: 0 14px 32px rgba(35, 26, 54, .08);
  --mh-radius-xl: 30px;
  --mh-radius-lg: 24px;
  --mh-radius-md: 18px;
  --mh-touch: 48px;
  min-height: 100dvh;
  color: var(--mh-text);
  background:
    radial-gradient(circle at 16% -8%, rgba(139, 92, 246, .18), transparent 32%),
    radial-gradient(circle at 100% 0%, rgba(20, 184, 166, .12), transparent 28%),
    linear-gradient(180deg, #fffbff 0%, var(--mh-bg) 42%, #eef2f8 100%);
  font-family: var(--app-font-family);
  -webkit-font-smoothing: antialiased;
}

body.mobile-kiosk .content {
  display: block;
  min-height: 100dvh;
  background: transparent;
}

body.mobile-kiosk .mobile-app-shell {
  width: 100%;
  max-width: min(520px, 100vw);
  padding:
    max(14px, env(safe-area-inset-top))
    clamp(14px, 4vw, 22px)
    calc(112px + env(safe-area-inset-bottom));
}

body.mobile-kiosk .mobile-app-shell .mobile-app-frame,
body.mobile-kiosk .mobile-app-content {
  gap: clamp(14px, 3.8vw, 20px);
}

body.mobile-kiosk .mobile-app-top {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 20;
  min-height: 64px;
  border: 1px solid rgba(232, 224, 239, .92);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  padding: 8px 10px;
  box-shadow: var(--mh-shadow-soft);
  backdrop-filter: blur(18px);
}

body.mobile-kiosk .mobile-app-brand {
  gap: 9px;
}

body.mobile-kiosk .mobile-app-brand img,
body.mobile-kiosk .mobile-user-avatar,
body.mobile-kiosk .mobile-app-avatar {
  border-radius: 18px;
  background: linear-gradient(145deg, #f1ebff, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .12);
}

body.mobile-kiosk .mobile-app-brand img {
  width: 44px;
  height: 44px;
}

body.mobile-kiosk .mobile-app-brand strong {
  color: var(--mh-text);
  font-size: 15px;
  letter-spacing: 0;
}

body.mobile-kiosk .mobile-app-brand span,
body.mobile-kiosk .mobile-profile-strip small,
body.mobile-kiosk .mobile-record-subtitle,
body.mobile-kiosk .field-hint {
  color: var(--mh-muted);
}

body.mobile-kiosk .mobile-app-top-actions {
  gap: 7px;
}

body.mobile-kiosk .mobile-app-context {
  max-width: min(36vw, 150px);
  min-height: 34px;
  border-color: rgba(139, 92, 246, .18);
  background: var(--mh-primary-soft);
  color: var(--mh-primary-strong);
  font-size: 10px;
  letter-spacing: .02em;
}

body.mobile-kiosk select.mobile-app-context {
  background-color: var(--mh-primary-soft);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--mh-primary-strong) 50%),
    linear-gradient(135deg, var(--mh-primary-strong) 50%, transparent 50%);
}

body.mobile-kiosk .mobile-app-avatar {
  width: 38px;
  height: 38px;
  background: var(--mh-primary);
  color: #fff;
  font-size: 13px;
}

body.mobile-kiosk .mobile-home-hero {
  min-height: clamp(146px, 38vw, 182px);
  border: 0;
  border-radius: 34px;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, .24), transparent 24%),
    radial-gradient(circle at 100% 100%, rgba(20, 184, 166, .22), transparent 32%),
    linear-gradient(145deg, #20162f 0%, #4f2fb4 55%, #0f766e 100%);
  padding: clamp(22px, 6vw, 30px);
  box-shadow: 0 28px 58px rgba(39, 24, 76, .26);
}

body.mobile-kiosk .mobile-home-hero .eyebrow {
  color: rgba(255, 255, 255, .82);
  font-size: 10px;
  letter-spacing: .08em;
}

body.mobile-kiosk .mobile-home-hero h2 {
  max-width: 250px;
  margin: 5px 0 8px;
  color: #fff;
  font-size: clamp(34px, 9.8vw, 44px);
  line-height: .98;
  letter-spacing: 0;
  text-wrap: balance;
}

body.mobile-kiosk .mobile-home-hero p {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 850;
}

body.mobile-kiosk .mobile-home-count {
  width: clamp(62px, 17vw, 74px);
  height: clamp(62px, 17vw, 74px);
  border-radius: 26px;
  background: rgba(255, 255, 255, .14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .28),
    0 16px 28px rgba(0, 0, 0, .12);
}

body.mobile-kiosk .mobile-home-count strong {
  font-size: clamp(24px, 6.5vw, 30px);
}

body.mobile-kiosk .mobile-profile-strip,
body.mobile-kiosk .mobile-user-card,
body.mobile-kiosk .mobile-info-strip,
body.mobile-kiosk .mobile-focus-panel,
body.mobile-kiosk .mobile-stamp-form,
body.mobile-kiosk .mobile-list-head,
body.mobile-kiosk .mobile-history-filter,
body.mobile-kiosk .mobile-today-list,
body.mobile-kiosk .mobile-record-summary,
body.mobile-kiosk .mobile-feedback-panel,
body.mobile-kiosk .mobile-install-card {
  border: 1px solid rgba(232, 224, 239, .92);
  border-radius: var(--mh-radius-lg);
  background: var(--mh-surface);
  box-shadow: var(--mh-shadow-soft);
}

body.mobile-kiosk .mobile-profile-strip {
  padding: 15px;
}

body.mobile-kiosk .mobile-profile-strip span:not(.mobile-user-avatar),
body.mobile-kiosk .mobile-field,
body.mobile-kiosk .mobile-section-title .eyebrow,
body.mobile-kiosk .mobile-list-head .eyebrow {
  color: #6f647e;
}

body.mobile-kiosk .mobile-profile-strip strong,
body.mobile-kiosk .mobile-user-card strong,
body.mobile-kiosk .mobile-section-title strong,
body.mobile-kiosk .mobile-list-head h2 {
  color: var(--mh-text);
}

body.mobile-kiosk .mobile-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 3.4vw, 16px);
}

body.mobile-kiosk .mobile-action-grid .mobile-app-action-card:first-child {
  grid-column: 1 / -1;
}

body.mobile-kiosk .mobile-app-action-card,
body.mobile-kiosk .mobile-app-action-card.is-primary {
  padding-right: 16px;
}

.mobile-app-action-card::after,
body.mobile-kiosk .mobile-app-action-card::after {
  display: none;
  content: none;
}

body.mobile-kiosk .mobile-company-switch {
  display: grid;
  flex: 0 1 min(42vw, 154px);
  min-width: 112px;
  gap: 2px;
  border: 1px solid rgba(139, 92, 246, .20);
  border-radius: 18px;
  background: var(--mh-primary-soft);
  padding: 6px 10px;
}

body.mobile-kiosk .mobile-company-switch span {
  overflow: hidden;
  color: var(--mh-muted);
  font-size: 8.5px;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

body.mobile-kiosk .mobile-company-switch select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--mh-primary-strong);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
  outline: 0;
}

body.mobile-kiosk .mobile-history-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body.mobile-kiosk .mobile-history-choice-card {
  display: grid;
  min-width: 0;
  min-height: 104px;
  border: 1px solid rgba(232, 224, 239, .95);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  padding: 12px;
  color: var(--mh-text);
  text-align: left;
  box-shadow: var(--mh-shadow-soft);
}

body.mobile-kiosk .mobile-history-choice-card span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 15px;
  background: #f3effa;
  color: var(--mh-primary-strong);
  font-size: 12px;
  font-weight: 950;
}

body.mobile-kiosk .mobile-history-choice-card strong {
  overflow: hidden;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-kiosk .mobile-history-choice-card small {
  overflow: hidden;
  color: var(--mh-muted);
  font-size: 10.5px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mobile-kiosk .mobile-history-choice-card.is-active {
  border-color: rgba(139, 92, 246, .35);
  background: linear-gradient(145deg, #ffffff 0%, #f3edff 100%);
}

body.mobile-kiosk .mobile-app-action-card {
  min-height: clamp(124px, 31vw, 146px);
  border: 1px solid rgba(232, 224, 239, .95);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .9)),
    var(--mh-surface-soft);
  padding: 16px 42px 16px 16px;
  box-shadow: var(--mh-shadow-soft);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

body.mobile-kiosk .mobile-app-action-card.is-primary {
  min-height: clamp(112px, 27vw, 132px);
  border-color: rgba(139, 92, 246, .28);
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, .16), transparent 28%),
    linear-gradient(145deg, #ffffff 0%, #f3edff 100%);
}

body.mobile-kiosk .mobile-app-action-card:hover,
body.mobile-kiosk .mobile-app-action-card:focus-visible,
body.mobile-kiosk .mobile-mode-card:hover,
body.mobile-kiosk .mobile-mode-card:focus-visible,
body.mobile-kiosk .mobile-app-nav-item:focus-visible,
body.mobile-kiosk .mobile-back-button:focus-visible,
body.mobile-kiosk .mobile-primary-action:focus-visible,
body.mobile-kiosk .mobile-app-shell .btn:focus-visible,
body.mobile-kiosk .mobile-badge .form-control:focus,
body.mobile-kiosk .mobile-badge .form-select:focus {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .18), var(--mh-shadow-soft);
}

body.mobile-kiosk .mobile-app-action-card:active,
body.mobile-kiosk .mobile-mode-card:active,
body.mobile-kiosk .mobile-app-nav-item:active,
body.mobile-kiosk .mobile-primary-action:active {
  transform: translateY(1px) scale(.99);
}

body.mobile-kiosk .mobile-action-icon,
body.mobile-kiosk .mobile-mode-icon {
  width: clamp(48px, 12vw, 58px);
  height: clamp(48px, 12vw, 58px);
  border-radius: 20px;
  background: #f3effa;
  color: var(--mh-primary-strong);
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 950;
}

body.mobile-kiosk .mobile-app-action-card.is-primary .mobile-action-icon,
body.mobile-kiosk .mobile-mode-card.primary .mobile-mode-icon {
  background: linear-gradient(145deg, var(--mh-primary), #13a38e);
  color: #fff;
  box-shadow: 0 16px 30px rgba(139, 92, 246, .22);
}

body.mobile-kiosk .mobile-app-action-card::after {
  right: 13px;
  width: 30px;
  height: 30px;
  background: rgba(139, 92, 246, .10);
  color: var(--mh-primary-strong);
  content: ">";
}

body.mobile-kiosk .mobile-action-card strong {
  color: var(--mh-text);
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 950;
  letter-spacing: 0;
}

body.mobile-kiosk .mobile-app-action-card.is-primary strong {
  font-size: clamp(22px, 6.2vw, 28px);
}

body.mobile-kiosk .mobile-action-card small {
  color: var(--mh-muted);
  font-size: clamp(11.5px, 3.25vw, 13px);
  font-weight: 850;
}

body.mobile-kiosk .mobile-page-bar.mobile-app-page-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 56px;
}

body.mobile-kiosk .mobile-back-button {
  display: grid;
  place-items: center;
  width: var(--mh-touch);
  height: var(--mh-touch);
  padding: 0;
  border: 1px solid var(--mh-border);
  border-radius: 16px;
  background: var(--mh-surface);
  color: var(--mh-primary-strong);
  line-height: 1;
  box-shadow: var(--mh-shadow-soft);
}

body.mobile-kiosk .mobile-back-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

body.mobile-kiosk .mobile-app-page-bar .eyebrow {
  color: var(--mh-muted);
  font-size: 10px;
  letter-spacing: .08em;
}

body.mobile-kiosk .mobile-app-page-bar strong {
  color: var(--mh-text);
  font-size: clamp(20px, 5.4vw, 24px);
}

body.mobile-kiosk .mobile-mode-choice,
body.mobile-kiosk .mobile-stamp-form,
body.mobile-kiosk .mobile-list-head,
body.mobile-kiosk .mobile-history-filter,
body.mobile-kiosk .mobile-today-list {
  padding: clamp(16px, 4.4vw, 22px);
}

body.mobile-kiosk .mobile-mode-choice h2,
body.mobile-kiosk .mobile-list-head h2,
body.mobile-kiosk .mobile-confirm-panel h2 {
  color: var(--mh-text);
  font-size: clamp(24px, 6.8vw, 30px);
  line-height: 1.04;
}

body.mobile-kiosk .mobile-mode-choice p,
body.mobile-kiosk .mobile-list-head p,
body.mobile-kiosk .mobile-confirm-panel p {
  color: var(--mh-muted);
}

body.mobile-kiosk .mobile-mode-card {
  min-height: 94px;
  border: 1px solid var(--mh-border);
  border-radius: 24px;
  background: #fff;
  padding: 15px;
}

body.mobile-kiosk .mobile-mode-card strong {
  color: var(--mh-text);
}

body.mobile-kiosk .mobile-field {
  font-size: 13px;
  font-weight: 900;
}

body.mobile-kiosk .mobile-badge .form-control,
body.mobile-kiosk .mobile-badge .form-select,
body.mobile-kiosk .mobile-badge textarea.form-control {
  min-height: 54px;
  border: 1px solid var(--mh-border);
  border-radius: 18px;
  background: #fff;
  color: var(--mh-text);
  font-size: 16px;
  box-shadow: none;
}

body.mobile-kiosk .mobile-badge textarea.form-control {
  min-height: 104px;
}

body.mobile-kiosk .mobile-switch-row,
body.mobile-kiosk .location-panel {
  border: 1px solid var(--mh-border);
  border-radius: 18px;
  background: #fff;
}

body.mobile-kiosk .mobile-primary-action,
body.mobile-kiosk .mobile-app-shell .btn-primary {
  min-height: 56px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--mh-primary), var(--mh-primary-strong));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 16px 28px rgba(139, 92, 246, .24);
}

body.mobile-kiosk .mobile-app-shell .btn-outline-primary,
body.mobile-kiosk .mobile-app-shell .btn-outline-secondary {
  border-color: var(--mh-border);
  border-radius: 18px;
  background: #fff;
  color: var(--mh-primary-strong);
  font-weight: 900;
}

body.mobile-kiosk .mobile-record-list {
  gap: 12px;
}

body.mobile-kiosk .mobile-record-day {
  display: grid;
  gap: 10px;
}

body.mobile-kiosk .mobile-record-day header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--mh-muted);
  font-weight: 900;
}

body.mobile-kiosk .mobile-record-item {
  border: 1px solid var(--mh-border);
  border-radius: 22px;
  background: #fff;
  padding: 15px;
  box-shadow: 0 10px 22px rgba(35, 26, 54, .06);
}

body.mobile-kiosk .mobile-record-item.is-ok {
  border-color: rgba(22, 163, 74, .16);
  background: linear-gradient(180deg, #ffffff 0%, #f5fff8 100%);
}

body.mobile-kiosk .mobile-record-item.is-missed {
  border-color: rgba(245, 158, 11, .24);
  background: linear-gradient(180deg, #ffffff 0%, #fff9ec 100%);
}

body.mobile-kiosk .mobile-record-time {
  color: var(--mh-text);
  font-size: clamp(22px, 6.2vw, 28px);
  line-height: 1;
}

body.mobile-kiosk .status-pill,
body.mobile-kiosk .chip {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 950;
}

body.mobile-kiosk .status-pill.success,
body.mobile-kiosk .chip.success {
  background: #dcfce7;
  color: #047857;
}

body.mobile-kiosk .status-pill.warning,
body.mobile-kiosk .chip.warning {
  background: #fef3c7;
  color: #b45309;
}

body.mobile-kiosk .mobile-feedback-panel {
  padding: 14px;
}

body.mobile-kiosk .mobile-feedback-icon {
  border-radius: 16px;
}

body.mobile-kiosk .mobile-feedback-panel.is-success {
  border-color: rgba(22, 163, 74, .22);
  background: #f0fdf4;
}

body.mobile-kiosk .mobile-feedback-panel.is-error {
  border-color: rgba(220, 38, 38, .20);
  background: #fff1f2;
}

body.mobile-kiosk .mobile-confirm-panel {
  border: 1px solid rgba(232, 224, 239, .96);
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 70px rgba(35, 26, 54, .24);
  backdrop-filter: blur(18px);
}

body.mobile-kiosk .mobile-app-nav {
  width: min(460px, calc(100vw - 24px));
  border: 1px solid rgba(232, 224, 239, .94);
  border-radius: 30px;
  background: rgba(255, 255, 255, .90);
  padding: 8px;
  box-shadow: 0 24px 54px rgba(35, 26, 54, .18);
  backdrop-filter: blur(18px);
}

body.mobile-kiosk .mobile-app-nav-item {
  min-height: 62px;
  border-radius: 22px;
  color: var(--mh-muted);
}

body.mobile-kiosk .mobile-app-nav-item span {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: #f4effb;
  color: inherit;
}

body.mobile-kiosk .mobile-app-nav-item small {
  font-size: 9.5px;
  font-weight: 950;
}

body.mobile-kiosk .mobile-app-nav-item.is-active {
  background: linear-gradient(145deg, var(--mh-primary), #13a38e);
  color: #fff;
}

body.mobile-kiosk .mobile-app-nav-item.is-active span {
  background: rgba(255, 255, 255, .20);
}

@media (max-width: 430px) {
  body.mobile-kiosk .mobile-app-shell {
    max-width: 100%;
  }

  body.mobile-kiosk .mobile-home-hero h2 {
    max-width: 210px;
  }
}

@media (max-width: 390px) {
  body.mobile-kiosk .mobile-action-grid {
    grid-template-columns: 1fr;
  }

  body.mobile-kiosk .mobile-action-grid .mobile-app-action-card:first-child {
    grid-column: auto;
  }

  body.mobile-kiosk .mobile-app-action-card,
  body.mobile-kiosk .mobile-app-action-card.is-primary {
    min-height: 104px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 13px;
  }

  body.mobile-kiosk .mobile-action-icon {
    margin-bottom: 0;
  }

  body.mobile-kiosk .mobile-app-action-card.is-primary strong,
  body.mobile-kiosk .mobile-action-card strong {
    font-size: clamp(18px, 5.5vw, 22px);
  }

  body.mobile-kiosk .mobile-home-hero {
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  body.mobile-kiosk .mobile-app-shell {
    padding-inline: 10px;
  }

  body.mobile-kiosk .mobile-app-brand span,
  body.mobile-kiosk .mobile-app-context {
    display: none;
  }

  body.mobile-kiosk .mobile-home-hero h2 {
    font-size: 31px;
  }

  body.mobile-kiosk .mobile-app-nav {
    width: calc(100vw - 14px);
    padding: 6px;
  }

  body.mobile-kiosk .mobile-app-nav-item {
    min-height: 56px;
  }

  body.mobile-kiosk .mobile-app-nav-item small {
    font-size: 8px;
  }
}

@media (min-width: 700px) {
  body.mobile-kiosk .mobile-app-shell {
    max-width: 620px;
  }

  body.mobile-kiosk .mobile-app-nav {
    width: min(560px, calc(100vw - 40px));
  }
}

/* Mobile final overrides: niente frecce decorative sulle card e cambio azienda sempre leggibile. */
body.mobile-kiosk .mobile-app-action-card,
body.mobile-kiosk .mobile-app-action-card.is-primary {
  padding-right: 16px;
}

body.mobile-kiosk .mobile-app-action-card::after,
.mobile-app-action-card::after {
  display: none !important;
  content: none !important;
}

body.mobile-kiosk .mobile-app-top-actions {
  min-width: 0;
}

body.mobile-kiosk .mobile-company-switch {
  display: grid;
}

/* Mobile web: allineamento visuale allo stile app MAUI, senza toccare layout desktop. */
body.mobile-kiosk {
  background:
    radial-gradient(circle at 14% -8%, rgba(139, 92, 246, .20), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(15, 118, 110, .14), transparent 30%),
    linear-gradient(180deg, #fffbff 0%, #f6f8fb 44%, #eef3f9 100%);
}

body.mobile-kiosk .mobile-app-shell {
  max-width: min(680px, 100vw);
  padding:
    max(18px, env(safe-area-inset-top))
    clamp(16px, 4vw, 24px)
    calc(116px + env(safe-area-inset-bottom));
}

body.mobile-kiosk .mobile-app-shell .mobile-app-frame,
body.mobile-kiosk .mobile-app-content {
  gap: clamp(16px, 4vw, 22px);
}

body.mobile-kiosk .mobile-app-top {
  min-height: 76px;
  border-radius: 30px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .10);
}

body.mobile-kiosk .mobile-app-brand img {
  width: 52px;
  height: 52px;
  border-radius: 17px;
}

body.mobile-kiosk .mobile-app-brand strong {
  font-size: clamp(16px, 4.2vw, 19px);
  font-weight: 950;
}

body.mobile-kiosk .mobile-app-brand span {
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 850;
}

body.mobile-kiosk .mobile-app-avatar {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  background: linear-gradient(145deg, #8b5cf6, #6d3edb);
  font-size: 15px;
}

body.mobile-kiosk .mobile-home-hero {
  min-height: clamp(158px, 34vw, 210px);
  border-radius: 34px;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, .24), transparent 24%),
    radial-gradient(circle at 96% 100%, rgba(20, 184, 166, .24), transparent 34%),
    linear-gradient(145deg, #111827 0%, #5b35dc 56%, #0f766e 100%);
  padding: clamp(24px, 6vw, 34px);
  box-shadow: 0 28px 62px rgba(39, 24, 76, .24);
}

body.mobile-kiosk .mobile-home-hero h2 {
  max-width: 285px;
  font-size: clamp(38px, 10vw, 58px);
  line-height: .95;
}

body.mobile-kiosk .mobile-home-count {
  border-radius: 27px;
  background: rgba(255, 255, 255, .16);
}

body.mobile-kiosk .mobile-profile-strip,
body.mobile-kiosk .mobile-user-card,
body.mobile-kiosk .mobile-info-strip,
body.mobile-kiosk .mobile-focus-panel,
body.mobile-kiosk .mobile-stamp-form,
body.mobile-kiosk .mobile-list-head,
body.mobile-kiosk .mobile-history-filter,
body.mobile-kiosk .mobile-today-list,
body.mobile-kiosk .mobile-record-summary,
body.mobile-kiosk .mobile-feedback-panel,
body.mobile-kiosk .mobile-install-card {
  border-radius: 28px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

body.mobile-kiosk .mobile-action-grid {
  gap: clamp(14px, 3.8vw, 18px);
}

body.mobile-kiosk .mobile-app-action-card,
body.mobile-kiosk .mobile-app-action-card.is-primary {
  min-height: clamp(128px, 31vw, 152px);
  border-radius: 30px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(255, 255, 255, .92)),
    #fbf8ff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .08);
}

body.mobile-kiosk .mobile-app-action-card.is-primary {
  min-height: clamp(118px, 28vw, 142px);
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, .16), transparent 30%),
    linear-gradient(145deg, #ffffff 0%, #f2ecff 100%);
}

body.mobile-kiosk .mobile-action-icon,
body.mobile-kiosk .mobile-mode-icon {
  border-radius: 20px;
  background: #f3effa;
}

body.mobile-kiosk .mobile-app-action-card.is-primary .mobile-action-icon,
body.mobile-kiosk .mobile-mode-card.primary .mobile-mode-icon {
  background: linear-gradient(145deg, var(--primary), #0f766e);
}

body.mobile-kiosk .mobile-action-card strong {
  font-size: clamp(18px, 4.9vw, 22px);
  line-height: 1.08;
}

body.mobile-kiosk .mobile-action-card small {
  font-size: clamp(12px, 3.35vw, 13.5px);
  line-height: 1.35;
}

body.mobile-kiosk .mobile-app-nav {
  width: min(500px, calc(100vw - 24px));
  border-radius: 30px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 54px rgba(15, 23, 42, .16);
}

body.mobile-kiosk .mobile-app-nav-item {
  min-height: 64px;
  border-radius: 23px;
}

body.mobile-kiosk .mobile-app-nav-item.is-active {
  background: linear-gradient(145deg, var(--primary), #0f766e);
}

body.mobile-kiosk .mobile-badge .form-control,
body.mobile-kiosk .mobile-badge .form-select,
body.mobile-kiosk .mobile-badge textarea.form-control {
  border-radius: 18px;
  background: #ffffff;
}

@media (max-width: 390px) {
  body.mobile-kiosk .mobile-app-action-card,
  body.mobile-kiosk .mobile-app-action-card.is-primary {
    min-height: 108px;
  }

  body.mobile-kiosk .mobile-action-grid {
    grid-template-columns: 1fr;
  }
}

#components-reconnect-modal.blazor-reconnect-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .36);
  backdrop-filter: blur(6px);
}

#components-reconnect-modal.components-reconnect-hide {
  display: none;
}

.blazor-reconnect-card {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.blazor-reconnect-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-tint-7);
  color: var(--primary);
  font-weight: 900;
  font-size: 22px;
}

#components-reconnect-modal.components-reconnect-failed .blazor-reconnect-icon,
#components-reconnect-modal.components-reconnect-rejected .blazor-reconnect-icon {
  background: #fff1f2;
  color: #dc2626;
}

.blazor-reconnect-title,
.blazor-reconnect-message {
  display: none;
}

#components-reconnect-modal.components-reconnect-show .blazor-reconnect-title-show,
#components-reconnect-modal.components-reconnect-failed .blazor-reconnect-title-failed,
#components-reconnect-modal.components-reconnect-rejected .blazor-reconnect-title-rejected {
  display: block;
}

#components-reconnect-modal.components-reconnect-show .blazor-reconnect-message-show,
#components-reconnect-modal.components-reconnect-failed .blazor-reconnect-message-failed,
#components-reconnect-modal.components-reconnect-rejected .blazor-reconnect-message-rejected {
  display: block;
}

.blazor-reconnect-copy strong {
  color: #0f172a;
  font-size: 1.25rem;
}

.blazor-reconnect-copy p {
  margin: 8px 0 18px;
  color: #64748b;
}

.blazor-reconnect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.blazor-reconnect-action-login {
  display: none;
}

#components-reconnect-modal.components-reconnect-failed .blazor-reconnect-action-login,
#components-reconnect-modal.components-reconnect-rejected .blazor-reconnect-action-login {
  display: inline-flex;
}

.blazor-runtime-error {
  min-height: min(460px, 72vh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.blazor-runtime-error-card {
  width: min(640px, 100%);
  padding: 28px;
  border: 1px solid #fecdd3;
  border-radius: 20px;
  background: #fff7f8;
  box-shadow: 0 24px 60px rgba(190, 18, 60, .12);
}

.blazor-runtime-error-card h2 {
  margin: 4px 0 8px;
  color: #9f1239;
}

.blazor-runtime-error-card p {
  margin: 0 0 18px;
  color: #64748b;
}

.blazor-runtime-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.absences-page {
  display: block;
}

.absences-head {
  align-items: center;
}

.absences-planning {
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.absences-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
}

.absences-table:has(thead th:nth-child(5)) {
  /* niente larghezza minima forzata: la tabella si dimensiona sul contenuto
     (width:max-content nella regola generale) e scrolla in .absences-table-wrap */
  min-width: 0;
}

.absences-table .absence-main-cell strong,
.absences-table .absence-main-cell span {
  display: block;
}

.absences-table .absence-main-cell span {
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
}

.absences-table .absence-notes-cell {
  max-width: 300px;
  white-space: normal;
}

.absences-table .absence-status {
  display: inline-flex;
}

.absences-table .absences-row-actions {
  min-width: 190px;
}

.actions-column {
  width: 1%;
  min-width: 190px;
  white-space: nowrap;
  text-align: right;
}

.actions-column .btn {
  margin-left: 8px;
}

.absences-page .expense-icon-button {
  flex: 0 0 34px;
}

/* Pagina Approvazioni (WorkflowApprovalsBlazor): stesso pattern di .absences-*, classi proprie del modulo.
   Il layout standard e la barra accent della superficie arrivano dalle liste del layout standard (vedi .expense-note-list-surface). */
.workflow-approvals-surface {
  display: block;
}

.workflow-approvals-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
}

.workflow-approvals-table:has(thead th:nth-child(5)) {
  min-width: 0;
}

.workflow-approvals-table .status-pill {
  display: inline-flex;
  margin-left: 8px;
}

.workflow-approvals-table .workflow-approvals-due-badge {
  margin-left: 0;
}

/* Pagina Chiusura aziendale (AbsencesCompanyClosureBlazor): stesso pattern di .workflow-approvals-*, classi proprie del modulo.
   Il layout standard e la barra accent della superficie arrivano dalle liste del layout standard (vedi .expense-note-list-surface). */
.company-closure-surface {
  display: block;
}

.compact-management-table.data-table.company-closure-employees-table { min-width: 560px; }
.compact-management-table.data-table.company-closure-batches-table { min-width: 720px; }

.absence-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3152c9;
  font-weight: 800;
  font-size: .78rem;
}

.absence-status.is-approved {
  background: #dcfce7;
  color: #15803d;
}

.absence-status.is-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.absence-status.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.absence-scheduler {
  min-height: 680px;
}

.legend-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.legend-filter-title {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.legend-filter-options {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.legend-filter-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
}

.legend-filter-option span:not(.legend-filter-marker) {
  color: inherit;
}

.legend-filter-option:hover,
.legend-filter-option:focus-visible {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.legend-filter-option.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 .16rem rgba(37, 99, 235, .12);
}

.legend-filter-option.is-all {
  color: #334155;
}

.legend-filter-option.is-draft {
  background: #eef2ff;
  color: #3152c9;
}

.legend-filter-option.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.legend-filter-option.is-approved {
  background: #dcfce7;
  color: #15803d;
}

.legend-filter-option.is-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.legend-filter-option.is-ok {
  background: #dcfce7;
  color: #047857;
}

.legend-filter-option.is-problem {
  background: #fee2e2;
  color: #b91c1c;
}

.legend-filter-option.is-missed {
  background: #fef3c7;
  color: #92400e;
}

.legend-filter-option.is-planned {
  background: #eff6ff;
  color: #1d4ed8;
}

.legend-filter-option.is-missed-value {
  background: #fff7ed;
  color: #c2410c;
}

.legend-filter-option.is-draft:not(.is-active),
.legend-filter-option.is-pending:not(.is-active),
.legend-filter-option.is-approved:not(.is-active),
.legend-filter-option.is-rejected:not(.is-active),
.legend-filter-option.is-ok:not(.is-active),
.legend-filter-option.is-problem:not(.is-active),
.legend-filter-option.is-missed:not(.is-active),
.legend-filter-option.is-planned:not(.is-active),
.legend-filter-option.is-missed-value:not(.is-active) {
  border-color: transparent;
}

.legend-filter-marker {
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: #94a3b8;
}

.legend-filter-marker.is-absence,
.agenda-item-marker.is-absence,
.legend-filter-marker.is-absence-approved,
.agenda-item-marker.is-absence-approved {
  background: #dc2626;
}

/* "Visualizza tutti": tre stanghette separate (rosso Assenze + verde Modalita' lavoro + viola
   Malattia), affiancate in orizzontale una di fianco all'altra come le altre opzioni, non impilate
   e non fuse in un gradiente sfumato. Un solo elemento non puo' avere 3 pseudo-elementi (solo
   ::before/::after): niente sfumatura, uno sfondo con "stop" netti simula 3 barre distinte + 2
   spazi trasparenti in mezzo, stessa larghezza/spaziatura delle altre stanghette del menu. */
.legend-filter-marker.is-all-types {
  width: 18px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    #dc2626 0px 4px,
    transparent 4px 7px,
    #16a34a 7px 11px,
    transparent 11px 14px,
    #7c3aed 14px 18px
  );
}

.agenda-item-marker.is-absence-pending {
  background: #dc2626;
}

.legend-filter-marker.is-sickness,
.agenda-item-marker.is-sickness,
.legend-filter-marker.is-sickness-approved,
.agenda-item-marker.is-sickness-approved {
  background: #7c3aed;
}

.agenda-item-marker.is-sickness-pending {
  background: #c4b5fd;
}

.legend-filter-marker.is-smart-working,
.agenda-item-marker.is-smart-working,
.legend-filter-marker.is-smart-working-approved,
.agenda-item-marker.is-smart-working-approved {
  background: #16a34a;
}

.agenda-item-marker.is-smart-working-pending {
  background: #16a34a;
}

/* Festivita': ambra chiaro, distinta dai tre tipi di assenza (rosso, verde, viola: pieni e scuri). */
.legend-filter-marker.is-holiday,
.agenda-item-marker.is-holiday {
  background: #f59e0b;
}

.agenda-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: var(--primary-tint-1);
  overflow: hidden;
}

.agenda-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #dbe7f5;
}

.agenda-panel-head h3 {
  margin: 0;
  font-size: 1rem;
}

.agenda-panel-head div {
  display: grid;
  gap: 3px;
}

.agenda-panel-head span {
  color: #64748b;
  font-size: .78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.agenda-panel-head > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-tint-8);
  color: var(--primary);
  font-size: .82rem;
  font-weight: 900;
}

.agenda-panel-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow-y: auto;
}

.agenda-list-item {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
}

.agenda-list-item.is-sickness,
.agenda-list-item.is-sickness-approved,
.agenda-list-item.is-sickness-pending {
  border-color: #ddd6fe;
  background: #faf5ff;
}

.agenda-list-item.is-holiday {
  border-color: #fde68a;
  background: #fffbeb;
}

.agenda-list-item.is-clickable {
  cursor: pointer;
}

.agenda-list-item.is-clickable:hover {
  border-color: var(--primary-tint-13);
}

.agenda-list-item.is-selected {
  border-color: var(--primary);
  background: var(--primary-tint-4);
  box-shadow: 0 0 0 1px var(--primary);
}

.agenda-item-marker {
  align-self: stretch;
  border-radius: 999px;
  background: #94a3b8;
}

.agenda-item-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agenda-item-main strong,
.agenda-item-main small,
.agenda-item-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.agenda-item-main strong {
  color: #0f172a;
  font-size: .9rem;
  line-height: 1.2;
}

.agenda-item-main small {
  color: #475569;
  font-size: .8rem;
  font-weight: 700;
}

.agenda-item-meta {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agenda-item-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3152c9;
  font-size: .72rem;
  font-weight: 900;
  white-space: nowrap;
}

.agenda-item-status.is-approved {
  background: #dcfce7;
  color: #15803d;
}

.agenda-item-status.is-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.agenda-item-status.is-pending {
  background: #fef3c7;
  color: #92400e;
}

.agenda-panel-empty {
  display: grid;
  gap: 4px;
  padding: 18px 14px;
  color: #64748b;
}

.agenda-panel-empty strong {
  color: #334155;
}

.planning-calendar-shell {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

/* Vista Giorno senza eventi: colonna del giorno senza fasce orarie (intestazione + corpo vuoto). */
.planning-day-empty {
  width: 100%;
  min-width: 0;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.planning-day-empty-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #dbe7f5;
  background: var(--primary-tint-1);
}

.planning-day-empty-weekday {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-transform: capitalize;
}

.planning-day-empty-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.planning-day-empty-body {
  min-height: 160px;
  padding: 16px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.planning-month-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
}

.planning-month-toolbar .planning-month-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-size: .86rem;
  font-weight: 850;
  cursor: pointer;
}

.planning-month-toolbar .planning-month-nav-button:hover,
.planning-month-toolbar .planning-month-nav-button:focus-visible {
  background: var(--primary-tint-8);
  color: var(--primary-strong);
}

.planning-month-toolbar .planning-month-nav-button {
  font-size: 1.35rem;
  line-height: 1;
}

.planning-month-toolbar strong {
  min-width: 132px;
  color: #0f172a;
  font-size: .95rem;
  font-weight: 900;
  text-align: center;
  text-transform: capitalize;
}

.planning-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.planning-view-button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: .78rem;
  font-weight: 850;
}

.planning-view-button:hover,
.planning-view-button:focus-visible,
.planning-view-button.is-active {
  background: var(--primary-tint-4);
  color: var(--primary-strong);
}

/* Reset dello stile nativo browser per <button>: deve apparire identico al vecchio <span>
   (nessun bordo/sfondo/font diverso), ereditando comunque tutto lo stile DevExpress applicato a
   .dxbl-date-cell-head. */
.planning-day-number-clickable {
  cursor: pointer;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
}

.planning-scheduler-appointment {
  display: block;
  box-sizing: border-box;
  width: 100%;
  /* Riempie tutta l'altezza dello slot nativo DevExpress, che nelle viste Giorno/Settimana e'
     proporzionale alla durata reale dell'evento (es. 4.5 ore): senza questo, lo sfondo colorato
     copriva solo l'altezza del testo (una riga) invece dell'intera fascia oraria. */
  height: 100%;
  min-width: 0;
  padding: 2px 8px 2px 10px;
  border-radius: 4px;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* Solo i blocchi con orario nella griglia (Giorno/Settimana, altezza proporzionale alla durata):
   piu' spazio verticale disponibile, quindi font piu' leggibile e testo che va a capo invece di
   troncare con "...". La riga "giornata intera" e la vista Mese restano invariate (poco spazio). */
.planning-scheduler-appointment-vertical {
  padding: 6px 10px;
  font-size: .92rem;
  line-height: 1.3;
  white-space: normal;
}

/* Evidenziazione sincronizzata con la selezione nella lista "Agenda pianificazione" (o viceversa):
   box-shadow esterno invece di bordo/background per non confliggere con i colori !important dei
   tipi evento qui sotto (assenza/malattia/modalita' lavoro, pieno o "in approvazione"). */
.planning-scheduler-appointment.is-selected-planning-appointment {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
}

.is-planning-absence,
.planning-scheduler-appointment.is-planning-absence {
  background: #dc2626 !important;
}

.is-planning-smart-working,
.planning-scheduler-appointment.is-planning-smart-working {
  background: #16a34a !important;
}

.is-planning-sickness,
.planning-scheduler-appointment.is-planning-sickness {
  background: #7c3aed !important;
}

/* Festivita': sfondo ambra chiaro con testo scuro e filo a sinistra, cosi' non si confonde con i blocchi
   pieni di assenze (rosso), modalita' lavoro (verde) e malattia (viola). */
.is-planning-holiday,
.planning-scheduler-appointment.is-planning-holiday {
  background: #fde68a !important;
  border-left: 4px solid #d97706;
}

.is-planning-holiday.is-planning-appointment-text,
.is-planning-holiday .is-planning-appointment-text {
  color: #78350f !important;
}

/* Varianti "in approvazione" assenze/modalita' lavoro: sfondo bianco, bordino e testo nel colore
   del tipo - stesso rosso/verde gia' usato per lo stato approvato (nessun colore nuovo inventato),
   cosi' il colore resta lo stesso in ogni stato e cambia solo il riempimento (pieno = approvato,
   bianco con bordo = in approvazione). Richiesto esplicitamente per distinguere a colpo d'occhio gli
   eventi ancora da approvare. Malattia in approvazione non e' toccata (non richiesta). */
.is-planning-absence-pending,
.planning-scheduler-appointment.is-planning-absence-pending {
  background: #ffffff !important;
  border: 2px solid #dc2626;
}

.is-planning-smart-working-pending,
.planning-scheduler-appointment.is-planning-smart-working-pending {
  background: #ffffff !important;
  border: 2px solid #16a34a;
}

.is-planning-sickness-pending,
.planning-scheduler-appointment.is-planning-sickness-pending {
  background: #c4b5fd !important;
}

.is-planning-absence-pending.is-planning-appointment-text,
.is-planning-absence-pending .is-planning-appointment-text {
  color: #dc2626 !important;
}

.is-planning-smart-working-pending.is-planning-appointment-text,
.is-planning-smart-working-pending .is-planning-appointment-text {
  color: #16a34a !important;
}

.is-planning-sickness-pending.is-planning-appointment-text,
.is-planning-sickness-pending .is-planning-appointment-text {
  color: #5b21b6 !important;
}

.is-planning-appointment-text {
  color: #fff !important;
  font-weight: 800;
}

.planning-scheduler-appointment.is-planning-appointment-planned {
  background: #64748b !important;
  border-left: 4px solid #94a3b8;
}

.planning-scheduler-appointment.is-planning-appointment-confirmed {
  background: var(--primary) !important;
  border-left: 4px solid #3b82f6;
}

.planning-scheduler-appointment.is-planning-appointment-completed {
  background: #059669 !important;
  border-left: 4px solid #10b981;
}

.planning-scheduler-appointment.is-planning-appointment-cancelled {
  background: #dc2626 !important;
  border-left: 4px solid #ef4444;
}

.agenda-item-marker.is-planning-appointment-confirmed {
  background: var(--primary);
}

.agenda-item-marker.is-planning-appointment-completed {
  background: #059669;
}

.agenda-item-marker.is-planning-appointment-cancelled {
  background: #dc2626;
}

.calendar-connect-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.calendar-connect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
}

.calendar-connect-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-connect-email {
  font-size: 12px;
  color: #64748b;
}

.calendar-connect-meta {
  font-size: 12px;
  color: #64748b;
}

.attendee-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  max-height: 160px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
}

.attendee-external-add {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.attendee-external-add .form-control {
  flex: 1 1 160px;
}

.attendee-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.chip-remove:hover {
  background: rgba(0, 0, 0, 0.08);
}

.ticket-reply-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  margin-bottom: 10px;
}

.ticket-reply-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f5f7fa;
}

.ticket-reply-item.internal-note {
  background: #fff4e5;
  border: 1px dashed #e0a94c;
}

.ticket-chat-row {
  display: flex;
  width: 100%;
}

.ticket-chat-row.mine {
  justify-content: flex-end;
}

.ticket-chat-row.theirs {
  justify-content: flex-start;
}

.ticket-chat-row.system {
  justify-content: center;
}

.ticket-chat-bubble {
  max-width: 78%;
  border-radius: 14px;
}

.ticket-chat-row.mine .ticket-chat-bubble {
  background: var(--primary-soft);
  border-bottom-right-radius: 4px;
}

.ticket-chat-row.theirs .ticket-chat-bubble {
  border-bottom-left-radius: 4px;
}

.ticket-chat-row.mine .ticket-chat-bubble .ticket-reply-meta {
  flex-direction: row-reverse;
}

.ticket-chat-row.system .ticket-chat-bubble {
  max-width: 90%;
  border-radius: 10px;
}

.ticket-reply-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #667085;
  margin-bottom: 4px;
}

.ticket-reply-body {
  white-space: pre-wrap;
  font-size: 14px;
}

.ticket-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-time-entry-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ticket-time-entry-form > select,
.ticket-time-entry-form > input[type="date"],
.ticket-time-entry-form > input[type="number"] {
  width: auto;
  min-width: 130px;
}

.ticket-time-entry-form > input[type="text"] {
  flex: 1 1 160px;
  min-width: 140px;
}

.ticket-time-entry-total {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: #667085;
}

.ticket-time-entry-empty {
  display: block;
  color: #667085;
}

.ticket-activity-new-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.ticket-activity-new-form > input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.ticket-activity-card {
  border: 1px solid #e5edf7;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.ticket-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.appointments-planning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 18px;
}

.appointments-scheduler {
  min-height: 680px;
}

@media (max-width: 900px) {
  .appointments-planning-grid {
    grid-template-columns: 1fr;
  }

  .appointments-scheduler {
    min-height: 560px;
  }
}

.absences-planning-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
  flex-wrap: wrap;
}

.absences-planning-filter-group {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.absences-planning-add-button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.absences-planning-action-group {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.absences-new-request-chooser {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 8;
  display: flex;
  gap: 6px;
  min-width: max-content;
  padding: 6px;
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .10);
}

.absences-new-request-option {
  justify-content: flex-start;
  width: auto;
  min-height: 32px;
  border-color: #dbe3ee;
  background: #fff;
  color: #334155;
  font-size: .82rem;
  font-weight: 850;
  padding-inline: 12px;
  border-radius: 999px;
}

.absences-new-request-option:hover,
.absences-new-request-option:focus-visible {
  border-color: var(--primary-tint-13);
  background: var(--primary-tint-4);
  color: var(--primary-strong);
}

.absences-new-request-option.is-smart-working {
  color: #0f766e;
}

.absences-new-request-option.is-sickness {
  color: #6d28d9;
}

.absences-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.absences-legend-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.absences-legend-title {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.absences-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: .86rem;
  font-weight: 800;
}

.absences-legend-dot {
  width: 18px;
  height: 12px;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 4px 0 #dbe7f5;
}

.absences-legend-dot.is-absence {
  border-color: #dbe7f5;
  background: #fff;
  box-shadow: inset 4px 0 #dbe7f5;
}

.absences-legend-dot.is-smart-working {
  border-color: #5eead4;
  background: #f0fdfa;
  box-shadow: inset 4px 0 #14b8a6;
}

.absences-planning-filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.absences-planning-filters label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.absences-planning-filters .form-select {
  min-width: 170px;
  min-height: 38px;
  border-color: #dbe3ee;
  border-radius: 999px;
  background-color: #fff;
  color: #334155;
  text-transform: none;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 34px 5px 12px;
}

.absences-planning-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.planning-mini-calendar {
  width: 100%;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

/* !important necessario: la regola DevExpress ".dxbl-calendar div.dxbl-calendar-footer" ha
   specificita' leggermente superiore (elemento "div" in piu') e non c'e' un hook ufficiale
   (parametro o ::part) per nascondere il footer del componente. L'header invece resta visibile:
   e' l'unico punto rimasto per navigare mese/anno nel mini-calendario e per saltare direttamente
   a un mese/anno lontano cliccando sul testo del periodo. */
.planning-mini-calendar .dxbl-calendar-footer {
  display: none !important;
}

.planning-side-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.planning-side-column .agenda-panel {
  flex: 1;
  min-height: 0;
}

.absences-modal .absences-dialog {
  max-height: calc(100dvh - 40px);
  overflow: hidden;
}

.absences-modal .editor-body {
  overflow-y: auto;
}

.absences-modal .surface-head {
  align-items: flex-start;
}

.absences-form-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: start;
}

.absences-form-grid .form-field {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.absences-form-grid .form-field > span,
.absences-form-grid .standard-date-input > label {
  color: #334155;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.absences-form-grid .form-control,
.absences-form-grid .form-select,
.absences-form-grid .standard-date-edit.dxbl-text-edit,
.absences-form-grid .blazor-combo-box.dxbl-text-edit,
.absences-day-table .form-control,
.absences-day-table .form-select,
.absences-day-table .standard-date-edit.dxbl-text-edit,
.absences-day-table .blazor-combo-box.dxbl-text-edit {
  border-color: #dbe3ee;
  border-radius: 10px;
  background-color: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  min-height: 38px;
}

.absences-form-grid .standard-date-edit.dxbl-text-edit,
.absences-form-grid .blazor-combo-box.dxbl-text-edit,
.absences-day-table .standard-date-edit.dxbl-text-edit,
.absences-day-table .blazor-combo-box.dxbl-text-edit {
  padding: 0;
  overflow: hidden;
  box-shadow: none;
}

.absences-form-grid .standard-date-edit.dxbl-text-edit input,
.absences-form-grid .blazor-combo-box.dxbl-text-edit input,
.absences-day-table .standard-date-edit.dxbl-text-edit input,
.absences-day-table .blazor-combo-box.dxbl-text-edit input {
  min-height: 36px;
  padding: 5px 10px 5px 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
}

.absences-form-grid .standard-date-edit.dxbl-text-edit input::placeholder,
.absences-form-grid .blazor-combo-box.dxbl-text-edit input::placeholder,
.absences-day-table .standard-date-edit.dxbl-text-edit input::placeholder,
.absences-day-table .blazor-combo-box.dxbl-text-edit input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.absences-form-grid .standard-date-edit.dxbl-text-edit button,
.absences-form-grid .standard-date-edit.dxbl-text-edit .dxbl-btn,
.absences-form-grid .blazor-combo-box.dxbl-text-edit button,
.absences-form-grid .blazor-combo-box.dxbl-text-edit .dxbl-btn,
.absences-day-table .standard-date-edit.dxbl-text-edit button,
.absences-day-table .standard-date-edit.dxbl-text-edit .dxbl-btn,
.absences-day-table .blazor-combo-box.dxbl-text-edit button,
.absences-day-table .blazor-combo-box.dxbl-text-edit .dxbl-btn {
  min-width: 34px;
  border: 0;
  background: transparent;
  color: #64748b;
}

.absences-form-grid .standard-date-edit.dxbl-text-edit button:hover,
.absences-form-grid .standard-date-edit.dxbl-text-edit .dxbl-btn:hover,
.absences-form-grid .blazor-combo-box.dxbl-text-edit button:hover,
.absences-form-grid .blazor-combo-box.dxbl-text-edit .dxbl-btn:hover,
.absences-day-table .standard-date-edit.dxbl-text-edit button:hover,
.absences-day-table .standard-date-edit.dxbl-text-edit .dxbl-btn:hover,
.absences-day-table .blazor-combo-box.dxbl-text-edit button:hover,
.absences-day-table .blazor-combo-box.dxbl-text-edit .dxbl-btn:hover {
  background: var(--primary-tint-1);
  color: var(--primary);
}

.absences-form-grid .form-control:focus,
.absences-form-grid .form-select:focus,
.absences-form-grid .standard-date-edit.dxbl-text-edit:focus-within,
.absences-form-grid .blazor-combo-box.dxbl-text-edit:focus-within,
.absences-day-table .form-control:focus,
.absences-day-table .form-select:focus,
.absences-day-table .standard-date-edit.dxbl-text-edit:focus-within,
.absences-day-table .blazor-combo-box.dxbl-text-edit:focus-within,
.absences-planning-filters .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .14);
}

.absences-form-grid .form-control:disabled,
.absences-form-grid .form-control[readonly],
.absences-form-grid .form-select:disabled,
.absences-form-grid .standard-date-edit.dxbl-text-edit.dxbl-disabled,
.absences-form-grid .standard-date-edit.dxbl-text-edit.dxbl-readonly,
.absences-form-grid .blazor-combo-box.dxbl-text-edit.dxbl-disabled,
.absences-form-grid .blazor-combo-box.dxbl-text-edit.dxbl-readonly,
.absences-day-table .form-control:disabled,
.absences-day-table .form-control[readonly],
.absences-day-table .form-select:disabled,
.absences-day-table .standard-date-edit.dxbl-text-edit.dxbl-disabled,
.absences-day-table .standard-date-edit.dxbl-text-edit.dxbl-readonly,
.absences-day-table .blazor-combo-box.dxbl-text-edit.dxbl-disabled,
.absences-day-table .blazor-combo-box.dxbl-text-edit.dxbl-readonly {
  background-color: transparent !important;
  color: #334155 !important;
  font-weight: 400;
  opacity: 1;
  -webkit-text-fill-color: #334155;
}

.absences-form-grid textarea.form-control {
  min-height: 92px;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.absences-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: var(--primary-tint-1);
  font-weight: 800;
}

.absences-day-plan {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.absences-day-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.absences-day-plan-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.absences-day-plan-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: .9rem;
  font-weight: 600;
}

.absences-day-plan-head > span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-tint-8);
  color: var(--primary);
  font-weight: 900;
  white-space: nowrap;
}

.absences-day-empty {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  font-weight: 800;
}

.absences-overlap-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
}

.absences-overlap-card strong,
.absences-overlap-card span {
  display: block;
}

.absences-overlap-card strong {
  margin-bottom: 4px;
  color: #7c2d12;
  font-size: .95rem;
  font-weight: 900;
}

.absences-overlap-card span {
  font-size: .9rem;
  font-weight: 700;
}

.absences-overlap-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 10px;
}

.absences-day-table-wrap .table-responsive {
  max-height: min(46vh, 460px);
  overflow: auto;
  overscroll-behavior: contain;
}

.absences-day-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
  border-collapse: collapse;
}

.absences-day-col-date {
  width: 160px;
}

.absences-day-col-standard {
  width: 140px;
}

.absences-day-col-kind {
  width: 230px;
}

.absences-day-col-defined-time {
  width: 320px;
}

.absences-day-col-actions {
  width: 110px;
}

.absences-day-table th,
.absences-day-table td {
  padding: 9px 10px;
  border-bottom: 0;
  vertical-align: middle;
}

.absences-day-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  color: var(--st-text-soft, #5f6f84);
  font-size: 12px;
  font-weight: 600;
}

.absences-day-table tbody tr > td {
  border-top: 0;
  border-bottom: 1px solid #e8eef7;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
}

.absences-day-table tbody tr:hover > td {
  border-color: var(--primary-tint-9);
  background: var(--primary-tint-3);
}

.absences-day-table tbody tr > td:first-child {
  box-shadow: inset 3px 0 #dbe3ee;
}

.absences-day-table td:first-child {
  min-width: 160px;
}

.absences-day-table .form-control,
.absences-day-table .blazor-combo-box {
  width: 100%;
  max-width: 100%;
}

.absences-day-table td:first-child strong,
.absences-day-table td:first-child span,
.absences-day-table td:first-child em {
  display: block;
}

.absences-day-table td:first-child span,
.absences-day-table td:first-child em,
.absences-day-muted {
  color: #64748b;
  font-size: .82rem;
  font-style: normal;
  font-weight: 700;
}

.absences-day-table tr.is-disabled td {
  border-color: #fecdd3;
  background: #fff1f2 !important;
  color: #991b1b;
}

.absences-day-table tr.is-disabled .absences-day-muted {
  color: #b91c1c;
}

.absences-day-table tr.is-excluded td {
  border-color: #e2e8f0;
  background: #f8fafc !important;
  color: #64748b;
}

.absences-day-table tr.is-excluded .absences-day-muted {
  color: #94a3b8;
}

.absences-day-table tr.is-partial td:first-child {
  border-left-color: #fde7bd;
  box-shadow: inset 4px 0 #f59e0b;
}

.absences-day-table tr.is-full-day td:first-child {
  border-left-color: var(--primary-tint-10);
  box-shadow: inset 4px 0 var(--primary);
}

.absences-day-table tr.is-excluded td:first-child,
.absences-day-table tr.is-disabled td:first-child {
  border-left-color: #e2e8f0;
  box-shadow: inset 4px 0 #cbd5e1;
}

.absences-day-table tr.is-disabled td:first-child {
  border-left-color: #fecdd3;
  box-shadow: inset 4px 0 #ef4444;
}

.absences-day-row-actions {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.absences-day-table .actions-column {
  min-width: 0;
}

.absences-defined-time {
  display: grid;
  grid-template-columns: minmax(78px, 92px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.absences-defined-time .absences-day-muted {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
}

.absences-hours-input {
  text-align: right;
}

.absences-modal-close {
  font-size: 1.15rem;
  line-height: 1;
}

.absences-time-range {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.absences-time-range-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.absences-time-range .form-control {
  min-width: 0;
}

.absences-add-range-button {
  justify-content: center;
  width: 100%;
}

@media (max-width: 760px) {
  .absences-defined-time {
    grid-template-columns: 1fr;
  }

  .absences-time-range-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
}

.absences-modal-footer {
  margin-top: 18px;
  padding: 16px 0 0;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 900px) {
  .absences-table-wrap {
    overflow-x: auto;
  }

  .absences-table {
    min-width: 1280px;
  }

  .absence-scheduler {
    min-height: 560px;
  }

  .absences-planning-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .absences-head {
    align-items: stretch;
  }

  .absences-planning-toolbar {
    align-items: stretch;
  }

  .absences-planning-filter-group,
  .absences-planning-action-group,
  .absences-planning-add-button {
    width: 100%;
  }

  .absences-planning-action-group {
    justify-content: stretch;
  }

  .absences-new-request-chooser {
    display: grid;
    left: 0;
    right: 0;
    min-width: 0;
  }

  .absences-new-request-option {
    width: 100%;
    justify-content: center;
  }

  .legend-filter {
    width: 100%;
    align-items: flex-start;
  }

  .legend-filter-title {
    width: 52px;
    padding-top: 8px;
  }

  .legend-filter-options {
    flex: 1 1 0;
  }

  .agenda-list-item {
    grid-template-columns: 4px minmax(0, 1fr);
  }

  .agenda-item-status {
    grid-column: 2;
    justify-self: start;
  }

  .absences-planning-filters {
    width: 100%;
  }

  .absences-planning-filters label {
    flex: 1 1 160px;
  }

  .absences-form-grid {
    grid-template-columns: 1fr;
  }

  .absences-overlap-card {
    align-items: stretch;
    flex-direction: column;
  }

  .absences-overlap-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .absences-overlap-actions .btn,
  .absences-overlap-actions button {
    flex: 1 1 160px;
  }

  .absences-day-plan-head {
    display: grid;
  }

  .actions-column {
    min-width: 170px;
  }
}

.smart-table-surface > .surface-head {
  align-items: center;
  flex-direction: row;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 14px;
}

.smart-table-surface > .standard-table-shell > .table-responsive {
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.smart-customers-table {
  /* Niente riempimento forzato: la tabella si dimensiona sul contenuto.
     Con table-layout:fixed le colonne restano alle larghezze di progetto. */
  min-width: 0 !important;
  table-layout: fixed;
}

.smart-customers-table tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.smart-customers-table .commesse-document-main-button {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.smart-table-toolbar-actions,
.notification-page-actions,
.notification-dropdown-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.smart-table-filter-modal .surface-head {
  padding: 26px 32px 18px;
  border-bottom: 0;
  background: #fff;
}

.smart-table-filter-modal .surface-head h2 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.12;
}

.smart-table-filter-modal .editor-body {
  padding: 0;
}

.smart-table-filter-save .blazor-action-text-button,
.smart-table-filter-save .btn {
  width: 100%;
  min-height: 50px;
  border-radius: 10px;
}

.smart-table-filter-save .btn-primary,
.smart-table-filter-save .btn-primary:disabled,
.smart-table-filter-save .btn-primary.dxbl-disabled,
.smart-table-filter-save .btn-primary[aria-disabled="true"] {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #fff !important;
}

.smart-table-filter-save .btn-primary:disabled,
.smart-table-filter-save .btn-primary.dxbl-disabled,
.smart-table-filter-save .btn-primary[aria-disabled="true"] {
  opacity: .58;
}

.smart-table-filter-modal .smart-table-filter-control {
  min-height: 50px;
  border-color: #d0dbe9;
  border-radius: 8px;
  font-size: 15px;
}

.smart-table-filter-modal .modal-form-actions {
  margin-top: 0;
  padding: 22px 32px;
  border-top-color: #d8e4f2;
}

.smart-table-filter-modal .modal-form-actions:not(.has-danger) .modal-form-main-actions {
  grid-column: 1 / -1;
  justify-self: stretch;
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-left: 0;
}

.smart-table-filter-modal .modal-form-actions .btn {
  min-height: 52px;
  min-width: 176px;
  border-radius: 8px;
}

/* Nessun minimo: il filtro segue la larghezza della colonna. Le larghezze automatiche gli lasciano gia'
   spazio (SmartTable.razor, ApplyRangeFilterMinWidth); se l'utente stringe la colonna si stringe anche lui. */
.smart-table-header-filters :where(.smart-table-filter-control, input, select, .dxbl-text-edit, .dxbl-input) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.smart-table-header-filters .dxbl-text-edit.smart-table-filter-control input {
  min-height: 0;
  padding-block: 0;
}

.smart-table-header-filters .blazor-combo-box.dxbl-text-edit.smart-table-filter-control .dxbl-edit-btn-dropdown {
  min-height: 28px;
}

.smart-table-multiselect .smart-table-option-switch,
.smart-table-column-controls .smart-table-option-switch {
  width: 100%;
  min-width: 0;
}

.smart-table-option-switch label,
.smart-table-option-switch .dxbl-checkbox-label {
  min-width: 0;
  color: var(--text);
}

.smart-table-column-option.drag-source {
  background: var(--primary-tint-1);
  opacity: .64;
  outline: 1px dashed var(--primary-tint-13);
  outline-offset: -4px;
  transform: scale(.995);
}

.smart-table-column-option.drop-target {
  border-color: var(--primary-tint-10);
  background: rgba(var(--primary-rgb), .06);
  box-shadow: inset 0 3px 0 var(--primary), 0 8px 20px rgba(var(--primary-rgb), .10);
}

.data-table tbody tr:hover .smart-table-sticky-col,
.table tbody tr:hover .smart-table-sticky-col {
  background: var(--primary-tint-3);
}

.smart-table-select-col .dxbl-checkbox {
  display: inline-flex;
  justify-content: center;
}

.smart-table-column-option:last-child {
  border-bottom-color: transparent;
}

/* Testo leggibile solo dagli screen reader, invisibile a video: nessuna classe utility equivalente
   esisteva nel sito, serve per annunciare la direzione di ordinamento senza duplicarla visivamente
   (l'icona ↑/↓ resta aria-hidden). Riusabile ovunque serva lo stesso pattern. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.smart-table-state,
.notification-state,
.smart-table-error,
.notification-error {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  color: var(--muted);
}

.smart-table-error,
.notification-error {
  color: var(--danger);
}

@keyframes nethub-spin {
  to {
    transform: rotate(360deg);
  }
}

.smart-table-settings-dialog .editor-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* .modal-form-actions e' pensato come riga di un .form-grid (grid-column:1/-1),
   qui invece e' figlio flex diretto di .editor-body: senza flex-shrink:0 si
   comprime insieme a .smart-table-settings-body quando il contenuto e' alto,
   con effetto "footer tagliato" segnalato dall'utente. */
.smart-table-settings-dialog .editor-body > .modal-form-actions {
  flex: 0 0 auto;
  padding: 14px 18px;
  margin-top: 0;
  border-top: 1px solid var(--border);
}

.smart-table-settings-toggle .button-icon-svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.smart-table-settings-toggle.icon-only .button-icon-svg {
  width: 15px;
  height: 15px;
}

.notification-bell-shell {
  position: relative;
  flex-shrink: 0;
}

.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.notification-bell svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.notification-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1070;
  background: transparent;
  cursor: default;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1080;
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  border: 1px solid var(--border, #dbe3ee);
  border-radius: var(--radius, 12px);
  background: var(--surface, #fff);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
  padding: 0;
}

.notification-dropdown-head,
.notification-dropdown-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification-dropdown-head {
  min-height: 52px;
  padding: 0 10px 0 18px;
  border-bottom: 1px solid var(--border, #dbe3ee);
}

.notification-dropdown-head strong {
  color: var(--text, #0f172a);
  font-size: 16px;
  font-weight: 700;
}

.notification-dropdown-actions {
  padding: 4px 8px;
  border-top: 1px solid var(--border, #dbe3ee);
}

/* Tutte / Preferenze / Segna lette: link testuali senza bordo ("Segna lette" e' un button accessibile). */
.notification-dropdown-actions a,
.notification-dropdown-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary-strong, #1d4ed8);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.notification-dropdown-link {
  cursor: pointer;
}

.notification-dropdown-actions a:hover,
.notification-dropdown-actions a:focus-visible,
.notification-dropdown-link:hover,
.notification-dropdown-link:focus-visible {
  background: var(--primary-soft, #eaf2ff);
  color: var(--primary-strong, #1d4ed8);
}

/* Anello di focus come sulla riga: il solo sfondo non basta a vedere dove si e'. */
.notification-dropdown-actions a:focus-visible,
.notification-dropdown-link:focus-visible {
  outline: 3px solid var(--primary, #2563eb);
  outline-offset: -3px;
}

.notification-page-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-strong, #1d4ed8);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.notification-page-actions a:hover,
.notification-page-actions a:focus-visible {
  border-color: var(--primary, #2563eb);
  background: var(--primary-soft, #eaf2ff);
  color: var(--primary-strong, #1d4ed8);
}

.help-menu-shell {
  position: relative;
  flex-shrink: 0;
}

.help-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.help-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1070;
  background: transparent;
  cursor: default;
}

.help-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1080;
  display: grid;
  width: 180px;
  border: 1px solid var(--border, #dbe3ee);
  border-radius: var(--radius, 12px);
  background: var(--surface, #fff);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
  padding: 6px;
}

.help-menu-dropdown a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text, #0f172a);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.help-menu-dropdown a:hover,
.help-menu-dropdown a:focus-visible {
  background: var(--primary-soft, #eaf2ff);
  color: var(--primary-strong, #1d4ed8);
}

/* Elenco notifiche (pagina e tendina): cartellini in fila. --c, --on-c e --ink arrivano da NotificationVisuals (stessi colori del toast). */
.notification-feed {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.notification-dropdown .notification-feed {
  gap: 0;
}

.notification-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.notification-group-title {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.notification-list {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--border, #dbe3ee);
  border-radius: 16px;
  background: var(--surface, #fff);
}

.notification-dropdown .notification-list {
  border: 0;
  border-radius: 0;
}

.notification-list > * + * {
  border-top: 1px solid var(--border, #dbe3ee);
}

.notification-feed-item {
  --c: var(--primary, #2563eb);
  --on-c: #fff;
  --ink: var(--primary-strong, #1d4ed8);
  --soft: #566579;
  position: relative;
  appearance: none;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface, #fff);
  padding: 13px 18px 13px 28px;
  font: inherit;
  text-align: left;
  color: var(--text, #0f172a);
}

.notification-feed-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: color-mix(in srgb, var(--c) 18%, #fff);
}

.notification-feed-item.is-unread::before {
  background: var(--c);
}

button.notification-feed-item {
  cursor: pointer;
  transition: background-color .12s ease;
}

/* Hover visibile (--primary-soft) senza spostare il testo. */
button.notification-feed-item:hover,
button.notification-feed-item:focus-visible {
  background: var(--primary-soft, #eaf2ff);
}

button.notification-feed-item:focus-visible {
  outline: 3px solid var(--primary, #2563eb);
  outline-offset: -3px;
}

.notification-feed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 14%, #fff);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.is-unread .notification-feed-icon {
  background: var(--c);
  color: var(--on-c);
}

.notification-feed-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-feed-title,
.notification-feed-message {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-feed-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--soft);
}

.is-unread .notification-feed-title {
  font-weight: 700;
  color: var(--text, #0f172a);
}

.notification-feed-message {
  color: var(--soft);
  font-size: 14px;
}

.notification-feed-time {
  align-self: start;
  padding-top: 2px;
  justify-self: end;
  color: var(--soft);
  font-size: 13px;
  white-space: nowrap;
}

.is-unread .notification-feed-time {
  color: #475569;
}

.notification-page {
  display: grid;
  gap: 14px;
}

/* Pagina: colonna dei moduli (schedario) accanto all'elenco. Il colore del blocco arriva da --c (NotificationVisuals.ModuleBlockStyle). */
.notification-layout {
  display: grid;
  gap: 28px;
  align-items: start;
}

.notification-layout.has-rail {
  grid-template-columns: 272px minmax(0, 1fr);
}

.notification-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.notification-feed:focus {
  outline: none;
}

.notification-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.notification-module {
  appearance: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 88px;
  padding: 10px 12px;
  border: 0;
  border-radius: 16px;
  background: var(--c, #475569);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease;
}

.notification-module.is-all {
  background: #0f172a;
}

.notification-module:hover {
  transform: translateY(-2px);
}

/* Selezionato = contorno scuro + anello bianco interno; tastiera = solo anello blu staccato: i due segni non si confondono. */
.notification-module[aria-pressed="true"] {
  outline: 3px solid var(--text, #0f172a);
  outline-offset: 2px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9);
}

.notification-module:focus-visible {
  outline: 3px solid var(--primary, #2563eb);
  outline-offset: 4px;
}

.notification-module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification-module-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .24);
  font-size: 14px;
  font-weight: 800;
}

.notification-module-count {
  min-width: 28px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.notification-module-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

@media (max-width: 1100px) {
  .notification-layout.has-rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .notification-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-module {
    transition: none;
  }

  .notification-module:hover {
    transform: none;
  }
}

/* Stati: righe fantasma nello stesso stampo delle notifiche. */
.notification-feed-item.is-state {
  cursor: default;
}

.is-ghost .notification-feed-icon {
  background: transparent;
  border: 2px dashed var(--border-strong, #cbd5e1);
  color: var(--soft);
}

.is-skeleton .notification-feed-icon {
  background: var(--border, #dbe3ee);
}

.is-ghost::before,
.is-skeleton::before {
  background: color-mix(in srgb, var(--border-strong, #cbd5e1) 60%, #fff);
}

.notification-list > .is-ghost:nth-of-type(2) {
  opacity: .65;
}

.notification-list > .is-ghost:nth-of-type(3) {
  opacity: .4;
}

.notification-feed-bar {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #e8edf4 25%, #f4f7fb 50%, #e8edf4 75%) 0 0 / 200% 100%;
}

.is-skeleton .notification-feed-bar {
  animation: notification-feed-shimmer 1.2s linear infinite;
}

.notification-feed-bar-time {
  width: 36px;
}

.is-error::before {
  background: var(--danger, #dc2626);
}

.is-error .notification-feed-icon {
  background: var(--danger, #dc2626);
  color: #fff;
}

.is-error .notification-feed-title {
  color: var(--text, #0f172a);
  font-weight: 700;
}

.notification-feed-retry {
  appearance: none;
  min-height: 34px;
  border: 1px solid var(--danger, #dc2626);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--danger-strong, #b91c1c);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

.notification-feed-retry:hover,
.notification-feed-retry:focus-visible {
  background: color-mix(in srgb, var(--danger, #dc2626) 8%, #fff);
}

.notification-feed-more {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border, #dbe3ee);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--primary-strong, #1d4ed8);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.notification-feed-more:hover:not(:disabled),
.notification-feed-more:focus-visible {
  background: var(--primary-soft, #eaf2ff);
}

.notification-feed-retry:focus-visible,
.notification-feed-more:focus-visible {
  outline: 3px solid var(--primary, #2563eb);
  outline-offset: -3px;
}

.notification-feed-more:disabled {
  opacity: .6;
  cursor: default;
}

@keyframes notification-feed-shimmer {
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  button.notification-feed-item {
    transition: none;
  }

  button.notification-feed-item:hover,
  button.notification-feed-item:focus-visible {
    translate: none;
  }

  .is-skeleton .notification-feed-bar {
    animation: none;
  }
}

.notification-filter-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.notification-preference-matrix {
  display: grid;
  gap: 12px;
}

.notification-module-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.notification-module-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-soft);
  font-weight: 800;
  cursor: pointer;
}

.notification-preference-table {
  display: grid;
}

.notification-preference-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 88px 88px 88px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.notification-preference-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.notification-channel-switch {
  display: flex;
  justify-content: center;
}

/* Toast notifiche in arrivo, direzione "Cartellino": card con fascia piena a sinistra nel colore del modulo (--c),
   alto a destra sotto la topbar. La fascia si consuma in 6 s come tempo residuo e si ferma con hover/focus. */
.notification-toast-host {
  position: fixed;
  top: calc(var(--topbar-height, 72px) + 12px);
  right: 16px;
  /* Sopra sidebar (1040) ma sotto la topbar (1060): il menu della campanella vive nel contesto della topbar
     e deve restare sopra il toast; i modali (>= 1070) coprono il toast. */
  z-index: 1059;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.notification-toast-slot {
  display: grid;
  grid-template-rows: 1fr;
  animation: notification-toast-slot-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-toast-slot.is-out {
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Il margine negativo lascia spazio all'ombra senza farla tagliare dall'overflow. */
.notification-toast-in {
  min-height: 0;
  overflow: hidden;
  padding: 14px 44px 36px;
  margin: -14px -44px -26px;
}

.notification-toast {
  --c: var(--primary);
  --on-c: #fff;
  --ink: color-mix(in srgb, var(--primary) 72%, #000);
  --dur: 6s;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), 0 12px 24px -10px rgba(15, 23, 42, 0.4);
  pointer-events: auto;
  transition: translate 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
  animation: notification-toast-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-toast:hover,
.notification-toast:focus-within {
  translate: 0 -2px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), 0 16px 28px -10px rgba(15, 23, 42, 0.45);
}

.notification-toast-slot.is-out .notification-toast {
  pointer-events: none;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.22s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-toast-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 8px;
  background: color-mix(in srgb, var(--c) 18%, #fff);
}

.notification-toast-prog {
  position: absolute;
  inset: 0;
  background: var(--c);
  transform-origin: top;
  animation: notification-toast-drain var(--dur, 6s) linear forwards;
}

.notification-toast.is-paused .notification-toast-prog {
  animation-play-state: paused;
}

.notification-toast-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 14px 48px 14px 24px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-toast-main:focus-visible {
  outline-offset: -3px;
  border-radius: 14px;
}

.notification-toast-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--c);
  color: var(--on-c);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.notification-toast-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-toast-title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Il messaggio va al massimo su due righe, poi ellissi. */
.notification-toast-data {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.notification-toast-act {
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.notification-toast-close-wrap {
  display: contents;
}

.notification-toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s, background 0.18s;
}

.notification-toast:hover .notification-toast-close,
.notification-toast:focus-within .notification-toast-close,
.notification-toast-close:focus-visible {
  opacity: 1;
}

.notification-toast-close:hover {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--text);
}

/* Senza puntatore (tablet) non c'e' hover: la X resta visibile. */
@media (hover: none) {
  .notification-toast-close {
    opacity: 1;
  }
}

@keyframes notification-toast-slot-in {
  from {
    grid-template-rows: 0fr;
  }

  to {
    grid-template-rows: 1fr;
  }
}

@keyframes notification-toast-in {
  from {
    opacity: 0;
    transform: translateX(32px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes notification-toast-drain {
  to {
    transform: scaleY(0);
  }
}

/* La fascia resta animata: e' l'indicatore del tempo residuo, non una decorazione. */
@media (prefers-reduced-motion: reduce) {
  .notification-toast-slot,
  .notification-toast {
    animation: none;
  }

  .notification-toast,
  .notification-toast-slot.is-out,
  .notification-toast-slot.is-out .notification-toast,
  .notification-toast-close {
    transition: none;
  }
}

body label {
  font-family: var(--app-font-family) !important;
  font-weight: 600 !important;
}

body :where(.form-control, .form-select, input:not([type="button"]):not([type="checkbox"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="radio"]):not([type="range"]):not([type="reset"]):not([type="submit"]), select, textarea, .dxbl-text-edit, .dxbl-text-edit input, .dxbl-input) {
  font-family: var(--app-font-family) !important;
  font-weight: 400 !important;
}

body .form-control::placeholder,
body .form-select::placeholder,
body input::placeholder,
body textarea::placeholder,
body .dxbl-text-edit input::placeholder {
  font-weight: 400 !important;
}

/* Audit ed errori (backoffice Partner): dettaglio di un errore e delle sue occorrenze. Classi solo di questa pagina. */
.audit-occurrence {
  border-top: 1px solid var(--line, #e2e8f0);
  margin-top: 16px;
  padding-top: 12px;
}

.audit-occurrence h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
}

.audit-occurrence-details {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 4px 16px;
  margin: 0 0 8px;
}

.audit-occurrence-details dt {
  font-weight: 500;
  color: var(--muted, #64748b);
}

.audit-occurrence-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.audit-stack {
  background: var(--soft, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  font-size: 12px;
  max-height: 320px;
  overflow: auto;
  padding: 8px 10px;
  white-space: pre-wrap;
}

/* Tabella a card unica (Note spese e liste Partner), passo 1 - colori: il contorno (cornice, footer, totali,
   modale impostazioni) usa gli stessi grigi/azzurri delle righe, al posto di hex diversi per elemento.
   Si applica a due casi (vedi :is() nei selettori): (a) pagina Note spese e tabelle impostazioni che hanno
   la classe .expense-note-list-surface; (b) liste Partner, cioe' un .work-surface che contiene SOLO la
   tabella (PartnerSmartTable) oppure testata + tabella: i pannelli con form e altre sezioni restano com'erano.
   Questo blocco e i due successivi sono solo aggiunte: per tornare al comportamento precedente basta
   rimuoverli (o fare git revert del commit che li introduce). */
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) {
  --st-line: #e8eef7;
  --st-line-strong: #dbe3ee;
  --st-head: #fff;
  --st-text: #1f2937;
  --st-text-soft: #5f6f84;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child)))::before {
  background: var(--primary);
  opacity: 1;
}

.expense-note-list-surface .table-responsive {
  border-color: var(--st-line);
  background: #fff;
}

.expense-note-list-surface .table-pager {
  border-color: var(--st-line);
  background: var(--st-head);
  color: var(--st-text-soft);
}

.expense-note-list-surface .table-pager-count,
.expense-note-list-surface .table-pager-total,
.expense-note-list-surface .table-pager-page,
.expense-note-list-surface .table-pager-size-select {
  color: var(--st-text);
}

.expense-note-list-surface .table-pager-size-label {
  color: var(--st-text-soft);
}

.expense-note-list-surface .table-pager-size-select,
.expense-note-list-surface .table-pager-navigation {
  border-color: var(--st-line-strong);
}

.expense-note-list-surface .smart-table-summary-footer td {
  background: var(--st-head) !important;
  border-top-color: var(--st-line-strong);
  color: var(--st-text);
}

.expense-note-list-surface .smart-table-column-option {
  border-bottom-color: var(--st-line);
}

/* Tabella Note spese, passo 2 - forma: un solo raggio (--radius) per cornice, footer e controlli,
   footer che prosegue la tabella, etichette normali (niente maiuscolo, niente grassetti 800-900), nessuna striscia in cima. */
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child)))::before {
  display: none;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead th,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead th .smart-table-sort-button {
  text-transform: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager {
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--st-head);
  box-shadow: none;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-count,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-total,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-page,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-size-select {
  font-weight: 600;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-size-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-size-select {
  border-radius: var(--radius);
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-navigation {
  border-radius: var(--radius);
  box-shadow: none;
  background: #fff;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager-button {
  border-radius: max(calc(var(--radius) - 3px), 4px);
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table tbody tr.table-group-row > td:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table tbody tr.table-group-row > td:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .smart-table-selection-bar {
  border-radius: var(--radius);
}

/* Tabella Note spese, passo 3 - card unica: toolbar, tabella e footer in un solo contenitore,
   la tabella scorre dentro la card (header sticky) e il footer resta sempre visibile in fondo. */
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) {
  padding: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) > .surface-head {
  align-items: flex-end;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--st-line);
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-responsive,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .standard-table-shell.has-table-pager > .table-responsive {
  border: 0;
  border-radius: 0;
  background: #fff;
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-pager {
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--st-line);
  border-radius: 0;
  background: #fff;
}

/* Header, righe e footer dello stesso colore (bianco): si distinguono solo per le linee, non per il fondo. */
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead th,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead tr.smart-table-header-filters th,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead th.smart-table-sticky-col {
  background: var(--nh-table-head-bg, #fff);
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead tr:last-child th {
  border-bottom: 1px solid var(--st-line-strong);
}

@media (min-width: 900px) and (min-height: 560px) {
  :is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .table-responsive {
    max-height: calc(100dvh - 340px);
    min-height: 260px;
    overflow: auto;
  }

  :is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead {
    position: sticky;
    top: 0;
    z-index: 4;
  }

  :is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) .data-table thead th.smart-table-sticky-col {
    z-index: 5;
  }
}

/* Tabelle annidate (modali e pannelli con altri contenuti): stessa card delle liste a card unica.
   Prima restavano con il vecchio aspetto (cornice interna, intestazioni maiuscole, righe staccate) perche' il
   selettore delle card unica richiede una tabella sola dentro un .work-surface. Qui la card e' la sezione della
   tabella stessa; dentro una card unica il contorno viene azzerato per non raddoppiarlo.
   Blocco solo aggiuntivo: per tornare indietro basta rimuoverlo (o git revert del commit che lo introduce). */
.standard-smart-table-inline:not(.work-surface),
.partner-smart-table-inline:not(.work-surface) {
  --st-line: #e8eef7;
  --st-line-strong: #dbe3ee;
  --st-head: #fff;
  --st-text: #1f2937;
  --st-text-soft: #5f6f84;
  overflow: hidden;
  border: 1px solid var(--st-line-strong);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) > .standard-smart-table-inline,
:is(.work-surface.expense-note-list-surface, .work-surface:where(:has(> .partner-smart-table-inline:only-child), :has(> .surface-head:first-child + .partner-smart-table-inline:last-child), :has(> .standard-smart-table-inline:only-child), :has(> .surface-head:first-child + .standard-smart-table-inline:last-child), :has(> .presence-stamps-smart-table:only-child), :has(> .surface-head:first-child + .presence-stamps-smart-table:last-child))) > .partner-smart-table-inline {
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.standard-smart-table-inline .table-responsive,
.standard-smart-table-inline .standard-table-shell.has-table-pager > .table-responsive,
.partner-smart-table-inline .table-responsive,
.partner-smart-table-inline .standard-table-shell.has-table-pager > .table-responsive {
  border: 0;
  border-radius: 0;
  background: #fff;
}

.standard-smart-table-inline .data-table thead th,
.standard-smart-table-inline .data-table thead tr.smart-table-header-filters th,
.partner-smart-table-inline .data-table thead th,
.partner-smart-table-inline .data-table thead tr.smart-table-header-filters th {
  background: var(--nh-table-head-bg, #fff);
}

.standard-smart-table-inline .data-table thead th,
.standard-smart-table-inline .data-table thead th .smart-table-sort-button,
.partner-smart-table-inline .data-table thead th,
.partner-smart-table-inline .data-table thead th .smart-table-sort-button {
  text-transform: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.standard-smart-table-inline .data-table thead tr:last-child th,
.partner-smart-table-inline .data-table thead tr:last-child th {
  border-bottom: 1px solid var(--st-line-strong);
}

.standard-smart-table-inline .table-pager,
.partner-smart-table-inline .table-pager {
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--st-line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  color: var(--st-text-soft);
}

.standard-smart-table-inline .table-pager-count,
.standard-smart-table-inline .table-pager-total,
.standard-smart-table-inline .table-pager-page,
.standard-smart-table-inline .table-pager-size-select,
.partner-smart-table-inline .table-pager-count,
.partner-smart-table-inline .table-pager-total,
.partner-smart-table-inline .table-pager-page,
.partner-smart-table-inline .table-pager-size-select {
  color: var(--st-text);
  font-weight: 600;
}

.standard-smart-table-inline .table-pager-size-label,
.partner-smart-table-inline .table-pager-size-label {
  color: var(--st-text-soft);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.standard-smart-table-inline .table-pager-size-select,
.standard-smart-table-inline .table-pager-navigation,
.partner-smart-table-inline .table-pager-size-select,
.partner-smart-table-inline .table-pager-navigation {
  border-color: var(--st-line-strong);
  border-radius: var(--radius);
  box-shadow: none;
}

.standard-smart-table-inline .table-pager-button,
.partner-smart-table-inline .table-pager-button {
  border-radius: max(calc(var(--radius) - 3px), 4px);
}

/* Badge di stato e Sì/No piu' vivaci (richiesta utente: erano troppo spenti). Sfondo piu' pieno, testo scuro della stessa
   famiglia (contrasto > 7:1), bordo leggermente piu' marcato. Vale per .chip, .status-pill, .status-chip e il flag Sì/No
   delle tabelle; i chip con colore personalizzato (es. Tipo spesa) hanno colore inline e non cambiano.
   Blocco solo aggiuntivo: per tornare ai colori precedenti basta rimuoverlo (o git revert del suo commit). */
.status-pill,
.chip {
  background: #bfdbfe;
  color: #1e40af;
  border-color: rgba(30, 64, 175, 0.28);
}

.status-pill.success,
.chip.success {
  background: #bbf7d0;
  color: #166534;
  border-color: rgba(22, 101, 52, 0.30);
}

.status-pill.warning,
.chip.warning {
  background: #fde68a;
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.30);
}

.status-pill.info,
.chip.info {
  background: #bfdbfe;
  color: #1e40af;
  border-color: rgba(30, 64, 175, 0.28);
}

.status-pill.danger,
.chip.danger {
  background: #fecaca;
  color: #991b1b;
  border-color: rgba(153, 27, 27, 0.30);
}

.status-pill.neutral,
.chip.neutral {
  background: #e2e8f0;
  color: #334155;
  border-color: rgba(51, 65, 85, 0.28);
}

.status-chip.success {
  background: #bbf7d0;
  color: #166534;
}

.status-chip.warning {
  background: #fde68a;
  color: #92400e;
}

.status-chip.danger {
  background: #fecaca;
  color: #991b1b;
}

.expense-table-flag.on {
  background: #bbf7d0;
  color: #166534;
}

.expense-table-flag.off {
  background: #e2e8f0;
  color: #475569;
}

/* Badge residui allineati ai colori vivaci di .chip/.status-pill (stessa palette: sfondo pieno, testo scuro della stessa famiglia).
   Blocco solo aggiuntivo: per tornare ai colori precedenti basta rimuoverlo. */
.company-type-badge.is-primary {
  background: #c7d2fe;
  border-color: rgba(55, 48, 163, 0.30);
  color: #3730a3;
}

.company-type-badge.is-secondary {
  background: #a5f3fc;
  border-color: rgba(21, 94, 117, 0.30);
  color: #155e75;
}

.attachment-type-badge {
  background: #bfdbfe;
  border-color: rgba(30, 64, 175, 0.28);
  color: #1e40af;
}

/* Neutro (No / chip neutral) piu' definito: grigio-ardesia pieno con testo scuro, meno slavato. */
.status-pill.neutral,
.chip.neutral {
  background: #cbd5e1;
  color: #1e293b;
  border-color: rgba(30, 41, 59, 0.30);
}

.expense-table-flag.off {
  background: #cbd5e1;
  color: #1e293b;
}

/* "No" in lavanda: colore proprio, distinto da verde (Si), azzurro (info), ambra (warning) e rosso (danger). */
.status-pill.neutral,
.chip.neutral {
  background: #ddd6fe;
  color: #5b21b6;
  border-color: rgba(91, 33, 182, 0.28);
}

.expense-table-flag.off {
  background: #ddd6fe;
  color: #5b21b6;
}

/* ==========================================================================================
   Caselle di spunta e interruttori: un solo aspetto per tutto il sito (casella con riempimento
   dal basso). Vale per DxCheckBox (anche con CheckType.Switch), input[type=checkbox] nativi e
   .form-check-input / .form-switch di Bootstrap. Interno trasparente da spenta, riempimento blu
   solo da accesa. Il layout (etichetta, riga) resta quello di .check-row/.check-line/.switch-line.
   Sulle regole DevExpress serve !important: il tema DevExpress dipinge lo stesso elemento con
   selettori piu' specifici. Radio fuori scope.
   Punto di ritorno: tag git pre-checkbox-unificate.
   ========================================================================================== */
:root {
  --check-size: 22px;
  --check-radius: 6px;
  --check-on: var(--primary);
  --check-off: var(--border-strong);
  --check-ring: #bfdbfe;
  --check-ease: cubic-bezier(.2, .8, .2, 1);
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --check-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* --- DevExpress (casella e interruttore): il quadrato e' .dxbl-checkbox-check-element --- */
body .dxbl-checkbox:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element {
  position: relative !important;
  box-sizing: border-box !important;
  flex: none !important;
  display: block !important;
  width: var(--check-size) !important;
  height: var(--check-size) !important;
  min-width: var(--check-size) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1.5px solid var(--check-off) !important;
  border-radius: var(--check-radius) !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

body .dxbl-checkbox:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--check-fill, var(--check-on)) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  translate: none !important;
  transform: scaleY(0) !important;
  transform-origin: bottom !important;
  transition: transform .3s var(--check-ease) !important;
}

body .dxbl-checkbox:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background: var(--check-icon) center / 16px 16px no-repeat !important;
  clip-path: inset(0 100% 0 0);
  transition: clip-path .22s ease .14s;
}

body .dxbl-checkbox-checked:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element,
body .dxbl-checkbox-indeterminate:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element,
body .dxbl-checkbox:not(.dxbl-checkbox-radio):hover .dxbl-checkbox-check-element {
  border-color: var(--check-on) !important;
}

body .dxbl-checkbox-checked:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element::before,
body .dxbl-checkbox-indeterminate:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element::before {
  transform: scaleY(1) !important;
}

body .dxbl-checkbox-checked:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element::after {
  clip-path: inset(0 0 0 0);
}

body .dxbl-checkbox-indeterminate:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element::after {
  background-image: var(--check-dash) !important;
  clip-path: inset(0 0 0 0);
}

body .dxbl-checkbox:not(.dxbl-checkbox-radio):has(input:focus-visible) .dxbl-checkbox-check-element {
  border-color: var(--check-on) !important;
  box-shadow: 0 0 0 3px var(--check-ring) !important;
}

body .dxbl-checkbox:not(.dxbl-checkbox-radio) .dxbl-checkbox-check-element input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  opacity: 0 !important;
  cursor: pointer;
  z-index: 1;
}

body .dxbl-checkbox:not(.dxbl-checkbox-radio):has(input:disabled) .dxbl-checkbox-check-element {
  --check-fill: #cbd5e1;
  border-color: var(--border) !important;
  cursor: not-allowed;
}

/* --- Input nativi e Bootstrap (.form-check-input, .form-switch): casella disegnata a livelli di sfondo --- */
html body input[type="checkbox"]:not(.dxbl-checkbox *) {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  flex: none;
  width: var(--check-size);
  height: var(--check-size);
  min-width: var(--check-size);
  padding: 0;
  border: 1.5px solid var(--check-off);
  border-radius: var(--check-radius);
  background-color: transparent;
  background-image: var(--check-icon), linear-gradient(var(--check-fill, var(--check-on)), var(--check-fill, var(--check-on)));
  background-repeat: no-repeat, no-repeat;
  background-position: center, bottom;
  background-size: 0 0, 100% 0;
  box-shadow: none;
  cursor: pointer;
  transition: background-size .3s var(--check-ease), border-color .15s, box-shadow .15s;
}

html body input[type="checkbox"]:not(.dxbl-checkbox *):hover:not(:disabled) {
  border-color: var(--check-on);
}

html body input[type="checkbox"]:not(.dxbl-checkbox *):checked {
  border-color: var(--check-on);
  background-color: transparent;
  background-image: var(--check-icon), linear-gradient(var(--check-fill, var(--check-on)), var(--check-fill, var(--check-on)));
  background-position: center, bottom;
  background-size: 16px 16px, 100% 100%;
}

html body input[type="checkbox"]:not(.dxbl-checkbox *):indeterminate {
  border-color: var(--check-on);
  background-color: transparent;
  background-image: var(--check-dash), linear-gradient(var(--check-fill, var(--check-on)), var(--check-fill, var(--check-on)));
  background-position: center, bottom;
  background-size: 16px 16px, 100% 100%;
}

html body input[type="checkbox"]:not(.dxbl-checkbox *):focus-visible {
  outline: none;
  border-color: var(--check-on);
  box-shadow: 0 0 0 3px var(--check-ring);
}

/* Serve !important: la regola generica "input:disabled { background: transparent !important }" azzererebbe i livelli di sfondo */
html body input[type="checkbox"]:not(.dxbl-checkbox *):disabled {
  --check-fill: #cbd5e1;
  border-color: var(--border);
  cursor: not-allowed;
  background-image: var(--check-icon), linear-gradient(var(--check-fill), var(--check-fill)) !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: center, bottom !important;
  background-size: 0 0, 100% 0 !important;
}

html body input[type="checkbox"]:not(.dxbl-checkbox *):disabled:checked {
  background-size: 16px 16px, 100% 100% !important;
}

@media (prefers-reduced-motion: reduce) {
  body .dxbl-checkbox .dxbl-checkbox-check-element,
  body .dxbl-checkbox .dxbl-checkbox-check-element::before,
  body .dxbl-checkbox .dxbl-checkbox-check-element::after,
  html body input[type="checkbox"]:not(.dxbl-checkbox *) {
    transition: none !important;
  }
}
/* Pulsanti icona delle righe di tutte le tabelle (matita, occhio, apri dettaglio): nessun contorno blu in nessuno stato,
   resta lo sfondo azzurro al passaggio. !important perche' le regole di tabella compatta e di Bootstrap impostano il bordo
   con specificita' alta. Con il focus da tastiera il bordo e l'anello restano visibili. Per tornare indietro basta il revert del commit. */
body .btn.btn-icon-only.row-edit-trigger:not(:focus-visible),
body td .btn.btn-icon-only.btn-outline-primary:not(:focus-visible) {
  border-color: transparent !important;
  box-shadow: none;
}

/* Orologio dello stato approvazione (e altri pulsanti icona secondari negli slot azione delle righe): niente contorno chiaro
   ne' fondo bianco, al passaggio compare solo un fondo leggero. Con il focus da tastiera il bordo resta visibile. */
body .row-action-slot .btn.btn-icon-only.btn-outline-secondary:not(:focus-visible) {
  border-color: transparent !important;
  background-color: transparent;
  box-shadow: none;
}

body .row-action-slot .btn.btn-icon-only.btn-outline-secondary:hover:not(:disabled) {
  background-color: var(--bg-soft);
}

/* Schema flussi approvativi (WorkflowSchemaBlazor): catena regole -> livelli -> esito in HTML/CSS puro, da sinistra a destra;
   in verticale sotto i 760px. Solo token del sito, nessuna decorazione. */
.wf-schema {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 4px 0 8px;
  overflow-x: auto;
}

.wf-schema-rules,
.wf-schema-end {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  width: 240px;
}

.wf-schema-caption {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.wf-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .86rem;
  text-align: left;
}

.wf-level {
  flex: 0 0 auto;
  width: 220px;
  border-left: 3px solid var(--primary);
}

button.wf-level {
  cursor: pointer;
}

button.wf-level:hover {
  border-color: var(--primary);
}

.wf-level.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.wf-line {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.wf-line--title {
  font-weight: 700;
}

.wf-line--note,
.wf-muted {
  color: var(--muted);
  font-size: .78rem;
}

.wf-line--note:empty {
  display: none;
}

/* Sui nodi colorati il grigio "muted" su fondo *-soft e' troppo debole: testo normale. */
.wf-node--danger .wf-line--note,
.wf-node--danger .wf-muted,
.wf-node--pending .wf-line--note,
.wf-node--pending .wf-muted,
.wf-node--success .wf-line--note,
.wf-node--success .wf-muted,
.wf-level--rejected .wf-line--note,
.wf-level--rejected .wf-muted,
.wf-level--active .wf-line--note,
.wf-level--active .wf-muted,
.wf-level--approved .wf-line--note,
.wf-level--approved .wf-muted,
.wf-level.is-selected .wf-line--note {
  color: var(--text);
}

button.wf-level:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

.wf-node--muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.wf-node--success,
.wf-level--approved {
  border-color: var(--success);
  background: var(--success-soft);
}

.wf-node--danger,
.wf-level--rejected {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.wf-node--pending,
.wf-level--active {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.wf-level--idle {
  background: var(--surface-soft);
}

.wf-link {
  position: relative;
  flex: 0 0 28px;
  align-self: center;
  height: 2px;
  background: var(--border-strong);
}

.wf-link::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  border-left: 6px solid var(--border-strong);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.wf-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.wf-people-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wf-people-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

/* Riga stato del livello: badge e modalita' sulla stessa linea, centrati verticalmente. */
.wf-line--status {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Approvatore: nome a sinistra, esito a destra; data, delega e commento sempre sotto, a tutta larghezza. */
.wf-approver {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
}

.wf-approver > .wf-muted,
.wf-approver > .wf-comment {
  grid-column: 1 / -1;
}

.wf-comment {
  flex-basis: 100%;
  color: var(--text);
  font-size: .8rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  /* Come con "Scroll orizzontale" della SmartTable: le colonne tengono una larghezza leggibile e scorre solo il wrapper. */
  .wf-history-table {
    min-width: 0;
    max-width: 100%;
  }

  .wf-history-table .table-responsive {
    overflow-x: auto;
  }

  .wf-history-table .data-table {
    min-width: 760px !important;
  }

  .wf-schema {
    flex-direction: column;
    align-items: stretch;
    overflow-x: visible;
  }

  .wf-schema-rules,
  .wf-schema-end,
  .wf-level {
    width: 100%;
  }

  .wf-link {
    flex-basis: 22px;
    align-self: center;
    width: 2px;
    height: 22px;
  }

  .wf-link::after {
    top: auto;
    right: auto;
    bottom: 0;
    left: -4px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--border-strong);
    border-bottom: 0;
  }
}

/* Nuova timbratura con piu' righe (TimeStampsBlazor): elenco delle gia' registrate e righe Ora/Causale/Cliente/Commessa. */
.stamp-multi-block {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.stamp-multi-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.stamp-multi-block .report-day-editor-list,
.stamp-multi-block .report-day-editor-empty,
.stamp-multi-block .report-day-editor-preview,
.stamp-multi-block .report-day-editor-add {
  margin-top: 0;
}

.stamp-new-row {
  display: grid;
  grid-template-columns: 120px repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.stamp-new-row.is-no-job {
  grid-template-columns: 120px repeat(2, minmax(0, 1fr)) auto;
}

@media (max-width: 760px) {
  .stamp-new-row,
  .stamp-new-row.is-no-job {
    grid-template-columns: minmax(0, 1fr);
  }

  .stamp-new-row > button {
    justify-self: end;
  }
}

/* Esito negativo di un download (gestore data-nh-download in site.js). */
.nh-download-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 14000;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 0.9rem;
}

a[data-nh-download][aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}
