/* Nuova spesa / Modifica spesa / Spesa (docs/AnalisiNoteSpeseCreazioneGrafica.md, prototipo docs/PropostaNoteSpeseCreazione.html, vista Spesa).
   Scontrino | spesa | foglio del rendiconto. Componenti: ReceiptPaper, ExpenseReportSheet, ExpenseLimitGauge e il ramo UseV2 di ExpenseNotesBlazor.
   Ogni regola sta sotto body.nh-v2: il foglio e' inerte senza la classe nh-v2.
   Classi tutte con prefisso exv2-: nessuna regola di site.css (.expense-*), forms-v2.css o delle altre pagine viene toccata.
   Specificita': body.nh-v2 + .exv2-page + classe (0,3,1) batte site.css (.expense-row-editor-page .form-grid, .field, .dxbl-text-edit)
   senza !important, tranne dove site.css forza gia' con !important i campi disabilitati/di sola lettura.
   Token: solo quelli del sito (tema azienda: --primary, --primary-soft, --primary-ink, --primary-rgb, --border, --text, --muted, --radius...);
   quelli che il sito non ha (grigio piu' scuro, ambra, rosso scuro) sono locali a .exv2-page.
   Il sito web non si usa da telefono: nessuna @media per telefono. Per tornare indietro: togliere il <link> e la proprieta' ExpenseCreateV2CssHref
   in App.razor, oppure git revert; tag di ritorno pre-spesa-creazione. */

/* ================= token e scala continua con l'altezza dello schermo ================= */
/* Le misure crescono in modo continuo con l'altezza, senza @media a gradini sull'altezza (come la modale Giornata): due rampe, --r1 da 768 a 888px (veloce) e --r2 da 888 a 1440px
   (lenta); a 768px o meno valgono 0 e sotto i 768px --lo comprime in modo continuo. Ogni misura e' "base + --r1 * a + --r2 * b" (base a 768,
   valore a 888, valore a 1440 nei commenti). Restano pochi breakpoint DESKTOP sulla larghezza (min-width 1700px e 1900px, max-width 1180px: colonne e aria, vedi
   "schermi larghi e stretti") e due @container sulla larghezza della carta (160px) e del form (470px); nessuno e' per telefono. */
body.nh-v2 .exv2-page {
  --exv2-slate: #475569;
  --exv2-ink: #334155;
  --exv2-faint: #94a3b8;                                                                                  /* grigio piu' chiaro del sito: glifi spenti, tratteggi e puntini guida */
  --exv2-amber: #d97706;
  --exv2-amber-ink: #8a4a05;
  --exv2-danger-ink: var(--test-environment-red-strong);
  --exv2-ok-ink: #047857;
  --exv2-line: color-mix(in srgb, var(--border) 55%, var(--surface));                                     /* filetto tra le righe del foglio */
  --exv2-ease: cubic-bezier(.16, 1, .3, 1);
  --exv2-shadow-paper: drop-shadow(0 1px 1px rgba(15, 23, 42, .1)) drop-shadow(0 14px 16px rgba(30, 58, 100, .2));
  --exv2-shadow-paper-soft: drop-shadow(0 1px 1px rgba(15, 23, 42, .08)) drop-shadow(0 5px 7px rgba(30, 58, 100, .1));

  --exv2-r1: clamp(0px, calc(100dvh - 768px), 120px);
  --exv2-r2: clamp(0px, calc(100dvh - 888px), 552px);
  --exv2-lo: clamp(0px, calc(768px - 100dvh), 200px);
  --exv2-fh: calc(38px + var(--exv2-r1) * .0667 + var(--exv2-r2) * .0254 - var(--exv2-lo) * .03);       /* altezza campi 38 / 46 / 60 */
  --exv2-fs: calc(14.5px + var(--exv2-r1) * .0067 + var(--exv2-r2) * .004);                              /* testo nei campi 14,5 / 15,3 / 17,5 */
  --exv2-lfs: calc(12.5px + var(--exv2-r1) * .0042 + var(--exv2-r2) * .0036);                            /* etichette, errori, misuratore 12,5 / 13 / 15 */
  --exv2-llh: calc(15px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0045);                              /* interlinea etichette 15 / 16 / 18,5 */
  --exv2-lmb: calc(4px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0036);                               /* aria sotto l'etichetta 4 / 5 / 7 */
  --exv2-g: calc(clamp(6px, calc(8px + (100dvh - 720px) / 14), 16px) + var(--exv2-r1) * .035 + var(--exv2-r2) * .033); /* gap minimo tra le righe 11 / 20 / 36 */
  --exv2-note-max: calc(88px + var(--exv2-r1) * .4333 + var(--exv2-r2) * .26);                           /* Note da 3-4 righe a 7-8 */
  --exv2-trk: calc(6px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0036);                               /* barra del misuratore 6 / 7 / 9 */
  --exv2-sub: calc(10px - var(--exv2-lo) * .03 + var(--exv2-trk) + var(--exv2-llh));                     /* zona sotto il campo: misuratore o equazione km */
  --exv2-note-row: minmax(calc(var(--exv2-llh) + var(--exv2-lmb) + 36px - var(--exv2-lo) * .06), calc(var(--exv2-llh) + var(--exv2-lmb) + var(--exv2-note-max)));
  --exv2-eqfs: calc(15px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0054);                             /* equazione km 15 / 16 / 19 */
  --exv2-eqres: calc(18px + var(--exv2-r1) * .0167 + var(--exv2-r2) * .0054);                            /* risultato dell'equazione 18 / 20 / 23 */
  --exv2-bh: calc(38px + var(--exv2-r1) * .0333 + var(--exv2-r2) * .0145 - var(--exv2-lo) * .03);        /* pulsanti 38 / 42 / 50 */
  --exv2-bfs: calc(14px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0027);                              /* testo dei pulsanti 14 / 15 / 16,5 */
  --exv2-ibs: calc(30px + var(--exv2-r1) * .025 + var(--exv2-r2) * .0091);                               /* pulsanti icona 30 / 33 / 38 */
  --exv2-ic: calc(16px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0054);                               /* freccia dei combo 16 / 17 / 20 */
  /* foglio del rendiconto */
  --exv2-st: calc(22px + var(--exv2-r1) * .0167 + var(--exv2-r2) * .0054);                               /* titolo 22 / 24 / 27 */
  --exv2-sfs: calc(14px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0027);                              /* testo righe e piede 14 / 15 / 16,5 */
  --exv2-ssm: calc(12.5px + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0018);                            /* testo secondario 12,5 / 13,5 / 14,5 */
  --exv2-tot: calc(18px + var(--exv2-r1) * .0125 + var(--exv2-r2) * .0027);                              /* Totale 18 / 19,5 / 21: sempre minore del titolo */
  --exv2-shp: calc(14px - var(--exv2-lo) * .04 + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0072);      /* aria verticale della testata 14 / 15 / 19 */
  --exv2-shx: calc(18px + var(--exv2-r1) * .0167 + var(--exv2-r2) * .0109);                              /* aria laterale testata e piede 18 / 20 / 26 */
  --exv2-rwmin: calc(36px - var(--exv2-lo) * .03 + var(--exv2-r1) * .0083 + var(--exv2-r2) * .0127);    /* riga del foglio: minimo 36 / 37 / 44 */
  --exv2-rwmax: calc(52px + var(--exv2-r1) * .0833 + var(--exv2-r2) * .0254);                            /* riga del foglio: massimo 52 / 62 / 76 */
  position: relative;
  /* Non si stira sui monitor grandi: titolo e scheda restano in una colonna di 1680px, centrata. */
  max-width: 1680px;
  margin: 0 auto;
}

body.nh-v2 .exv2-page :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ================= barra del titolo (hero) ed esiti ================= */
body.nh-v2 .exv2-page .exv2-top {
  position: relative;
}

/* Gli esiti stanno nella barra del titolo, tra titolo e azioni: zona senza controlli, quindi non coprono nulla e non spostano mai la scheda. */
body.nh-v2 .exv2-page .exv2-msg {
  position: absolute;
  inset: 0 240px 8px 260px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

body.nh-v2 .exv2-page .exv2-msg .status-strip {
  max-width: 100%;
  min-height: 0;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  overflow: hidden;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 8px 18px -8px rgba(15, 23, 42, .55);
  pointer-events: auto;
  animation: exv2-msgin .22s var(--exv2-ease);
}

body.nh-v2 .exv2-page .exv2-hero .quick-actions {
  gap: 8px;
}

/* Indietro e Modifica in sola lettura: sul rosso dell'hero, come il prototipo (bianco e rosso scuro). */
body.nh-v2 .exv2-page .exv2-hero .btn.exv2-hero-back {
  width: 34px;
  height: 34px;
  min-width: 0;
  padding: 0;
  border: 0 !important;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .16) !important;
  color: #fff !important;
}

body.nh-v2 .exv2-page .exv2-hero .btn.exv2-hero-back:hover:not(:disabled) {
  background: rgba(255, 255, 255, .28) !important;
}

body.nh-v2 .exv2-page .exv2-hero .btn.exv2-hero-edit {
  height: 34px;
  min-width: 0;
  padding: 0 16px;
  border: 0 !important;
  border-radius: var(--radius);
  background: var(--surface) !important;
  color: var(--test-environment-red-strong) !important;
  font-size: 14px;
  font-weight: 750;
}

body.nh-v2 .exv2-page .exv2-hero .btn.exv2-hero-edit:hover:not(:disabled) {
  background: var(--danger-soft) !important;
}

body.nh-v2 .exv2-page .exv2-hero :focus-visible {
  outline-color: #fff;
}

/* ================= scheda a tre colonne ================= */
/* Altezza delle colonne (--exv2-colh) ricavata dall'altezza dello schermo senza scroll di pagina: --exv2-w e' lo spazio libero
   (si tolgono barra del sito, titolo, scheda, dock e margine in basso; 262px e' la stima della cornice del sito, da confermare a schermo).
   Fino a 768px la scheda usa tutto lo spazio; oltre cresce piu' piano dello schermo: un form con quattro righe di campi non puo' riempire
   una colonna piu' alta senza stirarsi. Le misure interne crescono con --exv2-r1 e --exv2-r2. */
body.nh-v2 .exv2-page .exv2-scheda {
  --exv2-chrome: 262px;
  --exv2-w: calc(100dvh - var(--exv2-chrome) - (var(--exv2-bh) - 38px));
  --exv2-colh: clamp(300px, min(var(--exv2-w), calc(481px + (var(--exv2-w) - 481px) * .68)), 4000px);
  min-width: 0;
  margin: calc(4px + var(--exv2-r2) * .02) 0 0;
  padding: calc(14px - var(--exv2-lo) * .04 + var(--exv2-r2) * .045) calc(22px + var(--exv2-r2) * .04) calc(10px - var(--exv2-lo) * .04 + var(--exv2-r2) * .045);
}

body.nh-v2 .exv2-page .exv2-cols {
  display: grid;
  grid-template-columns: clamp(172px, 17vw, 236px) minmax(0, 1fr) clamp(272px, 29vw, calc(460px + var(--exv2-r2) * .0688));
  gap: 24px;
  align-items: stretch;
  min-height: var(--exv2-colh);
}

/* Il dock: errore a sinistra (non spinge il form), Annulla e Salva a destra; in sola lettura solo Elimina a sinistra. */
body.nh-v2 .exv2-page .exv2-dock {
  --exv2-dpt: calc(8px + var(--exv2-r2) * .03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: var(--exv2-dpt);
  padding-top: var(--exv2-dpt);
  border-top: 1px solid var(--border);
}

body.nh-v2 .exv2-page .exv2-dock:not(:has(*)) {
  min-height: calc(var(--exv2-bh) + var(--exv2-dpt) + 1px);
}

body.nh-v2 .exv2-page .exv2-dock-msg {
  flex: 1;
  min-width: 0;
}

body.nh-v2 .exv2-page .exv2-dock-msg:not(:has(*)) {
  display: none;
}

body.nh-v2 .exv2-page .exv2-dock-msg .modal-inline-alert,
body.nh-v2 .exv2-page .exv2-dock-msg .modal-inline-warning {
  display: flex;
  align-items: center;
  min-height: var(--exv2-bh);
  margin: 0;
  padding: 0 14px;
  border-radius: var(--radius);
  box-shadow: none;
  font-size: calc(var(--exv2-bfs) + .5px);
  animation: exv2-msgin .22s var(--exv2-ease);
}

body.nh-v2 .exv2-page .exv2-dock .modal-form-actions {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 0 auto;
  padding: 0;
  border-top: 0;
  background: none;
  box-shadow: none;
}

body.nh-v2 .exv2-page .exv2-dock .modal-form-actions.has-danger {
  justify-content: space-between;
  margin: 0;
}

body.nh-v2 .exv2-page .exv2-dock .modal-form-actions .modal-form-main-actions {
  display: flex;
  gap: 8px;
}

body.nh-v2 .exv2-page .exv2-dock .modal-form-actions .btn {
  min-width: 96px;
  height: var(--exv2-bh);
  font-size: var(--exv2-bfs);
}

/* ================= carta (scontrino e foglio del rendiconto) ================= */
body.nh-v2 .exv2-page .exv2-pwrap {
  filter: var(--exv2-shadow-paper);
}

/* Bordi a zig-zag in alto e in basso: la maschera ritaglia anche l'ombra, per questo l'ombra sta sul contenitore (filter) e non sulla carta. */
body.nh-v2 .exv2-page .exv2-paper {
  --z: 7px;
  position: relative;
  background: var(--surface);
  container-type: inline-size;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--z) * 2) 51% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--z) * 2) 51% repeat-x;
}

/* ================= colonna 1: lo scontrino (secondario: stretto, ombra leggera, miniature discrete) ================= */
/* Scontrino e foglio si adattano all'altezza della riga: non la decidono. */
body.nh-v2 .exv2-page .exv2-receipt {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  contain: size;
}

body.nh-v2 .exv2-page .exv2-receipt-in {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

body.nh-v2 .exv2-page .exv2-pbox {
  flex: 1;
  display: flex;
  min-height: 0;
}

body.nh-v2 .exv2-page .exv2-pbox .exv2-pwrap {
  flex: 1;
  display: flex;
  min-width: 0;
  filter: var(--exv2-shadow-paper-soft);
}

body.nh-v2 .exv2-page .exv2-pbox .exv2-paper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: calc(var(--z) + 10px) 12px calc(var(--z) + 8px);
}

/* Carta vuota (area di caricamento o segnaposto): al massimo lunga come uno scontrino (1 a 2,1), il resto resta sotto la carta. */
body.nh-v2 .exv2-page .exv2-pbox.is-empty {
  align-items: flex-start;
}

body.nh-v2 .exv2-page .exv2-pbox.is-empty .exv2-pwrap {
  flex: 0 1 auto;
  width: 100%;
  aspect-ratio: 1 / 2.1;
  max-height: 100%;
}

body.nh-v2 .exv2-page .exv2-pbox.is-empty .exv2-paper {
  width: 100%;
  height: 100%;
}

/* ================= superfici cliccabili: area di caricamento, anteprima, miniature ================= */
/* Sono BlazorActionButton con contenuto proprio (come la riga fantasma della modale Giornata), non button nativi. Il tema DevExpress e quello dei .btn
   ridisegnano fondo, bordo, colore e ombra a riposo, al passaggio, in focus e da disabilitati (.dxbl-btn:not(...):hover, .btn-outline-secondary:focus,
   .btn:disabled), tutte con !important o con specificita' piu' alta di una classe sola: qui quelle proprieta' si dicono una volta, con !important, a
   partire da quattro variabili che ogni superficie ridefinisce per stato (--exv2-s-bd bordo, -bg fondo, -fg colore, -sh ombra). Senza variabili
   impostate la superficie e' trasparente e senza bordo. */
body.nh-v2 .exv2-page .btn.exv2-surf {
  min-width: 0;
  margin: 0;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
  opacity: 1;
  border-color: var(--exv2-s-bd, transparent) !important;
  background: var(--exv2-s-bg, transparent) !important;
  color: var(--exv2-s-fg, var(--text)) !important;
  box-shadow: var(--exv2-s-sh, none) !important;
}

/* L'area di caricamento: bottone tratteggiato che riempie la carta. */
body.nh-v2 .exv2-page .exv2-dz {
  --exv2-s-bd: var(--border-strong);
  --exv2-s-bg: var(--surface);
  --exv2-s-fg: var(--text);
  position: relative;
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(8px, 4cqw, 14px);
  min-height: 0;
  padding: 12px;
  border: 1.5px dashed;
  border-radius: var(--radius);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

body.nh-v2 .exv2-page .exv2-dz:hover:not(:disabled),
body.nh-v2 .exv2-page .exv2-receipt.dragging .exv2-dz {
  --exv2-s-bd: var(--primary);
  --exv2-s-bg: var(--primary-soft);
}

body.nh-v2 .exv2-page .exv2-dz-gl {
  display: grid;
  place-items: center;
  width: clamp(48px, 24cqw, 84px);
  height: clamp(48px, 24cqw, 84px);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  transition: background .15s;
}

body.nh-v2 .exv2-page .exv2-dz:hover:not(:disabled) .exv2-dz-gl,
body.nh-v2 .exv2-page .exv2-receipt.dragging .exv2-dz-gl {
  background: var(--surface);
}

body.nh-v2 .exv2-page .exv2-dz-gl .exv2-ic {
  width: 46%;
  height: 46%;
}

body.nh-v2 .exv2-page .exv2-dz b {
  font-size: clamp(14px, 6.4cqw, 19px);
  font-weight: 650;
  line-height: 1.3;
}

body.nh-v2 .exv2-page .exv2-dz small {
  color: var(--exv2-slate);
  font-size: clamp(12px, 4.8cqw, 14.5px);
  line-height: 1.35;
}

body.nh-v2 .exv2-page .exv2-dz.is-off {
  --exv2-s-bd: var(--border);
  --exv2-s-fg: var(--muted);
  cursor: not-allowed;
}

body.nh-v2 .exv2-page .exv2-dz.is-off .exv2-dz-gl {
  background: var(--bg-soft);
  color: var(--exv2-faint);
}

body.nh-v2 .exv2-page .exv2-dz.is-off b {
  color: var(--muted);
}

body.nh-v2 .exv2-page .exv2-dz.is-fail {
  --exv2-s-bd: color-mix(in srgb, var(--danger) 40%, var(--surface));
}

body.nh-v2 .exv2-page .exv2-dz.is-fail .exv2-dz-gl {
  background: var(--danger-soft);
  color: var(--danger);
}

body.nh-v2 .exv2-page .exv2-dz.is-fail:hover:not(:disabled) {
  --exv2-s-bd: var(--danger);
  --exv2-s-bg: var(--danger-soft);
}

body.nh-v2 .exv2-page .exv2-dz.is-fail:hover:not(:disabled) .exv2-dz-gl {
  background: var(--surface);
}

body.nh-v2 .exv2-page .exv2-dz .exv2-dz-err {
  color: var(--exv2-danger-ink);
  font-weight: 500;
}

/* Rimuove il caricamento fallito e permette di sceglierne un altro. */
body.nh-v2 .exv2-page .exv2-dismiss.btn {
  position: absolute;
  top: calc(var(--z) + 16px);
  right: 16px;
}

/* Da scanner e Da telefono stanno sempre in fondo al foglio, sotto una linea di strappo. */
body.nh-v2 .exv2-page .exv2-pacts {
  display: flex;
  justify-content: space-around;
  gap: 2px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1.5px dashed var(--border-strong);
}

@container (max-width: 160px) {
  body.nh-v2 .exv2-page .exv2-pacts .exv2-textbtn.btn {
    padding: 0 5px;
    font-size: 13px;
  }
}

/* Scontrino fantasma: la carta vuota ha la forma di uno scontrino (logo, righe, totale, codice a barre) in tinta del tema, cosi' si vede cosa manca.
   Solo decorazione (aria-hidden): altezze e larghezze delle barre scalano con la larghezza della carta (cqw), lo spazio con l'altezza che resta. */
body.nh-v2 .exv2-page .exv2-gh {
  --tint: color-mix(in srgb, var(--primary) 24%, var(--surface));
  --tint-hi: color-mix(in srgb, var(--primary) 70%, var(--surface));
  --gh-h: clamp(6px, 3.4cqw, 9px);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
  min-height: 0;
  margin-bottom: 10px;
  overflow: hidden;
  transition: opacity .25s;
}

body.nh-v2 .exv2-page .exv2-gh:has(+ .exv2-stamp) {
  margin-bottom: 0;
}

body.nh-v2 .exv2-page .exv2-gh i {
  display: block;
  flex: none;
  height: var(--gh-h);
  border-radius: 4px;
  background: var(--tint);
  transition: background .35s var(--exv2-ease);
  transition-delay: calc(var(--n, 0) * 55ms);
}

body.nh-v2 .exv2-page .exv2-gh .exv2-gh-logo {
  height: calc(var(--gh-h) * 1.6);
  width: 54%;
  margin: 0 auto 2px;
  border-radius: 7px;
}

body.nh-v2 .exv2-page .exv2-gh .exv2-gh-sub {
  width: 38%;
  height: calc(var(--gh-h) * .75);
  margin: 0 auto;
}

body.nh-v2 .exv2-page .exv2-gh .exv2-gh-sub.is-short {
  width: 28%;
}

body.nh-v2 .exv2-page .exv2-gh-cut {
  flex: none;
  height: 0;
  margin: 2px 0;
  border-top: 2px dotted color-mix(in srgb, var(--primary) 34%, var(--surface));
}

body.nh-v2 .exv2-page .exv2-gh-row {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

body.nh-v2 .exv2-page .exv2-gh-row i:first-child {
  width: var(--w, 52%);
}

body.nh-v2 .exv2-page .exv2-gh-row i:last-child {
  width: 17%;
}

body.nh-v2 .exv2-page .exv2-gh-row.is-total i:first-child {
  width: 34%;
  height: calc(var(--gh-h) * 1.2);
}

body.nh-v2 .exv2-page .exv2-gh-row.is-total i:last-child {
  width: 30%;
  height: calc(var(--gh-h) * 1.7);
  border-radius: 6px;
}

body.nh-v2 .exv2-page .exv2-gh-bars {
  flex: none;
  height: clamp(16px, 11cqw, 26px);
  margin-top: 4px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--tint) 0 3px, transparent 3px 5px, var(--tint) 5px 6px, transparent 6px 9px, var(--tint) 9px 12px, transparent 12px 14px);
  transition: opacity .3s;
}

body.nh-v2 .exv2-page .exv2-gh.is-soft {
  opacity: .55;
}

/* "Si stampa": con il mouse sulla zona di caricamento, il fuoco da tastiera o un file in trascinamento le righe si riempiono una dopo l'altra. */
body.nh-v2 .exv2-page .exv2-receipt:has(.exv2-dz:hover:not(:disabled)) .exv2-gh i,
body.nh-v2 .exv2-page .exv2-receipt:has(.exv2-dz:focus-visible) .exv2-gh i,
body.nh-v2 .exv2-page .exv2-receipt.dragging .exv2-gh i {
  background: var(--tint-hi);
}

body.nh-v2 .exv2-page .exv2-receipt:has(.exv2-dz:hover:not(:disabled)) .exv2-gh-bars,
body.nh-v2 .exv2-page .exv2-receipt:has(.exv2-dz:focus-visible) .exv2-gh-bars,
body.nh-v2 .exv2-page .exv2-receipt.dragging .exv2-gh-bars {
  opacity: .9;
}

/* Con lo scontrino fantasma la zona di caricamento non riempie piu' la carta: sta sotto, compatta (disco pieno con la freccia, due righe). */
body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz {
  --exv2-s-bd: color-mix(in srgb, var(--primary) 55%, var(--surface));
  --exv2-s-bg: color-mix(in srgb, var(--primary) 6%, var(--surface));
  --exv2-s-fg: var(--primary-ink);
  flex: none;
  gap: clamp(3px, 1.8cqw, 5px);
  padding: clamp(8px, 4cqw, 14px) 10px clamp(8px, 3.6cqw, 12px);
  border-width: 2px;
  border-radius: 10px;
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz:hover:not(:disabled),
body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz:focus-visible,
body.nh-v2 .exv2-page .exv2-receipt.dragging .exv2-gh ~ .exv2-dz {
  --exv2-s-bd: var(--primary);
  --exv2-s-bg: var(--primary-soft);
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz:focus-visible {
  outline-offset: 3px;
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz .exv2-dz-gl {
  width: clamp(30px, 17cqw, 44px);
  height: clamp(30px, 17cqw, 44px);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .22);
  transition: transform .2s var(--exv2-ease);
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz:hover:not(:disabled) .exv2-dz-gl,
body.nh-v2 .exv2-page .exv2-receipt.dragging .exv2-gh ~ .exv2-dz .exv2-dz-gl {
  background: var(--primary);
  transform: translateY(-2px);
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz b {
  font-size: clamp(13.5px, 6cqw, 17px);
  font-weight: 750;
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz small {
  color: var(--exv2-slate);
  font-size: clamp(12px, 4.6cqw, 13.5px);
}

/* Senza tipo: zona spenta, due parole. */
body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz.is-off {
  --exv2-s-bd: var(--border-strong);
  --exv2-s-bg: var(--surface-soft);
  --exv2-s-fg: var(--exv2-slate);
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz.is-off .exv2-dz-gl {
  background: var(--border-strong);
  color: #fff;
  box-shadow: none;
  transform: none;
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz.is-off b {
  color: var(--exv2-slate);
}

/* Zona spenta senza etichetta "Prima il tipo" (Disabled senza DisabledLabel, Busy nel salvataggio): stessa palette grigia, nessun effetto. */
body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz:disabled:not(.is-off) {
  --exv2-s-bd: var(--border-strong);
  --exv2-s-bg: var(--surface-soft);
  --exv2-s-fg: var(--exv2-slate);
  cursor: not-allowed;
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz:disabled:not(.is-off) .exv2-dz-gl {
  background: var(--border-strong);
  color: #fff;
  box-shadow: none;
  transform: none;
}

body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz:disabled:not(.is-off) b {
  color: var(--exv2-slate);
}

/* Timbro della sola lettura senza scontrino: due parole, nessuna azione perche' non si puo' caricare. */
body.nh-v2 .exv2-page .exv2-stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  rotate: -8deg;
  padding: 7px clamp(10px, 8cqw, 16px) 8px;
  border: 2.5px solid var(--exv2-amber);
  border-radius: 10px;
  outline: 1.5px solid var(--exv2-amber);
  outline-offset: 3px;
  background: color-mix(in srgb, color-mix(in srgb, var(--exv2-amber) 13%, var(--surface)) 94%, transparent);
  color: var(--exv2-amber-ink);
  font-size: clamp(13px, 8.4cqw, 19px);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(15, 23, 42, .2);
  animation: exv2-stamp .42s var(--exv2-ease) both;
}

@keyframes exv2-stamp {
  from { opacity: 0; scale: 1.5; }
  60% { opacity: 1; }
  to { opacity: 1; scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body.nh-v2 .exv2-page .exv2-stamp { animation: none; }
  body.nh-v2 .exv2-page .exv2-gh i,
  body.nh-v2 .exv2-page .exv2-gh-bars,
  body.nh-v2 .exv2-page .exv2-gh ~ .exv2-dz .exv2-dz-gl { transition: none; }
}

/* Il documento sta in alto nel foglio (il bianco resta in fondo come su una striscia di carta). */
body.nh-v2 .exv2-page .exv2-pview {
  --exv2-s-fg: var(--text);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  overflow: hidden;
  container-type: size;
}

body.nh-v2 .exv2-page .exv2-pview:disabled {
  cursor: default;
}

body.nh-v2 .exv2-page .exv2-pview:focus-visible {
  outline-offset: -2px;
}

body.nh-v2 .exv2-page .exv2-doc-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}

body.nh-v2 .exv2-page .exv2-doc-ph {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: auto;
  color: var(--muted);
}

body.nh-v2 .exv2-page .exv2-doc-ph .exv2-ic {
  width: clamp(36px, 32cqw, 72px);
  height: clamp(36px, 32cqw, 72px);
  stroke-width: 1.5;
}

body.nh-v2 .exv2-page .exv2-doc-ph b {
  font-size: clamp(13px, 9cqw, 18px);
  font-weight: 700;
  letter-spacing: .04em;
}

body.nh-v2 .exv2-page .exv2-ic {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Caricamento in corso: scheletro del documento. */
body.nh-v2 .exv2-page .exv2-skl {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 9px;
  padding-top: 6px;
}

body.nh-v2 .exv2-page .exv2-sk {
  display: block;
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--border) 70%, var(--surface)) 0%, var(--surface-soft) 50%, color-mix(in srgb, var(--border) 70%, var(--surface)) 100%);
  background-size: 200% 100%;
  animation: exv2-shim 1.5s linear infinite;
}

body.nh-v2 .exv2-page .exv2-sk.is-on-head {
  background: rgba(255, 255, 255, .35);
  animation: none;
}

/* Barra con nome, dimensione e azioni. */
body.nh-v2 .exv2-page .exv2-abar {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.nh-v2 .exv2-page .exv2-abar-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 0 2px;
  color: var(--exv2-ink);
  font-size: var(--exv2-ssm);
}

body.nh-v2 .exv2-page .exv2-abar-fn {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.nh-v2 .exv2-page .exv2-abar-size {
  flex: none;
  color: var(--exv2-slate);
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-page .exv2-abar-btns {
  display: flex;
  align-items: center;
  gap: 2px;
}

body.nh-v2 .exv2-page .exv2-abar-btns .exv2-ib-danger {
  margin-left: auto;
}

/* Pulsanti icona (BlazorIconButton / BlazorIconLink): senza riquadro, in rilievo solo al passaggio. !important perche' il tema DevExpress dei .btn forza fondo e bordo. */
body.nh-v2 .exv2-page .btn.exv2-ib {
  display: inline-grid;
  place-items: center;
  width: calc(var(--exv2-ibs) + 2px);
  height: calc(var(--exv2-ibs) + 2px);
  min-width: 0;
  padding: 0;
  border: 0 !important;
  border-radius: var(--radius);
  background: none !important;
  box-shadow: none !important;
  color: var(--exv2-slate) !important;
}

body.nh-v2 .exv2-page .btn.exv2-ib:hover:not(:disabled) {
  background: var(--bg-soft) !important;
  color: var(--text) !important;
}

body.nh-v2 .exv2-page .btn.exv2-ib-danger:hover:not(:disabled) {
  background: var(--danger-soft) !important;
  color: var(--exv2-danger-ink) !important;
}

body.nh-v2 .exv2-page .btn.exv2-ib:disabled {
  color: var(--exv2-faint) !important;
  cursor: not-allowed;
}

body.nh-v2 .exv2-page .btn.exv2-ib svg {
  width: 18px;
  height: 18px;
}

/* Le icone condivise (RowActionIcons: occhio, scarica, cestino; la freccia Indietro) dichiarano al massimo fill="none": il tratto e la misura li dava
   site.css con .expense-icon-button, classe che ExtraClass (exv2-ib, exv2-hero-back) sostituisce, e senza tratto restavano invisibili. Qui lo stesso tratto
   di ExpenseV2Icons (2px, estremi tondi, colore del testo) e la stessa misura, solo per questi due pulsanti. I glifi di ExpenseV2Icons (.exv2-ic) hanno il tratto proprio. */
body.nh-v2 .exv2-page .btn.exv2-ib .button-icon-svg,
body.nh-v2 .exv2-page .btn.exv2-hero-back .button-icon-svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pulsanti di testo (BlazorActionButton): Da scanner, Da telefono, Aggiorna. */
body.nh-v2 .exv2-page .btn.exv2-textbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: calc(30px + (var(--exv2-bh) - 38px) * .79);
  padding: 0 10px;
  border: 0 !important;
  border-radius: var(--radius);
  background: none !important;
  box-shadow: none !important;
  color: var(--primary-ink) !important;
  font-size: calc(var(--exv2-bfs) - .5px);
  font-weight: 700;
  white-space: nowrap;
}

body.nh-v2 .exv2-page .btn.exv2-textbtn:hover:not(:disabled) {
  background: var(--primary-soft) !important;
}

body.nh-v2 .exv2-page .btn.exv2-textbtn:disabled {
  color: var(--muted) !important;
  cursor: not-allowed;
}

/* Miniature degli allegati. */
body.nh-v2 .exv2-page .exv2-ths {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

body.nh-v2 .exv2-page .exv2-th {
  --exv2-s-bd: var(--border-strong);
  --exv2-s-bg: var(--surface);
  --exv2-s-fg: var(--text);
  position: relative;
  flex: none;
  display: block;
  width: 30px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: 1px solid;
  border-radius: var(--radius);
  font: inherit;
  cursor: pointer;
}

body.nh-v2 .exv2-page .exv2-th:hover:not(:disabled) {
  --exv2-s-bd: var(--exv2-slate);
}

body.nh-v2 .exv2-page .exv2-th[aria-current="true"] {
  --exv2-s-bd: var(--primary);
  --exv2-s-sh: 0 0 0 1.5px var(--primary);
}

body.nh-v2 .exv2-page .exv2-th-in {
  display: block;
  width: 100%;
  height: 100%;
}

body.nh-v2 .exv2-page .exv2-th-in img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

body.nh-v2 .exv2-page .exv2-th-ph {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

body.nh-v2 .exv2-page .exv2-th.is-add {
  --exv2-s-bg: transparent;
  --exv2-s-fg: var(--primary-ink);
  display: grid;
  place-items: center;
  border: 1.5px dashed;
}

body.nh-v2 .exv2-page .exv2-th.is-add .exv2-ic {
  width: 16px;
  height: 16px;
}

body.nh-v2 .exv2-page .exv2-th.is-add:hover:not(:disabled) {
  --exv2-s-bd: var(--primary);
  --exv2-s-bg: var(--primary-soft);
}

body.nh-v2 .exv2-page .exv2-th.is-add:disabled {
  --exv2-s-fg: var(--muted);
  cursor: not-allowed;
}

/* Un altro file non caricato mentre la carta mostra gia' un documento: una riga sotto le miniature (Riprova e Rimuovi). Se la carta e' vuota il fallimento
   sta invece nella carta stessa (.exv2-dz.is-fail). */
body.nh-v2 .exv2-page .exv2-fbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "gl tx x"
    ". rt .";
  align-items: start;
  column-gap: 6px;
  padding: 6px 2px 2px 8px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--surface));
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--exv2-danger-ink);
  font-size: var(--exv2-ssm);
  line-height: 1.3;
}

body.nh-v2 .exv2-page .exv2-fbar-gl {
  grid-area: gl;
  display: grid;
  margin-top: 1px;
}

body.nh-v2 .exv2-page .exv2-fbar-gl .exv2-ic {
  width: 16px;
  height: 16px;
}

body.nh-v2 .exv2-page .exv2-fbar-tx {
  grid-area: tx;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-weight: 500;
}

body.nh-v2 .exv2-page .exv2-fbar .btn.exv2-ib {
  grid-area: x;
  margin-top: -3px;
}

body.nh-v2 .exv2-page .exv2-fbar .btn.exv2-textbtn {
  grid-area: rt;
  justify-self: start;
  margin: 0 0 0 -8px;
}

/* L'input file sta sempre nel DOM ma non si vede. */
body.nh-v2 .exv2-page .exv2-receipt-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ================= colonna 2: la spesa ================= */
/* Il form non decide mai l'altezza della riga (contain: size): sono i campi e la Note a stare nell'altezza delle colonne. Una sola griglia: quattro
   righe di campi (cinque con l'Azienda) e la Note come ultima. La Note prende per prima lo spazio che avanza, fino a --exv2-note-max; se ne
   avanza ancora, si divide in parti uguali tra gli spazi tra le righe (space-between): le tre colonne finiscono alla stessa altezza. */
body.nh-v2 .exv2-page .exv2-form {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto) var(--exv2-note-row);
  column-gap: 16px;
  row-gap: var(--exv2-g);
  align-content: space-between;
  container-type: inline-size;
  contain: size;
}

body.nh-v2 .exv2-page .exv2-form.has-company {
  grid-template-rows: repeat(5, auto) var(--exv2-note-row);
}

/* Diaria: una riga di campi in piu' (Tipo | Mezza giornata, poi Dal | Al | Km, poi Descrizione | Giorni). */
body.nh-v2 .exv2-page .exv2-form.is-diaria {
  grid-template-rows: repeat(5, auto) var(--exv2-note-row);
}

body.nh-v2 .exv2-page .exv2-form.is-diaria.has-company {
  grid-template-rows: repeat(6, auto) var(--exv2-note-row);
}

body.nh-v2 .exv2-page .exv2-form.is-diaria.is-compact {
  grid-template-rows: repeat(5, auto) auto;
}

body.nh-v2 .exv2-page .exv2-form.is-diaria.is-compact.has-company {
  grid-template-rows: repeat(6, auto) auto;
}

/* "Mezza giornata" accanto alla Descrizione, centrata sull'altezza del campo. */
body.nh-v2 .exv2-page .exv2-fld-check {
  align-self: end;
  display: flex;
  align-items: center;
  height: var(--exv2-fh);
}

/* Sola lettura con Note vuota: la riga Note e' compatta (un campo). */
body.nh-v2 .exv2-page .exv2-form.is-compact {
  grid-template-rows: repeat(4, auto) auto;
}

body.nh-v2 .exv2-page .exv2-form.is-compact.has-company {
  grid-template-rows: repeat(5, auto) auto;
}

body.nh-v2 .exv2-page .exv2-grp,
body.nh-v2 .exv2-page .exv2-pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 16px;
  min-width: 0;
}

body.nh-v2 .exv2-page .exv2-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.nh-v2 .exv2-page .exv2-span-2 { grid-column: span 2; }
body.nh-v2 .exv2-page .exv2-span-4 { grid-column: span 4; }
body.nh-v2 .exv2-page .exv2-span-6 { grid-column: 1 / -1; }

/* Form stretto: Tipo e Data stanno ancora sulla stessa riga ma la Data ha una colonna fissa e il Tipo il resto, cosi' il nome del tipo non si tronca. */
@container (max-width: 470px) {
  body.nh-v2 .exv2-page .exv2-grp.is-type-date {
    grid-template-columns: minmax(0, 1fr) 136px;
  }

  body.nh-v2 .exv2-page .exv2-grp.is-type-date > * {
    grid-column: auto;
  }

  body.nh-v2 .exv2-page .exv2-pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  }
}

/* Etichetta sopra il campo (nel sito: label.field > span; la data ha la label dentro .standard-date-input). */
body.nh-v2 .exv2-page .exv2-form label.field,
body.nh-v2 .exv2-page .exv2-form .standard-date-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--exv2-lmb);
  min-width: 0;
}

body.nh-v2 .exv2-page .exv2-form label.field > span:first-child,
body.nh-v2 .exv2-page .exv2-form .standard-date-input > label {
  color: var(--exv2-ink);
  font-size: var(--exv2-lfs);
  font-weight: 500;
  line-height: var(--exv2-llh);
  letter-spacing: 0;
  text-transform: none;
}

body.nh-v2 .exv2-page .exv2-form .required-mark {
  color: var(--danger);
  font-weight: 600;
}

/* La label della data e' una griglia nel sito: in blocco, cosi' l'asterisco resta sulla stessa riga (come in forms-v2.css). */
body.nh-v2 .exv2-page .exv2-form .standard-date-input > label {
  display: block;
  margin: 0;
}

body.nh-v2 .exv2-page .exv2-form .standard-date-input.required > label::after {
  content: " *";
  color: var(--danger);
  font-weight: 600;
}

body.nh-v2 .exv2-page .exv2-fld {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  min-width: 0;
}

/* Campi modificabili: bordo scuro, raggio del sito, altezza e carattere che scalano con lo schermo. */
body.nh-v2 .exv2-page .exv2-form :is(
    .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly),
    textarea.form-control:not(:disabled, [readonly])
  ) {
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: none;
  color: var(--text);
  font-size: var(--exv2-fs);
  transition: border-color .12s, box-shadow .12s;
}

/* .exv2-scheda in piu': combo-v2.css fissa l'altezza di tutte le combo (29,3px) con la stessa specificita' del resto, qui si deve vincere a prescindere dall'ordine dei fogli. */
body.nh-v2 .exv2-page .exv2-scheda .exv2-form .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly, .dxbl-memo-edit) {
  height: var(--exv2-fh);
  min-height: var(--exv2-fh);
  padding: 0;
}

body.nh-v2 .exv2-page .exv2-form .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly) :is(input, .dxbl-text-edit-input) {
  min-height: 0;
  height: calc(var(--exv2-fh) - 2px);
  padding: 0 calc(12px + (var(--exv2-fh) - 38px) * .105);
  background: transparent;
  color: var(--text);
  font-size: var(--exv2-fs);
}

body.nh-v2 .exv2-page .exv2-form .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly) input::placeholder {
  color: var(--muted);
}

body.nh-v2 .exv2-page .exv2-form :is(
    .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly),
    textarea.form-control:not(:disabled, [readonly])
  ):hover {
  border-color: var(--exv2-ink);
}

body.nh-v2 .exv2-page .exv2-form :is(
    .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly):focus-within,
    textarea.form-control:not(:disabled, [readonly]):focus
  ) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .25);
  outline: 0;
}

/* Freccia del combo e calendario: dentro il bordo, senza riquadro proprio. */
body.nh-v2 .exv2-page .exv2-form :is(.standard-date-edit, .blazor-combo-box).dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly) .dxbl-btn-group-right {
  background: transparent !important;
  border-left: 0 !important;
  box-shadow: none !important;
}

body.nh-v2 .exv2-page .exv2-form :is(.standard-date-edit, .blazor-combo-box).dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly) :is(button, .dxbl-btn, .dxbl-edit-btn-dropdown) {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

body.nh-v2 .exv2-page .exv2-form :is(.standard-date-edit, .blazor-combo-box).dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly) :is(button, .dxbl-btn, .dxbl-edit-btn-dropdown):hover {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

body.nh-v2 .exv2-page .exv2-form :is(.standard-date-edit, .blazor-combo-box).dxbl-text-edit svg {
  width: var(--exv2-ic);
  height: var(--exv2-ic);
}

/* Disabilitato in modifica (Azienda fissa, Commessa senza cliente): tratteggiato e spento. !important perche' site.css forza questi campi a testo nudo. */
body.nh-v2 .exv2-page .exv2-scheda:not(.is-view) .exv2-form :is(.dxbl-text-edit.dxbl-disabled, textarea.form-control:disabled) {
  height: var(--exv2-fh);
  min-height: var(--exv2-fh);
  border: 1px dashed var(--border-strong) !important;
  border-radius: var(--radius);
  background: var(--surface-soft) !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
  font-size: var(--exv2-fs);
  cursor: not-allowed;
}

body.nh-v2 .exv2-page .exv2-scheda:not(.is-view) .exv2-form .dxbl-text-edit.dxbl-disabled :is(input, .dxbl-text-edit-input) {
  height: calc(var(--exv2-fh) - 2px);
  padding: 0 calc(12px + (var(--exv2-fh) - 38px) * .105);
  font-size: var(--exv2-fs);
}

/* Sola lettura, variante B (come le altre pagine v2): riquadro tenue senza bordo ne' freccia, valore in evidenza. */
body.nh-v2 .exv2-page .exv2-scheda.is-view .exv2-form :is(
    .dxbl-text-edit.dxbl-disabled,
    .dxbl-text-edit.dxbl-readonly,
    textarea.form-control:is(:disabled, [readonly]),
    .dxbl-memo-edit:is(.dxbl-disabled, .dxbl-readonly)
  ) {
  min-height: var(--exv2-fh);
  border: 0 !important;
  border-radius: var(--radius);
  background: var(--surface-soft) !important;
  box-shadow: none !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  font-size: var(--exv2-fs);
  font-weight: 650 !important;
  opacity: 1 !important;
  cursor: default !important;
}

/* I campi a una riga hanno l'altezza dei campi; la Note (textarea e contenitore) no: la decide la colonna (100%, vedi .exv2-note) e solo se e' vuota
   (.is-compact) resta di una riga. Un'altezza qui batterebbe quelle regole e la Note letta resterebbe di una riga anche con piu' testo.
   Il contenitore di DxMemo ha anche la classe .dxbl-text-edit (.dxbl-text-edit.dxbl-memo-edit): per questo si esclude con :not(.dxbl-memo-edit). */
body.nh-v2 .exv2-page .exv2-scheda.is-view .exv2-form .dxbl-text-edit:not(.dxbl-memo-edit):is(.dxbl-disabled, .dxbl-readonly) {
  height: var(--exv2-fh);
}

body.nh-v2 .exv2-page .exv2-scheda.is-view .exv2-form .dxbl-text-edit:not(.dxbl-memo-edit) :is(input, .dxbl-text-edit-input) {
  height: calc(var(--exv2-fh) - 2px);
  padding: 0 calc(12px + (var(--exv2-fh) - 38px) * .105);
  background: transparent !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  font-size: var(--exv2-fs);
  font-weight: 650 !important;
  cursor: default !important;
}

body.nh-v2 .exv2-page .exv2-scheda.is-view .exv2-form :is(.dxbl-edit-btn-dropdown, .dxbl-btn-group-right, .dxbl-edit-btn-spin) {
  display: none !important;
}

/* Importo e Km: numeri a destra in cifre tabulari; il simbolo dell'unita' sta dentro il campo (la riga etichetta e' alta quanto --exv2-llh + --exv2-lmb). */
body.nh-v2 .exv2-page .exv2-fld.has-suffix input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 34px !important;
}

body.nh-v2 .exv2-page .exv2-fld.has-suffix[data-suffix="km"] input {
  padding-right: 42px !important;
}

body.nh-v2 .exv2-page .exv2-fld.has-suffix::after {
  content: attr(data-suffix);
  position: absolute;
  right: 12px;
  top: calc(var(--exv2-llh) + var(--exv2-lmb) + var(--exv2-fh) / 2);
  transform: translateY(-50%);
  color: var(--exv2-slate);
  font-size: calc(var(--exv2-fs) + 1.5px);
  font-weight: 600;
  pointer-events: none;
}

body.nh-v2 .exv2-page .exv2-scheda.is-view .exv2-fld.has-suffix::after {
  color: var(--exv2-ink);
}

body.nh-v2 .exv2-page .exv2-fld.is-bad .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly) {
  border-color: var(--danger);
}

body.nh-v2 .exv2-page .exv2-fld.is-bad .dxbl-text-edit:not(.dxbl-disabled, .dxbl-readonly):focus-within {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}

/* Zona sotto il campo: errore del massimale bloccante e misuratore, in colonna. */
body.nh-v2 .exv2-page .exv2-fld-sub {
  display: grid;
  min-width: 0;
}

/* Errore sotto il campo (massimale bloccante): una riga, mai a capo. */
body.nh-v2 .exv2-page .exv2-err {
  margin-top: var(--exv2-lmb);
  color: var(--exv2-danger-ink);
  font-size: var(--exv2-lfs);
  font-weight: 500;
  line-height: var(--exv2-llh);
}

/* Misuratore del massimale sotto l'Importo. */
body.nh-v2 .exv2-page .exv2-gauge {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

body.nh-v2 .exv2-page .exv2-gauge-track {
  position: relative;
  height: var(--exv2-trk);
  border-radius: 3px;
  background: var(--border);
}

body.nh-v2 .exv2-page .exv2-gauge-fill {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: var(--primary);
  /* L'elemento copre tutta la pista e la parte visibile si scopre dal lato destro: niente larghezza animata. */
  clip-path: inset(0 calc(100% - var(--exv2-fill, 0%)) 0 0 round 3px);
  transition: clip-path .25s var(--exv2-ease), background .15s;
}

body.nh-v2 .exv2-page .exv2-gauge.is-over .exv2-gauge-fill {
  background: var(--exv2-amber);
}

body.nh-v2 .exv2-page .exv2-gauge.is-block .exv2-gauge-fill {
  background: var(--danger);
}

/* Oltre il massimale la parte eccedente e' a righe oblique: lo stato si legge anche senza il colore. */
body.nh-v2 .exv2-page .exv2-gauge:is(.is-over, .is-block) .exv2-gauge-fill::after {
  content: "";
  position: absolute;
  inset: 0 0 0 var(--exv2-hatch);
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 5px);
}

body.nh-v2 .exv2-page .exv2-gauge-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--exv2-ink);
}

body.nh-v2 .exv2-page .exv2-gauge-label {
  justify-self: end;
  color: var(--exv2-slate);
  font-size: var(--exv2-lfs);
  font-weight: 500;
  line-height: var(--exv2-llh);
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-page .exv2-gauge.is-over .exv2-gauge-label {
  color: var(--exv2-amber-ink);
  font-weight: 650;
}

body.nh-v2 .exv2-page .exv2-gauge.is-block .exv2-gauge-label {
  color: var(--exv2-danger-ink);
  font-weight: 650;
}

/* Chilometri come equazione: km x tariffa = importo, sotto Km e Descrizione, a tutta larghezza e su una riga sola (stessa altezza del misuratore). */
body.nh-v2 .exv2-page .exv2-eq {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0 6px;
  min-height: calc(var(--exv2-sub) - 4px);
  margin-top: 4px;
  color: var(--exv2-ink);
  font-size: var(--exv2-eqfs);
  font-variant-numeric: tabular-nums;
  line-height: calc(var(--exv2-sub) - 4px);
  white-space: nowrap;
}

body.nh-v2 .exv2-page .exv2-eq-n {
  color: var(--text);
  font-weight: 600;
}

body.nh-v2 .exv2-page .exv2-eq-n.is-warn {
  color: var(--exv2-amber-ink);
}

body.nh-v2 .exv2-page .exv2-eq-res {
  margin-left: 2px;
  color: var(--text);
  font-size: var(--exv2-eqres);
  font-weight: 800;
  letter-spacing: -.01em;
}

body.nh-v2 .exv2-page .exv2-eq-na {
  color: var(--exv2-danger-ink);
  font-weight: 600;
}

body.nh-v2 .exv2-page .exv2-eq .btn.exv2-textbtn {
  height: calc(var(--exv2-sub) - 5px);
  margin-left: 4px;
  padding: 0 8px;
}

/* Interruttori in riga, allineati a sinistra (BlazorCheckboxField, un solo aspetto per tutto il sito). */
body.nh-v2 .exv2-page .exv2-switches {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 32px;
  padding-top: 2px;
}

/* Note: ultima riga, prende lo spazio che avanza. */
body.nh-v2 .exv2-page .exv2-form label.field.exv2-note {
  grid-column: 1 / -1;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

body.nh-v2 .exv2-page .exv2-note > :not(span),
body.nh-v2 .exv2-page .exv2-note .dxbl-memo-edit {
  height: 100%;
  min-height: 0;
}

body.nh-v2 .exv2-page .exv2-note textarea.form-control {
  height: 100%;
  min-height: 0;
  padding: calc(7px + (var(--exv2-fh) - 38px) * .184) calc(12px + (var(--exv2-fh) - 38px) * .105);
  font-size: var(--exv2-fs);
  line-height: 1.4;
  resize: none;
}

body.nh-v2 .exv2-page .exv2-form.is-compact .exv2-note textarea.form-control {
  height: var(--exv2-fh);
}

/* ================= colonna 3: il foglio del rendiconto (punto focale) ================= */
body.nh-v2 .exv2-page .exv2-sheet {
  min-width: 0;
  display: flex;
  contain: size;
}

body.nh-v2 .exv2-page .exv2-sheet .exv2-pwrap {
  flex: 1;
  display: flex;
  min-width: 0;
}

body.nh-v2 .exv2-page .exv2-sheet .exv2-paper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 0 calc(var(--z) + 12px);
}

body.nh-v2 .exv2-page .exv2-shw {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.nh-v2 .exv2-page .exv2-shw.is-swap {
  animation: exv2-swap .18s var(--exv2-ease);
}

/* Testata a tinta piena del tema: e' il primo blocco di colore dopo il titolo della pagina. */
body.nh-v2 .exv2-page .exv2-sh-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: calc(var(--z) + var(--exv2-shp)) var(--exv2-shx) var(--exv2-shp);
  background: var(--primary);
  color: #fff;
}

body.nh-v2 .exv2-page .exv2-sh-head.is-loading {
  padding-bottom: 18px;
}

/* Rendiconto che non esiste ancora: testata tratteggiata. */
body.nh-v2 .exv2-page .exv2-sh-head.is-new {
  padding: calc(var(--z) + var(--exv2-shp) + 6px) calc(var(--exv2-shx) + 6px) calc(var(--exv2-shp) + 6px);
  outline: 1.5px dashed rgba(255, 255, 255, .85);
  outline-offset: -10px;
}

body.nh-v2 .exv2-page .exv2-sh-t {
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: var(--exv2-st);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
}

body.nh-v2 .exv2-page .exv2-sh-p {
  grid-column: 1 / -1;
  color: #fff;
  font-size: calc(var(--exv2-ssm) + .5px);
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-page .exv2-sh-head .status-pill.exv2-sh-pill {
  border-color: transparent;
  background: var(--surface);
  color: var(--primary-ink);
  font-size: calc(var(--exv2-lfs) - .5px);
  min-height: calc(26px + (var(--exv2-lfs) - 12.5px) * 2.08);
}

body.nh-v2 .exv2-page .exv2-sh-head .status-pill.is-submitted {
  color: var(--exv2-amber-ink);
}

body.nh-v2 .exv2-page .exv2-sh-head .status-pill.is-approved {
  color: var(--exv2-ok-ink);
}

body.nh-v2 .exv2-page .exv2-sh-head .status-pill.is-rejected {
  color: var(--exv2-danger-ink);
}

/* Con piu' rendiconti aperti il titolo del foglio E' il combo di scelta (BlazorEntitySelectField senza etichetta). */
body.nh-v2 .exv2-page .exv2-sh-t label.exv2-sheet-pick {
  display: block;
  margin: calc(-5px - (var(--exv2-st) - 22px) * .775) 0 calc(-5px - (var(--exv2-st) - 22px) * .775) -10px;
}

body.nh-v2 .exv2-page .exv2-sheet-pick .blazor-combo-box.dxbl-text-edit {
  width: auto;
  max-width: 100%;
  height: calc(34px + (var(--exv2-st) - 22px) * 1.55);
  min-height: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none !important;
  box-shadow: none;
  color: #fff !important;
  font-size: var(--exv2-st);
  font-weight: 800;
  letter-spacing: -.01em;
}

body.nh-v2 .exv2-page .exv2-sheet-pick .blazor-combo-box.dxbl-text-edit :is(input, .dxbl-text-edit-input) {
  height: 100%;
  padding: 0 8px 0 10px;
  background: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: var(--exv2-st);
  font-weight: 800;
  text-overflow: ellipsis;
}

body.nh-v2 .exv2-page .exv2-sheet-pick .blazor-combo-box.dxbl-text-edit :is(button, .dxbl-btn, .dxbl-edit-btn-dropdown) {
  background: transparent !important;
  color: #fff !important;
}

body.nh-v2 .exv2-page .exv2-sheet-pick .blazor-combo-box.dxbl-text-edit:hover {
  border-color: rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .14) !important;
}

body.nh-v2 .exv2-page .exv2-sheet-pick .blazor-combo-box.dxbl-text-edit:focus-within {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .4);
}

/* Righe del foglio: se non ci stanno nell'altezza se ne mostrano meno e le altre si riassumono in "+N righe" (misura in nh-expense-sheet.js). */
body.nh-v2 .exv2-page .exv2-rws {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 6px 12px 0;
  overflow: hidden;
  list-style: none;
}

body.nh-v2 .exv2-page .exv2-rw {
  flex: 1 1 40px;
  min-height: var(--exv2-rwmin);
  max-height: var(--exv2-rwmax);
  display: grid;
  grid-template-columns: calc(40px + (var(--exv2-ssm) - 12.5px) * 3.2) 3px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 9px;
  padding: 2px 6px 2px 8px;
  border-bottom: 1px solid var(--exv2-line);
}

body.nh-v2 .exv2-page .exv2-rw:last-child {
  border-bottom-color: transparent;
}

body.nh-v2 .exv2-page .exv2-rw-dt {
  color: var(--exv2-slate);
  font-size: var(--exv2-ssm);
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-page .exv2-rw-tk {
  align-self: center;
  width: 3px;
  height: calc(28px + (var(--exv2-sfs) - 14px) * 2);
  border-radius: 2px;
  background: var(--c, var(--border-strong));
}

body.nh-v2 .exv2-page .exv2-rw-tx {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

body.nh-v2 .exv2-page .exv2-rw-tx b {
  overflow: hidden;
  font-size: var(--exv2-sfs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.nh-v2 .exv2-page .exv2-rw-tx small {
  overflow: hidden;
  color: var(--exv2-slate);
  font-size: var(--exv2-ssm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.nh-v2 .exv2-page .exv2-rw-am {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: var(--exv2-sfs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-page .exv2-chip {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: calc(var(--exv2-ssm) - 1.5px);
  font-weight: 700;
  line-height: 1.5;
}

/* La spesa in compilazione (riga fantasma, si scrive in diretta) e quella che si sta guardando. */
body.nh-v2 .exv2-page .exv2-rw.is-ghost,
body.nh-v2 .exv2-page .exv2-rw.is-here {
  background: var(--primary-soft);
}

body.nh-v2 .exv2-page .exv2-rw.is-ghost {
  margin-left: -2px;
  border-left: 2px dashed var(--primary);
  border-bottom-color: transparent;
}

body.nh-v2 .exv2-page .exv2-rw.is-here {
  border-bottom-color: transparent;
  box-shadow: inset 3px 0 0 var(--primary);
}

body.nh-v2 .exv2-page .exv2-rw.is-ghost.is-print {
  animation: exv2-print .28s var(--exv2-ease) both;
}

/* Valore non ancora inserito: barra tratteggiata. */
body.nh-v2 .exv2-page .exv2-dsh {
  display: block;
  height: 9px;
  border: 1.5px dashed var(--exv2-faint);
  border-radius: 4px;
}

body.nh-v2 .exv2-page .exv2-rw.is-more {
  flex: 0 0 28px;
  min-height: 28px;
}

body.nh-v2 .exv2-page .exv2-rw-more {
  grid-column: 1 / -1;
  color: var(--exv2-slate);
  font-size: var(--exv2-ssm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Piede come uno scontrino: voci con puntini guida; gia' comprensivo della spesa in compilazione. Il Totale non e' mai il numero piu' grande della pagina. */
body.nh-v2 .exv2-page .exv2-sf {
  display: grid;
  gap: 6px;
  margin: 6px var(--exv2-shx) 0;
  padding-top: 10px;
  border-top: 2px dashed var(--border-strong);
}

body.nh-v2 .exv2-page .exv2-ld {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: var(--exv2-sfs);
}

body.nh-v2 .exv2-page .exv2-ld-l {
  color: var(--exv2-ink);
  font-weight: 500;
}

body.nh-v2 .exv2-page .exv2-ld-d {
  flex: 1;
  min-width: 14px;
  border-bottom: 2px dotted var(--exv2-faint);
  transform: translateY(-3px);
}

body.nh-v2 .exv2-page .exv2-ld-v {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-page .exv2-ld.is-total {
  margin-top: 2px;
}

body.nh-v2 .exv2-page .exv2-ld.is-total .exv2-ld-l {
  color: var(--text);
  font-size: calc(var(--exv2-sfs) + 1px);
  font-weight: 800;
}

body.nh-v2 .exv2-page .exv2-ld.is-total .exv2-ld-v {
  font-size: var(--exv2-tot);
  font-weight: 800;
  letter-spacing: -.01em;
}

body.nh-v2 .exv2-page .exv2-ld.is-total .exv2-ld-v small {
  margin-left: 3px;
  color: var(--exv2-slate);
  font-size: var(--exv2-sfs);
  font-weight: 600;
}

/* Variazione dovuta alla spesa in compilazione, accanto alla voce che cambia. */
body.nh-v2 .exv2-page .exv2-dchip {
  align-self: center;
  padding: 1px 8px;
  border: 1px solid rgba(var(--primary-rgb), .35);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: calc(var(--exv2-ssm) - 1px);
  font-weight: 700;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  animation: exv2-chip-in .25s var(--exv2-ease);
}

/* Scheletro del foglio. */
body.nh-v2 .exv2-page .exv2-sh-head.is-loading {
  gap: 8px;
}

body.nh-v2 .exv2-page .exv2-sh-skel {
  flex: 1;
  padding: 8px 12px 0;
}

body.nh-v2 .exv2-page .exv2-sh-skel-row {
  display: grid;
  grid-template-columns: 34px 1fr 52px;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
}

body.nh-v2 .exv2-page .exv2-sh-skel-tx {
  display: grid;
  gap: 5px;
}

body.nh-v2 .exv2-page .exv2-sh-skel-foot {
  display: grid;
  gap: 9px;
  margin: 6px 18px 0;
  padding-top: 12px;
  border-top: 2px dashed var(--border-strong);
}

/* ================= schermi larghi e stretti ================= */
/* Schermi larghi: lo scontrino si allarga (fino a 300px) cosi' le miniature restano leggibili; il foglio resta 460px al massimo. */
@media (min-width: 1700px) {
  body.nh-v2 .exv2-page .exv2-cols {
    grid-template-columns: clamp(236px, 17vw, calc(300px + var(--exv2-r2) * .18)) minmax(0, 1fr) clamp(272px, 29vw, calc(460px + var(--exv2-r2) * .0688));
  }
}

@media (min-width: 1900px) {
  body.nh-v2 .exv2-page .exv2-cols {
    gap: 28px;
  }
}

/* Schermi stretti: meno aria tra le colonne e ai lati per dare larghezza ai campi (Tipo e Commessa non si troncano). */
@media (max-width: 1180px) {
  body.nh-v2 .exv2-page .exv2-cols {
    gap: 16px;
  }

  body.nh-v2 .exv2-page .exv2-scheda {
    padding-left: 14px;
    padding-right: 14px;
  }

  body.nh-v2 .exv2-page .exv2-msg {
    left: 200px;
    right: 200px;
  }
}

/* ================= movimento ================= */
@keyframes exv2-msgin {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes exv2-shim {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes exv2-swap {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes exv2-print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-6px); }
  to { clip-path: inset(0); transform: none; }
}

@keyframes exv2-chip-in {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.nh-v2 .exv2-page *,
  body.nh-v2 .exv2-page *::before,
  body.nh-v2 .exv2-page *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  body.nh-v2 .exv2-page .exv2-sk {
    animation: none;
  }
}

/* ================= Anteprima diaria ("Elabora"): vale per il form di sempre e per il v2 ================= */
.expense-diaria-preview-dialog {
  width: min(640px, calc(100vw - 48px));
}

.expense-diaria-preview-scroll {
  max-height: min(380px, 52dvh);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.expense-diaria-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.expense-diaria-preview-table th {
  position: sticky;
  top: 0;
  padding: 0 8px 8px 2px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.expense-diaria-preview-table td {
  padding: 9px 8px 9px 2px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.expense-diaria-preview-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.expense-diaria-preview-table small.warn {
  display: block;
  margin-top: 2px;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
}

.expense-diaria-preview-table tr.is-bad td {
  background: var(--danger-soft);
}

.expense-diaria-preview-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 13px;
}

.expense-diaria-preview-total strong {
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.expense-diaria-preview-total.is-bad strong {
  color: var(--danger);
}

.expense-diaria-preview-sk {
  display: grid;
  gap: 10px;
  padding: 4px 0;
}

.expense-diaria-preview-sk span {
  display: block;
  height: 18px;
  border-radius: 6px;
  background: var(--surface-soft);
  animation: expense-diaria-sk 1.1s ease-in-out infinite alternate;
}

@keyframes expense-diaria-sk {
  from { opacity: .45; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .expense-diaria-preview-sk span {
    animation: none;
  }
}

/* ================= anteprima diaria in diretta (colonna 3, sotto le righe del foglio) ================= */
body.nh-v2 .exv2-page .exv2-dp {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: 58%;
  margin: 6px var(--exv2-shx) 0;
  padding-top: 8px;
  border-top: 2px dashed var(--border-strong);
  overflow: hidden;
  transition: opacity .15s var(--exv2-ease);
}

body.nh-v2 .exv2-page .exv2-dp.is-busy {
  opacity: .6;
}

body.nh-v2 .exv2-page .exv2-dp-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

body.nh-v2 .exv2-page .exv2-dp-t {
  margin: 0;
  color: var(--text);
  font-size: var(--exv2-sfs);
  font-weight: 700;
}

body.nh-v2 .exv2-page .exv2-dp-n {
  color: var(--exv2-slate);
  font-size: var(--exv2-ssm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Registro nel foglio: poche righe da una linea sola (le altre stanno nella modale), cosi' non tocca mai i totali. */
body.nh-v2 .exv2-page .exv2-dp-reg {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

body.nh-v2 .exv2-page .exv2-dp-r {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  min-height: 24px;
  padding: 1px 0;
  border-top: 1px solid var(--exv2-line);
  font-size: var(--exv2-ssm);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--text);
}

body.nh-v2 .exv2-page .exv2-dp-r:first-child {
  border-top: 0;
}

body.nh-v2 .exv2-dp-sw {
  --check-size: 18px;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1;
}

body.nh-v2 .exv2-page .exv2-dp-d {
  font-weight: 600;
  white-space: nowrap;
}

body.nh-v2 .exv2-page .exv2-dp-m {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.nh-v2 .exv2-page .exv2-dp-a {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

/* Escluso: tratteggio e testo attenuato (weekend e festivi si possono includere); "gia' in nota" non e' includibile. */
body.nh-v2 .exv2-page .exv2-dp-r.is-off {
  color: var(--exv2-slate);
  border-top-style: dashed;
}

body.nh-v2 .exv2-page .exv2-dp-r.is-off .exv2-dp-d {
  font-weight: 500;
}

body.nh-v2 .exv2-page .exv2-dp-r.is-forced .exv2-dp-m {
  color: var(--exv2-danger-ink);
  font-weight: 600;
}

body.nh-v2 .exv2-page .exv2-dp-r.is-bad {
  background: var(--danger-soft);
}

/* Un'unica avvertenza per tutto il periodo (mai ripetuta per giorno). */
body.nh-v2 .exv2-page .exv2-dp-al,
body.nh-v2 .exv2-dpm-al {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--exv2-danger-ink);
  font-size: var(--exv2-ssm);
  font-weight: 600;
  line-height: 1.25;
}

/* Pulsante BlazorActionButton: stile da testo quieto, sopra le regole di .btn (stesso pattern di exv2-surf). */
body.nh-v2 .exv2-page .btn.exv2-dp-more {
  justify-self: start;
  padding: 2px 0 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: var(--exv2-slate) !important;
  font-size: var(--exv2-ssm);
  font-weight: 600;
  text-align: left;
}

body.nh-v2 .exv2-page .btn.exv2-dp-more:hover {
  color: var(--text) !important;
}

body.nh-v2 .exv2-page .btn.exv2-dp-more.is-bad {
  color: var(--exv2-danger-ink) !important;
}

body.nh-v2 .exv2-page .exv2-dp-err {
  color: var(--exv2-danger-ink);
  font-size: var(--exv2-lfs);
  font-weight: 500;
  line-height: var(--exv2-llh);
}

/* Nessun risultato: la sola struttura, righe tratteggiate come negli altri stati vuoti del foglio. */
body.nh-v2 .exv2-page .exv2-dp-gh {
  display: grid;
  gap: 8px;
  padding: 2px 0 4px;
}

body.nh-v2 .exv2-page .exv2-dp-gr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.nh-v2 .exv2-page .exv2-dp-gr .exv2-dsh:nth-child(2) {
  flex: 1;
  max-width: 100%;
}

/* ================= modale "Giorni della diaria": calendario a settimane, tutto visibile senza scroll ================= */
body.nh-v2 .editor-dialog.exv2-dpm {
  width: min(94vw, 780px);
  max-height: calc(100dvh - 24px);
}

body.nh-v2 .editor-dialog.exv2-dpm .editor-body {
  overflow: visible;
}

body.nh-v2 .exv2-dpm-sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

body.nh-v2 .exv2-dpm-n {
  color: var(--exv2-slate);
  font-size: var(--exv2-sfs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-dpm-t {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

body.nh-v2 .exv2-dpm-t small {
  margin-left: 3px;
  font-size: .6em;
  font-weight: 600;
}

body.nh-v2 .exv2-dpm-al {
  margin-bottom: 8px;
}

body.nh-v2 .exv2-dpm-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--wk, 5), clamp(36px, calc((100dvh - 300px) / var(--wk, 5)), 66px));
  gap: 4px;
}

body.nh-v2 .exv2-dpm-wd {
  color: var(--exv2-slate);
  font-size: var(--exv2-ssm);
  font-weight: 600;
  text-align: center;
}

body.nh-v2 .exv2-dpm-c {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

body.nh-v2 .exv2-dpm-c.is-none {
  border: 0;
  background: none;
}

body.nh-v2 .exv2-dpm-dn {
  font-size: var(--exv2-sfs);
  font-weight: 700;
  white-space: nowrap;
}

body.nh-v2 .exv2-dpm-m {
  grid-column: 1 / -1;
  align-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--exv2-ssm);
  font-weight: 600;
}

/* Escluso (weekend, festivo o scelta): tratteggio e testo attenuato; "gia' in nota" non e' includibile. */
body.nh-v2 .exv2-dpm-c.is-off {
  border-style: dashed;
  background: transparent;
  color: var(--exv2-slate);
}

body.nh-v2 .exv2-dpm-c.is-off .exv2-dpm-m {
  font-weight: 500;
}

body.nh-v2 .exv2-dpm-c.is-forced .exv2-dpm-m {
  color: var(--exv2-danger-ink);
  font-weight: 600;
}

body.nh-v2 .exv2-dpm-c.is-bad {
  border-color: var(--exv2-danger-ink);
  background: var(--danger-soft);
}

@media (max-height: 700px) {
  body.nh-v2 .exv2-dpm-sum {
    margin-bottom: 4px;
  }

  body.nh-v2 .exv2-dpm-cal {
    gap: 3px;
    grid-template-rows: auto repeat(var(--wk, 5), clamp(30px, calc((100dvh - 280px) / var(--wk, 5)), 60px));
  }

  body.nh-v2 .exv2-dpm-c {
    padding: 2px 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.nh-v2 .exv2-page .exv2-dp {
    transition: none;
  }
}
