[data-simplebar]{position:relative;flex-direction:column;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:flex-start}.simplebar-wrapper{overflow:hidden;width:inherit;height:inherit;max-width:inherit;max-height:inherit}.simplebar-mask{direction:inherit;position:absolute;overflow:hidden;padding:0;margin:0;left:0;top:0;bottom:0;right:0;width:auto!important;height:auto!important;z-index:0}.simplebar-offset{direction:inherit!important;box-sizing:inherit!important;resize:none!important;position:absolute;top:0;left:0;bottom:0;right:0;padding:0;margin:0;-webkit-overflow-scrolling:touch}.simplebar-content-wrapper{direction:inherit;box-sizing:border-box!important;position:relative;display:block;height:100%;width:auto;max-width:100%;max-height:100%;overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.simplebar-content-wrapper::-webkit-scrollbar,.simplebar-hide-scrollbar::-webkit-scrollbar{display:none;width:0;height:0}.simplebar-content:after,.simplebar-content:before{content:' ';display:table}.simplebar-placeholder{max-height:100%;max-width:100%;width:100%;pointer-events:none}.simplebar-height-auto-observer-wrapper{box-sizing:inherit!important;height:100%;width:100%;max-width:1px;position:relative;float:left;max-height:1px;overflow:hidden;z-index:-1;padding:0;margin:0;pointer-events:none;flex-grow:inherit;flex-shrink:0;flex-basis:0}.simplebar-height-auto-observer{box-sizing:inherit;display:block;opacity:0;position:absolute;top:0;left:0;height:1000%;width:1000%;min-height:1px;min-width:1px;overflow:hidden;pointer-events:none;z-index:-1}.simplebar-track{z-index:1;position:absolute;right:0;bottom:0;pointer-events:none;overflow:hidden}[data-simplebar].simplebar-dragging{pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[data-simplebar].simplebar-dragging .simplebar-content{pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[data-simplebar].simplebar-dragging .simplebar-track{pointer-events:all}.simplebar-scrollbar{position:absolute;left:0;right:0;min-height:10px}.simplebar-scrollbar:before{position:absolute;content:'';background:#000;border-radius:7px;left:2px;right:2px;opacity:0;transition:opacity .2s .5s linear}.simplebar-scrollbar.simplebar-visible:before{opacity:.5;transition-delay:0s;transition-duration:0s}.simplebar-track.simplebar-vertical{top:0;width:11px}.simplebar-scrollbar:before{top:2px;bottom:2px;left:2px;right:2px}.simplebar-track.simplebar-horizontal{left:0;height:11px}.simplebar-track.simplebar-horizontal .simplebar-scrollbar{right:auto;left:0;top:0;bottom:0;min-height:0;min-width:10px;width:auto}[data-simplebar-direction=rtl] .simplebar-track.simplebar-vertical{right:auto;left:0}.simplebar-dummy-scrollbar-size{direction:rtl;position:fixed;opacity:0;visibility:hidden;height:500px;width:500px;overflow-y:hidden;overflow-x:scroll;-ms-overflow-style:scrollbar!important}.simplebar-dummy-scrollbar-size>div{width:200%;height:200%;margin:10px 0}.simplebar-hide-scrollbar{position:fixed;left:0;visibility:hidden;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none}



.simplebar-scrollbar:before {
  background-color: var(--palette-text-disabled);
}
.simplebar-scrollbar.simplebar-visible:before {
  opacity: 0.48;
}

/* Gestionale Media Food - tema Minimal (MUI Store, licenza Standard Plus): colori, carattere Public Sans,
   ombre e angoli di Minimal sui nostri componenti. Testi sempre con contrasto di almeno 4,5:1.
   Tre misure: computer (oltre 1100 px), tablet (fino a 1100 px), telefono (fino a 640 px). */
@font-face {
  font-family: 'Public Sans Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/public-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/public-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Caratteri a scelta nelle Impostazioni del tema (pacchetti @fontsource-variable, licenza OFL), tutti in locale */
@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/dm-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/dm-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito Sans Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/nunito-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito Sans Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/nunito-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  /* Grigi di Minimal */
  --bg: var(--palette-background-neutral, #f4f6f8);  /* grigio neutro: riquadri interni e intestazioni */
  --page: var(--palette-background-default, #ffffff); /* fondo delle pagine (più scuro con «Contrasto») */
  --panel: #ffffff;
  --soft: #f4f6f8;
  --ink: #1c252e;             /* testo principale */
  --ink-2: #454f5b;
  --ink-3: #637381;           /* testo secondario: 4,9:1 sul bianco */
  --line: rgba(145, 158, 171, 0.2);
  --line-2: rgba(145, 158, 171, 0.32);
  --hover: rgba(145, 158, 171, 0.08);
  /* Verde Minimal */
  /* Colore principale del tema (Impostazioni → Colore principale): di partenza il verde Minimal */
  --accent: var(--palette-primary-dark, #007867);          /* testi, icone e pulsanti: 5,4:1 sul bianco */
  --accent-2: var(--palette-primary-darker, #004b50);
  --accent-bright: var(--palette-primary-main, #00a76f);   /* solo superfici e dettagli (barre, interruttori) */
  --accent-soft: rgba(var(--palette-primary-mainChannel, 0 167 111) / 0.08);
  --accent-row: rgba(var(--palette-primary-mainChannel, 0 167 111) / 0.06);
  /* Stati: testo scuro su fondo chiaro, come le etichette «soft» di Minimal */
  --ok: #007867;
  --ok-bg: rgba(34, 197, 94, 0.16);
  --warn: #7a4100;
  --warn-bg: rgba(255, 171, 0, 0.16);
  --bad: #b71d18;
  --bad-bg: rgba(255, 86, 48, 0.16);
  --info: #006c9c;
  --info-bg: rgba(0, 184, 217, 0.16);
  /* Ombre di Minimal: scheda, menu a tendina, finestra */
  --shadow: 0 0 2px 0 rgba(145, 158, 171, 0.2), 0 12px 24px -4px rgba(145, 158, 171, 0.12);
  --shadow-lg: 0 0 2px 0 rgba(145, 158, 171, 0.24), -20px 20px 40px -4px rgba(145, 158, 171, 0.24);
  --shadow-dialog: -40px 40px 80px -8px rgba(0, 0, 0, 0.24);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Come global.css del tema Minimal: la pagina scorre tutta, la barra in alto resta in vista */
html { height: 100%; -webkit-overflow-scrolling: touch; scroll-padding-top: 88px; }
body, #root { display: flex; flex: 1 1 auto; min-height: 100%; flex-direction: column; margin: 0; }
nav ul { margin: 0; padding: 0; list-style-type: none; }
/* Il carattere arriva dal tema (Impostazioni → Carattere) */
body {
  font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--page);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; margin: 0; }
h2 { font-size: 19px; font-weight: 700; margin: 0; line-height: 1.25; }
p { margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.mono { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 14px; }
.grow { flex: 1; min-width: 0; }
.ic { flex: none; display: block; }
.ml { margin-left: 8px; }
.only-phone { display: none; }

/* Pulsanti */

.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.kbd { font-size: 14px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--soft); color: var(--ink-3); }
.btn.primary .kbd { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* Campi */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.field .hint { margin: 0; font-size: 14px; color: var(--ink-3); }
/* Password: pulsante per vedere quello che si scrive (quello di Edge si nasconde per non averne due) */
input.pw-in::-ms-reveal, input.pw-in::-ms-clear { display: none; }
.pw-eye[aria-pressed='true'] { color: var(--accent); }
.checks { list-style: none; margin: -4px 0 18px; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--ink-3); }
.checks li { display: flex; align-items: center; gap: 8px; }
.checks li .ic { color: #c5cbd5; }
.checks li.ok { color: var(--ok); font-weight: 600; }
.checks li.ok .ic { color: var(--ok); }
.code-input { font-size: 26px; letter-spacing: 10px; text-align: center; height: 40px; line-height: 40px; font-family: Consolas, monospace; }
.check { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
/* Interruttore (sì / no) */

/* Messaggi */

/* Etichette di stato: colori e misure dalla Label di Minimal (badge.tsx) */

/* Marchio */

/* Schermate di accesso */
.auth {
  min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, #e3f2ea, transparent 70%), var(--bg);
}
.auth-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 36px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .lead { color: var(--ink-3); margin-bottom: 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 14px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.sso { display: grid; gap: 10px; }
.auth-foot { margin: 22px 0 0; text-align: center; font-size: 14px; }
.auth-foot a { color: var(--ink-3); }
.auth-foot a:hover { color: var(--accent); }
.qr { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.qr img { width: 170px; height: 170px; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.secret { font-family: Consolas, monospace; font-size: 14px; word-break: break-all; background: var(--soft); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.steps { margin: 0 0 18px; padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }

/* Struttura principale */

/* Menu dell'account: Popover del tema, qui solo larghezza e spazi */
.menu-role { padding: 0 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-company { flex-direction: column; gap: 6px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-company .company-select { background-color: var(--soft); padding-left: 12px; max-width: none; width: 100%; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); text-align: left;
}
.menu-item:hover { background: var(--soft); color: var(--ink); }
.menu-foot { font-size: 14px; color: var(--ink-3); padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.update {
  display: flex; align-items: center; justify-content: center; gap: 16px; padding: 10px 16px; flex: none;
  background: var(--accent-soft); border-bottom: 1px solid #cfe8dc; color: #0f5d45; font-weight: 600; font-size: 14px;
}
.update .btn { height: 34px; }
/* Schede aperte: si ritrovano a ogni accesso */
.tabbar { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 16px; flex: none; background: #fff; border-bottom: 1px solid var(--line); }
.tabs { display: flex; align-items: center; gap: 6px; min-width: 0; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; flex: none; max-width: 240px; height: 36px; border-radius: 10px; background: var(--soft); color: var(--ink-2); transition: background 0.15s; }
.tab:hover { background: #e9ecf1; }
.tab.on { background: var(--accent-soft); color: var(--accent); }
.tab-main { display: flex; align-items: center; gap: 8px; height: 100%; min-width: 0; padding: 0 4px 0 12px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.tab.on .tab-main { font-weight: 600; }
.tab-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-x { display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin-right: 5px; border: 0; border-radius: 7px; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; }
.tab-x:hover { opacity: 1; background: rgba(20, 30, 50, 0.08); }
.tab-add { position: relative; flex: none; }
.tab-menu { left: 0; right: auto; top: calc(100% + 8px); width: 270px; }
.menu-title { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-3); padding: 6px 10px 8px; }

.pages { flex: 1; min-width: 0; display: flex; }

.start { max-width: 760px; }
.start p { margin-top: 6px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 22px; }
.start-item {
  display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; box-shadow: var(--shadow);
}
.start-item:hover { border-color: var(--accent); color: var(--accent); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--ink-3); margin-top: 4px; max-width: 760px; }

/* Elenchi */
/* Riquadri: Card del tema Minimal (fondo, angoli e ombra dal tema; seguono «Contrasto» delle Impostazioni) */
.card.list { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; white-space: nowrap; }
.grid td { vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tr.clickable { cursor: pointer; }
.grid tr.clickable:hover td { background: #fafbfc; }
.grid tr.selected td, .grid tr.selected:hover td { background: var(--accent-row); }
.grid tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.grid small { display: block; color: var(--ink-3); font-size: 14px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who strong, .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.av.lg { width: 52px; height: 52px; font-size: 17px; }
.empty { padding: 32px; text-align: center; color: var(--ink-3); }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filters .field { margin: 0; }
.filters .MuiInputBase-root { min-width: 170px; }

/* Account Google e Microsoft collegati */
.linked { margin-top: 32px; max-width: 760px; }
.linked > p { margin: 4px 0 14px; }
.linked-list { display: grid; gap: 10px; }
.linked-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.linked-item small { display: block; color: var(--ink-3); font-size: 14px; }
.linked-item > .ic { color: var(--accent); }
.code-step { flex-wrap: wrap; }
.in-code-mini { width: 150px; }
.code-mini { text-align: center; letter-spacing: 6px; font-family: Consolas, monospace; font-size: 18px; }
.handoff-note { margin-top: 14px; text-align: center; }

/* Scheda di modifica */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.scrim { display: none; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px;
  position: sticky; top: 0;
}
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel-head .grow p { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
/* Il pulsante che conferma sta sempre in fondo a destra; gli altri alla sua sinistra */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; justify-content: flex-end; align-items: center; }
.row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.row select { flex: 1; min-width: 0; }
/* Ruolo in una società: società sopra, ruolo sotto, così i nomi non si tagliano */
.membership { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; }
.membership > .sel:first-child { grid-column: 1; grid-row: 1; }
.membership > .sel:nth-child(2) { grid-column: 1; grid-row: 2; }
.membership .icon-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
/* Colonne secondarie: con la scheda aperta e sul tablet restano solo le principali */
@media (max-width: 1699px) { .split .grid .col-b, .split .grid .col-c { display: none; } }
.grid td.main .who { max-width: 300px; }
.perm-area { margin-bottom: 8px; }
.perm-area h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-3); margin: 16px 0 2px; }
.link-box { display: flex; gap: 8px; }
.link-box .in { flex: 1; min-width: 0; }
.link-box input { font-family: Consolas, monospace; font-size: 14px; }

/* Tablet e finestre strette: menu con sole icone, scheda di modifica sopra l'elenco */
@media (max-width: 1100px) {
  
  
  
  
  
  
  .tabbar { padding: 0 12px; }
  .split { display: block; }
  .grid .col-c { display: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, 0.35); z-index: 40; }
  .panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); overflow: auto; z-index: 41;
    border-radius: 16px 0 0 16px; border: 0; padding: 24px;
  }
}

/* Telefono: barra in basso, elenchi a schede, scheda di modifica a tutto schermo */
@media (max-width: 640px) {
  h1 { font-size: 24px; }
  
  .no-phone, .side, .tabbar { display: none; }
  .only-phone { display: flex; }
  .logo { width: 30px; height: 30px; font-size: 14px; }
  .menu-pop { width: min(320px, calc(100vw - 20px)); }
  
  .page-head { margin-bottom: 16px; align-items: center; }
  .page-head p { font-size: 14px; }
  .bottom .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom .nav-item.on { color: var(--accent); font-weight: 600; }
  
  /* Elenchi: ogni riga diventa una scheda con le voci una sotto l'altra */
  .card.list { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .grid thead { display: none; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid tr { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
  .grid tr.selected { border-color: var(--accent); }
  .grid tr.clickable:hover td, .grid tr.selected td, .grid tr.selected:hover td { background: transparent; }
  .grid tr.selected td:first-child { box-shadow: none; }
  .grid tr.selected { background: var(--accent-row); }
  .grid td { position: relative; border: 0; padding: 4px 0 4px 124px; min-height: 28px; }
  .grid td::before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 116px; font-size: 14px; color: var(--ink-3); }
  .grid td.main { padding: 0 0 8px; font-size: 15px; }
  .grid td.main .who { max-width: none; }
  .grid .col-c { display: block; }
  .grid td.main::before, .grid td.act::before, .grid td.empty::before { content: none; }
  .grid td.act { padding: 8px 0 0; min-height: 0; }
  .grid td.act:empty { display: none; }
  .grid td.empty { padding: 20px 0; text-align: center; }
  .filters .field { flex: 1 1 140px; }
  .filters .MuiInputBase-root { min-width: 0; }
  .filters .btn { flex: 1 1 100%; }
  .panel { width: 100%; border-radius: 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .qr { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .auth { padding: 14px; align-items: start; padding-top: 8vh; }
  .auth-card { padding: 26px 20px; border-radius: 18px; }
}

/* ===================== Gestionale: componenti comuni ===================== */
/* Manina su tutto quello che si clicca; la freccia resta sugli elementi disattivati */
button, select, summary, label.check, [role='button'], [role='tab'], [role='option'], a[href] { cursor: pointer; }
button:disabled, select:disabled, input:disabled, fieldset:disabled button, fieldset:disabled select { cursor: default; }
/* Parti del tema Minimal (prima erano le regole di .nav-item, .me e della barra del telefono, tolte con la vecchia
   struttura): voci del menu, scelta della società, ricerca, Impostazioni, account, voci dei pannelli e dei menu */
.minimal__nav__item__root, .MuiButtonBase-root, .MuiMenuItem-root, .MuiListItemButton-root, [role='menuitem'], [role='switch'] { cursor: pointer; }
.minimal__nav__item__root[class~='--disabled'], .MuiButtonBase-root.Mui-disabled, .MuiMenuItem-root.Mui-disabled, [role='menuitem'][aria-disabled='true'], [role='switch']:disabled { cursor: default; }
.upper { text-transform: uppercase; }
.input.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-head h1 .badge { vertical-align: middle; margin-left: 8px; font-size: 14px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head p { margin-top: 4px; }
.card.doc-head, .card.doc-lines, .card.doc-check, .card.links, .card.progress-card, .card.prices, .card.attention, .card.quick, .card.sheet-card, .card.lot-parsed, .lot-grid .card { padding: 22px; margin-bottom: 20px; }
.card.prices { margin-top: 20px; }
.card h2 + * { margin-top: 12px; }
.search-box { position: relative; flex: 1 1 280px; max-width: 460px; }
.search-box > .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box > .ic { z-index: 1; }
.search-box .in .MuiInputBase-input { padding-left: 40px; }
.filters { align-items: flex-end; }
.filters > .check.switch { padding: 0; height: 42px; }
.filter-wide { flex: 1 1 260px; max-width: 380px; }
.empty-box { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 44px 24px; }
.empty-box p { max-width: 460px; }
.empty-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.grid tr.off td { opacity: 0.55; }
.compact-grid td, .compact-grid th { padding: 10px 12px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; text-align: left; }
.linkish:hover { text-decoration: underline; }
.neg { color: var(--bad); font-weight: 600; }
.pos { color: var(--ok); font-weight: 600; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
dl.kv dt { color: var(--ink-3); font-size: 14px; }
dl.kv dd { margin: 0; font-weight: 600; }

/* Moduli delle anagrafiche */
.form-group + .form-group { margin-top: 6px; }
.form-title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-3); margin: 14px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid > .wide { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 14px; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, #fff 75%, rgba(255, 255, 255, 0)); padding: 16px 0 4px; margin-top: 8px; z-index: 5; }
.child { margin-top: 8px; }
.child-hint { margin: -8px 0 12px; }
.child-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)) 36px; gap: 8px; align-items: center; margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; }
.child-row .combo { grid-column: span 2; }
.price-cell { display: inline-flex; align-items: center; gap: 6px; }
.price-cell .in { width: 120px; }
.in-changed.MuiOutlinedInput-root { background: var(--warn-bg); }
.in-changed .MuiOutlinedInput-notchedOutline { border-color: var(--warn); }

/* Scelta con ricerca */
.combo { min-width: 0; }
.combo-pop { min-width: 300px; }
.MuiAutocomplete-option.combo-item { gap: 10px; align-items: baseline; font-size: 14px; }
.combo-code { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 14px; color: var(--ink-3); flex: none; min-width: 52px; }
.combo-name { flex: 1; min-width: 0; }
.combo-extra { font-size: 14px; color: var(--ink-3); flex: none; }

/* Finestra in primo piano */

.modal-reason { font-size: 14px; }

.pick-row { align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.pick-row .num { min-width: 90px; text-align: right; }

/* Documenti */
.doc { max-width: 1320px; }
.doc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.doc-grid .span2 { grid-column: span 2; }
.doc-grid .span-all { grid-column: 1 / -1; }
.scan-bar { display: flex; gap: 10px; flex: 1 1 460px; max-width: 640px; justify-content: flex-end; }
.scan-box { max-width: none; }
.scan-box .in.MuiOutlinedInput-root { background: #fbfefc; }
.scan-box .in .MuiOutlinedInput-notchedOutline { border-color: var(--accent); }
.lines-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
/* Larghezza minima calcolata nella pagina (somma delle colonne presenti): niente valori tagliati */
table.lines { width: 100%; border-collapse: separate; border-spacing: 0; }
.lines th { text-align: left; padding: 10px 6px; white-space: nowrap; }
.lines td { padding: 6px; vertical-align: middle; }
.lines .in .MuiInputBase-input { padding-left: 10px; padding-right: 10px; }
.lines .c-prod { min-width: 320px; }
.lines .c-lot { width: 145px; }
.lines .c-date { width: 175px; }
.lines .c-num { width: 90px; text-align: right; }
.lines .c-kg { width: 105px; }
.lines .c-price { width: 110px; text-align: right; }
.lines .c-disc { width: 95px; }
.lines .c-vat { width: 95px; }
.lines .c-amount { width: 120px; text-align: right; font-weight: 600; white-space: nowrap; }
.lines .c-x { width: 44px; }
/* Quando la tabella scorre di lato l'articolo resta fermo a sinistra (solo computer e tablet) */
@media (min-width: 641px) {
  .lines th.c-prod, .lines td.c-prod { position: sticky; left: 0; z-index: 2; background: var(--palette-background-paper, #fff); }
  .lines thead th.c-prod { background: var(--palette-background-neutral, #f4f6f8); }
  .lines tr.note-row td.c-prod { background: #fafbfc; }
}
.lines th.c-num, .lines th.c-price, .lines th.c-amount { text-align: right; }
.lines tr.note-row td { background: #fafbfc; font-style: italic; }
.lines td.empty { padding: 28px; }
.add-line { margin-top: 12px; }
.totals { margin: 18px 0 0 auto; max-width: 420px; display: grid; gap: 6px; }
.tot-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: baseline; }
.tot-row.small { grid-template-columns: 1fr auto auto; }
.tot-row.grand { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 4px; font-size: 18px; }
.tot-row.grand strong { color: var(--accent); }
.links { display: grid; gap: 8px; }
.link-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; color: var(--ink); }
.link-item:hover { border-color: var(--accent); }
.progress-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 160px; gap: 14px; align-items: center; padding: 6px 0; }
.meter { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--warn); border-radius: 99px; }
.meter > span.ok { background: var(--ok); }
.doc-actions { background: linear-gradient(to top, var(--bg) 75%, rgba(246, 247, 249, 0)); }
.tab.doc-tab .tab-main span { max-width: 210px; }

/* Magazzino */
.chev { display: inline-block; width: 16px; color: var(--ink-3); transition: transform 0.15s; }
.chev.on { transform: rotate(90deg); color: var(--accent); }
.grid tr.sub-row td { background: #fafbfc; padding-top: 9px; padding-bottom: 9px; }
.grid tr.sub-row td.main { padding-left: 38px; }
.lot-search { max-width: 380px; }
.lot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.lot-grid .lot-parsed { grid-column: 1 / -1; }
.lot-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lot-parts > div { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: var(--soft); }
.lot-part { font-family: Consolas, 'Cascadia Mono', monospace; font-size: 22px; font-weight: 700; color: var(--accent); }
.lot-parts small { color: var(--ink-3); font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.trace { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

/* Foglio di produzione */
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 20px; }
.sheet-head { margin-bottom: 8px; }
.big-num { font-size: 18px; font-weight: 700; white-space: nowrap; }
.sheet-notes { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: #8a4a00; }

/* Panoramica */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 14px; align-items: center; padding: 18px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); font: inherit; color: var(--ink); transition: border-color 0.15s;
}
.tile:hover { border-color: var(--accent); }
.tile-ic { grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.tile-value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.tile-label { font-size: 14px; color: var(--ink-3); }
.tile.warn .tile-ic { background: var(--warn-bg); color: var(--warn); }
.tile.bad .tile-ic { background: var(--bad-bg); color: var(--bad); }
.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 0 20px; align-items: start; }
.attention h2 .badge { margin-left: 8px; vertical-align: middle; }
.alert-row, .quick-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-size: 14px; text-align: left; color: var(--ink);
}
.alert-row.warn { background: var(--warn-bg); border-color: #f5dcb5; }
.alert-row.warn > .ic { color: var(--warn); }
.alert-row.bad { background: var(--bad-bg); border-color: #f2c9c4; }
.alert-row.bad > .ic { color: var(--bad); }
.quick-row:hover, .alert-row:hover { border-color: var(--accent); }
.quick-row > .ic { color: var(--accent); }

/* Lettura con la fotocamera */
.scanner, .MuiDialog-paper.scanner { position: fixed; inset: 0; z-index: 80; background: #0b0f14; color: #fff; display: flex; flex-direction: column; border-radius: 0; }
.scanner-top { display: flex; align-items: center; gap: 14px; padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top)); }
.scanner-top p { color: #c7cdd6; margin-top: 2px; font-size: 15px; }
.scanner-top strong { font-size: 17px; }
.scanner-count { flex: none; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); color: #c7cdd6; font-size: 15px; font-weight: 700; white-space: nowrap; }
.scanner-count.on { background: rgba(34, 197, 94, 0.2); color: #9be3c4; }
.scanner .btn.scanner-done { flex: none; height: 44px; padding: 0 20px; background: #fff; color: #1c252e; border-color: #fff; font-size: 16px; }
.scanner .btn.scanner-done:hover { background: #dfe3e8; border-color: #dfe3e8; }
.scanner-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; left: 6%; right: 6%; top: 34%; height: 32%; border: 3px solid rgba(255, 255, 255, 0.92); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.38); transition: border-color 0.1s; }
.scanner-frame.ok { border: 5px solid #22c55e; }
.scanner-frame.bad { border: 5px solid #ff5630; }
.scanner-log { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 6px; min-height: 92px; }
.scanner-log p { display: flex; align-items: center; gap: 8px; font-size: 16px; }
@media (max-width: 640px) {
  .scanner-top { flex-wrap: wrap; }
  .scanner-top .grow { flex-basis: 100%; }
}
.scanner-log p.ok { color: #9be3c4; }
.scanner-log p.bad { color: #ffb4ab; }
.scanner-error { flex: 1; display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; color: #ffd8a8; }

/* Menu di tutte le sezioni sul telefono */

/* Stampa: l'area è vuota sullo schermo, sulla carta c'è solo lei */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm 12mm 14mm; }
  html, body { height: auto; background: #fff; }
  body > #root { display: none !important; }
  /* pannelli del tema aperti (Impostazioni, account, ricerca) e suggerimenti: mai sulla carta */
  body > .MuiModal-root, body > .MuiPopper-root, body > .MuiTooltip-popper { display: none !important; }
  #print-root { display: block; }
  .print-page { color: #111; font-size: 10pt; line-height: 1.4; }
  .pr-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 10px; border-bottom: 2px solid #127a5a; margin-bottom: 14px; }
  .pr-company { font-size: 14pt; font-weight: 700; color: #127a5a; }
  .pr-title { text-align: right; }
  .pr-doc { font-size: 15pt; font-weight: 700; }
  .pr-boxes { display: flex; gap: 12px; margin-bottom: 14px; }
  .pr-box { flex: 1; border: 1px solid #bbb; border-radius: 6px; padding: 8px 10px; }
  .pr-label { font-size: 8pt; text-transform: uppercase; letter-spacing: 0.5px; color: #555; margin-bottom: 2px; }
  table.pr-lines { width: 100%; border-collapse: collapse; }
  .pr-lines thead { display: table-header-group; }
  .pr-lines th { text-align: left; font-size: 8.5pt; color: #333; border-bottom: 1.5px solid #333; padding: 5px 6px; }
  .pr-lines td { padding: 5px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
  .pr-lines .num { text-align: right; white-space: nowrap; }
  .pr-lines tr { break-inside: avoid; }
  .pr-lines .pr-note-row td { font-style: italic; color: #444; }
  .pr-lines.big td { font-size: 12pt; padding: 7px 6px; }
  .pr-lines .code { font-family: Consolas, monospace; white-space: nowrap; }
  .pr-lines .check-cell { width: 28px; text-align: center; font-size: 14pt; }
  .pr-foot { display: flex; gap: 16px; margin-top: 14px; align-items: flex-start; break-inside: avoid; }
  .pr-totals { margin-left: auto; border-collapse: collapse; min-width: 300px; }
  .pr-totals td { padding: 4px 8px; border-bottom: 1px solid #ddd; }
  .pr-total td { font-size: 12pt; font-weight: 700; border-top: 1.5px solid #333; }
  .pr-notes { margin-top: 6px; white-space: pre-wrap; }
  .pr-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; break-inside: avoid; }
  .pr-signs > div { border-top: 1px solid #333; padding-top: 4px; font-size: 8.5pt; color: #333; height: 44px; }
  .pr-block { break-inside: avoid; margin-bottom: 16px; }
  .pr-block h3 { display: flex; justify-content: space-between; gap: 12px; font-size: 13pt; margin: 0 0 4px; padding: 6px 0; border-bottom: 1.5px solid #127a5a; }
  .pr-block h3 span { font-size: 9.5pt; font-weight: 400; color: #444; }
}

/* Tablet */
@media (max-width: 1100px) {
  .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid, .lot-grid { grid-template-columns: minmax(0, 1fr); }
  .scan-bar { max-width: none; }
}

/* Telefono */
@media (max-width: 640px) {
  .form-grid, .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-grid .span2 { grid-column: auto; }
  .card.doc-head, .card.doc-lines, .card.doc-check, .card.links, .card.progress-card, .card.prices, .card.attention, .card.quick, .card.sheet-card, .card.lot-parsed, .lot-grid .card { padding: 16px; }
  .scan-bar { flex-wrap: wrap; }
  .scan-bar .btn { flex: 1; }
  .search-box { max-width: none; }
  .filters > .field { flex: 1 1 140px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { grid-template-columns: 1fr; padding: 14px; }
  .tile-ic { grid-row: auto; width: 36px; height: 36px; }
  .tile-value { font-size: 20px; }
  .lot-parts { grid-template-columns: minmax(0, 1fr); }
  .sheet-grid { grid-template-columns: minmax(0, 1fr); }
  .progress-row { grid-template-columns: minmax(0, 1fr) auto; }
  .progress-row .meter { grid-column: 1 / -1; }
  /* Righe dei documenti: ogni riga diventa una scheda con le voci una sotto l'altra */
  table.lines, .lines thead, .lines tbody, .lines tr, .lines td { display: block; min-width: 0; width: 100%; }
  /* sul telefono ogni riga è una scheda: la larghezza minima del computer (scritta nella pagina) non vale */
  table.lines { min-width: 0 !important; }
  .lines thead { display: none; }
  .lines tr { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; background: #fff; position: relative; }
  .lines td { border: 0; padding: 4px 0 4px 96px; position: relative; text-align: left; min-height: 30px; }
  .lines td::before { position: absolute; left: 0; top: 11px; font-size: 14px; color: var(--ink-3); }
  .lines td.c-prod { padding: 0 48px 6px 0; }
  .lines td.c-x { position: absolute; top: 6px; right: 6px; width: auto; padding: 0; min-height: 0; }
  .lines td.c-lot::before { content: 'Lotto'; }
  .lines td.c-date::before { content: 'Scadenza'; }
  .lines td.c-cases::before { content: 'Colli'; }
  .lines td.c-pieces::before { content: 'Pezzi'; }
  .lines td.c-kg::before { content: 'Kg'; }
  .lines td.c-price::before { content: 'Prezzo €'; }
  .lines td.c-disc::before { content: 'Sconti'; }
  .lines td.c-vat::before { content: 'IVA'; }
  .lines td.c-amount { text-align: left; }
  .lines td.c-amount::before { content: 'Importo'; }
  .lines td.empty { padding: 16px 0; }
  .lines td.empty::before { content: none; }
  .totals { max-width: none; }
  
  
}

/* ===================== Ritocchi dopo le prime foto ===================== */
.sticky-actions { background: #fff; border-top: 1px solid var(--line); padding: 12px 0 2px; box-shadow: 0 -10px 16px -14px rgba(20, 30, 50, 0.25); }
.doc-actions { margin-top: 4px; }
.doc-actions.sticky-actions { padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(20, 30, 50, 0.12); bottom: 12px; }
.doc-actions:not(.sticky-actions) { padding: 4px 0 8px; }
.split-main { min-width: 0; }
.card.doc-summary { display: flex; align-items: flex-start; gap: 20px; padding: 18px 22px; margin-bottom: 20px; }
dl.summary { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 24px; margin: 0; }
dl.summary > div { min-width: 0; }
dl.summary > div.wide { grid-column: 1 / -1; }
dl.summary dt { font-size: 14px; color: var(--ink-3); margin-bottom: 2px; }
dl.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.grid td .badge + small, .grid td small { margin-top: 2px; }
@media (max-width: 640px) {
  .card.doc-summary { flex-direction: column; gap: 14px; padding: 16px; }
  dl.summary { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .card.doc-summary > .btn { width: 100%; }
  .lines td.c-prod, .lines td.c-lot, .lines td.c-date, .lines td.c-num, .lines td.c-price, .lines td.c-disc, .lines td.c-vat, .lines td.c-amount { width: 100%; }
  .doc-actions.sticky-actions { bottom: 8px; padding: 10px 12px; }
  .doc-actions .grow.small { display: none; }
  .doc-actions .btn { flex: 1 1 auto; padding: 0 12px; }
  .doc-actions .kbd { display: none; }
}

/* ===================== Navigazione: tasto destro e «Indietro» ===================== */
/* Menu del tasto destro: Menu del tema, qui solo larghezza e altezza delle voci */
.ctx-menu { min-width: 230px; }
.ctx-menu .menu-item { height: 38px; }
/* «Indietro»: pulsante piccolo con bordo e sfondo, si riconosce subito come cliccabile */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; margin: 0 0 12px; padding: 0 12px 0 10px;
  border: 1px solid var(--line-2); border-radius: 10px; background: #fff; box-shadow: var(--shadow);
  color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.back-link:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.back-link .ic { transform: rotate(180deg); }

/* Manina dichiarata anche sui singoli elementi cliccabili delle schermate nuove */
.back-link, .linkish, .tile, .alert-row, .quick-row, .link-item, .phone-item, .seg button, .combo-item, .pick-row, .ctx-menu .menu-item, .tab-x, .tab-main { cursor: pointer; }
.back-link:disabled, .linkish:disabled, .tile:disabled, .alert-row:disabled, .quick-row:disabled, .link-item:disabled, .phone-item:disabled, .seg button:disabled, .ctx-menu .menu-item:disabled, .tab-x:disabled, .tab-main:disabled { cursor: default; }

/* ===================== Menu a tendina e date (Select e DateCalendar del tema) ===================== */
.date { position: relative; min-width: 0; }
.sel { min-width: 0; }
.sel-value.empty { color: var(--ink-3); }
.sel-text { flex: 1; min-width: 0; }
.sel-text small { display: block; font-size: 14px; font-weight: 400; color: var(--ink-3); }
/* Selettore della società nella barra in alto: senza bordo, testo in grassetto */
.sel.bare { max-width: 300px; font-size: 14px; font-weight: 600; }
.menu-company .sel.bare { max-width: none; width: 100%; background: var(--soft); border-radius: 8px; padding: 0 12px; }
.date-msg { display: block; margin-top: 4px; font-size: 14px; color: var(--bad); }
.cal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 16px; }
/* Calendario: giorni e nomi dei giorni almeno a 14 px */
.cal .MuiPickerDay-root, .cal .MuiDayCalendar-weekDayLabel { font-size: 14px; }

/* Stampe: colonne fisse nel foglio di produzione, righe descrittive su tutta la larghezza */
@media print {
  .pr-lines.big { table-layout: fixed; }
  .pr-lines.big td.code { width: 90px; }
  .pr-lines.big td.num { width: 110px; }
  .pr-lines.big td.check-cell { width: 34px; }
  .pr-lines .pr-note-row td { padding-top: 9px; font-weight: 600; font-style: normal; color: #333; background: #f4f6f8; }
}

/* ===================== Strumenti delle anagrafiche: Excel, modifica in blocco ===================== */

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px; text-align: center;
  border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--bg); color: var(--ink-2);
}
.drop > .ic { width: 32px; height: 32px; color: var(--accent); }
.drop strong { font-size: 16px; color: var(--ink); }
.drop p { max-width: 460px; }
.drop .actions { margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.import-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 16px; border-radius: 12px; background: var(--soft); }
.import-file > .ic { color: var(--accent); }
.map-table { border: 1px solid var(--line); border-radius: 12px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.map-row:last-child { border-bottom: 0; }
.map-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-head { font-size: 14px; font-weight: 600; color: var(--ink-3); background: var(--bg); border-radius: 12px 12px 0 0; }
.import-sum { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.import-errors { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.import-errors p { padding: 6px 0; border-bottom: 1px solid var(--line); }
.import-errors p:last-child { border-bottom: 0; }
.mass-box { margin-top: 16px; padding: 12px 16px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.mass-title { font-size: 14px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.lines-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lines-tools:empty { display: none; }
@media (max-width: 640px) {
  .map-row { grid-template-columns: 1fr; gap: 4px; }
  .map-head { display: none; }
}

/* ===================== Analisi: venduto e provvigioni ===================== */
.filter-switches { display: flex; flex-direction: column; justify-content: flex-end; min-height: 42px; }
.filter-switches .check { padding: 2px 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.stat-label { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 14px; }
.delta { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.table-scroll { overflow-x: auto; }
.grid.stats td, .grid.stats th { white-space: nowrap; }
.grid.stats td.main { white-space: normal; min-width: 200px; }
.grid.stats .rank { width: 48px; }
.grid.stats th.share, .grid.stats td.share { width: 190px; }
.share-cell { display: flex; align-items: center; gap: 10px; }
.share-cell .meter { width: 110px; flex: none; }
.grid.stats tfoot td { border-top: 2px solid var(--line-2); border-bottom: 0; background: var(--bg); }
.expand-name { display: flex; align-items: center; gap: 10px; }
.expand-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--soft); color: var(--ink-2); flex: none; }
.expand-ic .ic { transform: rotate(-90deg); transition: transform 0.15s; }
.expand-ic.open .ic { transform: none; }
.rule-line { margin: -4px 0 16px; }
@media (max-width: 640px) {
  .grid.stats td.rank { display: none; }
  .grid.stats td, .grid.stats th { white-space: normal; }
  .grid.stats td.share { width: auto; }
  .grid.stats tfoot td:empty { display: none; }
  .stat-value { font-size: 22px; }
}

/* Listino stampato: le categorie lunghe possono continuare nella pagina dopo */
@media print {
  .pr-block.flow { break-inside: auto; }
  .pr-block.flow h3 { break-after: avoid; }
  .pr-lines.price-list { table-layout: fixed; }
  .pr-lines.price-list td.code { width: 80px; }
  .pr-lines.price-list td.num { width: 150px; }
}
.mass-box + .note { margin-top: 16px; }

/* ===================== Visita guidata ===================== */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour.dim { background: rgba(15, 23, 42, 0.55); }
.tour-spot {
  position: fixed; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55), 0 0 0 3px var(--accent) inset;
  transition: left 0.2s, top 0.2s, width 0.2s, height 0.2s;
}
.tour-card {
  position: fixed; width: min(440px, calc(100vw - 32px)); padding: 20px 22px; background: #fff; border-radius: 18px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px;
}
.tour-card.center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
/* Telefono: la scheda sta in basso e la parte spiegata sale in cima alla pagina, sopra la scheda */
.tour-card.bottom { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
/* Durante la visita c'è spazio in fondo alla pagina: anche le ultime parti possono salire in cima */
body.in-visita main.content { padding-bottom: 70vh; }
.tour-card h3 { margin: 0; font-size: 20px; }
.tour-card p { color: var(--ink-2); line-height: 1.5; }
.tour-head { display: flex; align-items: center; gap: 12px; margin: -6px -8px -4px 0; }
.tour-step { flex: 1; font-size: 14px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--accent); }
.tour-count { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tour-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-3); }
.tour-keys .kbd { font-size: 14px; font-weight: 600; padding: 1px 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); }
.tour-bar { height: 4px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.tour-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }
.tour-ctl { display: flex; align-items: center; gap: 8px; }
.tour-ico { width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 12px; color: var(--ink); }
.tour-ico.off { color: var(--ink-3); }
.tour-ico:disabled { opacity: 0.45; }
.tour-ico:disabled:hover { background: transparent; color: var(--ink); }
.tour-vs { font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.tour-next { padding: 0 14px 0 18px; }
.btn-note { font-weight: 500; color: var(--ink-3); }
/* Barre della voce: si muovono mentre parla */
.tour-eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 18px; height: 16px; flex: none; }
.tour-eq i { width: 3px; height: 4px; border-radius: 2px; background: var(--accent); opacity: 0.45; }
.tour-card.speaking .tour-eq i { opacity: 1; animation: tour-eq 0.9s ease-in-out infinite; }
.tour-card.speaking .tour-eq i:nth-child(2) { animation-delay: -0.45s; }
.tour-card.speaking .tour-eq i:nth-child(3) { animation-delay: -0.2s; }
.tour-card.speaking .tour-eq i:nth-child(4) { animation-delay: -0.65s; }
@keyframes tour-eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@media (prefers-reduced-motion: reduce) { .tour-card.speaking .tour-eq i { animation: none; height: 12px; } }
@media (max-width: 640px) {
  .tour-card.center { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); }
  .tour-keys { display: none; }
}
@media (max-width: 420px) {
  .tour-vs { display: none; }
}
@media (max-width: 640px) {
  .grid.stats tfoot, .grid.stats tfoot tr, .grid.stats tfoot td { display: block; width: 100%; }
  .grid.stats tfoot tr { padding: 12px 0; }
}
/* Telefono: l'etichetta di ogni dato sta sempre a sinistra, anche nelle colonne di numeri */
@media (max-width: 640px) {
  .grid td::before { text-align: left; }
}

/* ===================== Incassi: scadenzario, incasso, estratto conto ===================== */
.filter-wide { min-width: 280px; flex: 1; max-width: 420px; }
.stat-card.bad { border-left: 4px solid var(--bad); }
.stat-card.bad .stat-value { color: var(--bad); }
.stat-card.warn { border-left: 4px solid var(--warn); }
.grid.dues td.main strong { display: block; }
.grid.dues td.main .badge { margin-top: 4px; }
.grid.dues tr.late td.main strong { color: var(--bad); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.promise { display: inline-block; font-size: 14px; }
.promise small { display: block; color: var(--ink-3); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promise.late { color: var(--bad); font-weight: 600; }
.alloc-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.alloc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.alloc-top .form-title { margin: 0; }
.alloc-table { border: 1px solid var(--line); border-radius: 12px; max-height: 320px; overflow: auto; }
.alloc-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(170px, 1fr); gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.alloc-row:last-child { border-bottom: 0; }
.alloc-head { font-size: 14px; font-weight: 600; color: var(--ink-3); background: var(--bg); position: sticky; top: 0; }
.alloc-input { display: flex; gap: 6px; align-items: center; }
.alloc-input .in { min-width: 0; }
.alloc-sum { margin-top: 10px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.alloc-sum.bad { color: var(--bad); }
.alloc-empty { padding: 8px 0; }
.alloc-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 4px 0 16px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.pad { padding: 16px; }
.pad-head { padding: 16px 16px 0; margin-bottom: 4px; }
@media (max-width: 640px) {
  .filter-wide { min-width: 0; max-width: none; width: 100%; }
  .alloc-row { grid-template-columns: 1fr 1fr; }
  .alloc-head { display: none; }
  .row-actions { justify-content: flex-start; }
}
.alloc-box { border-top: 0; padding-top: 0; }
.grid tr.opening td { background: var(--bg); }
.grid td.num small { display: block; }
.row-actions { flex-wrap: nowrap; }
@media (max-width: 640px) {
  .filter-wide { flex: 1 1 100%; }
  .row-actions { flex-wrap: wrap; }
}
@media print {
  .pr-small { font-size: 8.5pt; color: #444; margin-top: 2px; }
}
.grid td.num.neg { color: var(--bad); font-weight: 600; }

/* Elenchi da tastiera: la riga scelta con le frecce */
.grid tr.kbd-hi td { background: var(--accent-row); }
.grid tr.kbd-hi td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.keys-table { width: 100%; border-collapse: collapse; }
.keys-table td { padding: 10px 8px; vertical-align: top; line-height: 1.5; }
.keys-table tr:last-child td { border-bottom: 0; }
.keys-table td:first-child { width: 210px; white-space: nowrap; }
.keys-table .kbd { font-size: 14px; padding: 3px 8px; }

/* ===================== Distinte di incasso, assegni, inventario ===================== */
.pick-search { margin: 8px 0 10px; max-width: 420px; }
.pick-table { max-height: 380px; }
.pick-line { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-line:last-child { border-bottom: 0; }
.pick-line:hover { background: var(--bg); }
.pick-line.on { background: var(--accent-row); }
.pick-line .MuiCheckbox-root, .check .MuiCheckbox-root { padding: 4px; margin: -4px 0; }
.pick-line small { display: block; }
.pick-line .num { min-width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.close-date { max-width: 240px; margin-bottom: 12px; }
.close-table { max-height: 460px; }
.close-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(200px, 1.3fr); gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.close-row:last-child { border-bottom: 0; }
.close-row small, .close-row .linkish { display: block; }
.close-row.diff { background: var(--warn-bg); }
.close-row.added { background: var(--accent-row); }
.close-head { font-size: 14px; font-weight: 600; color: var(--ink-3); background: var(--bg); position: sticky; top: 0; z-index: 1; }
.close-input { display: flex; gap: 6px; align-items: center; }
.close-input .in { min-width: 0; }
.inv-top { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.inv-search { flex: 1; min-width: 220px; }
.inv-table { max-height: 420px; }
.inv-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 130px 120px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.inv-row:last-child { border-bottom: 0; }
.inv-row small { display: block; }
.inv-row.on { background: var(--accent-row); }
.inv-head { font-size: 14px; font-weight: 600; color: var(--ink-3); background: var(--bg); position: sticky; top: 0; z-index: 1; }
.inv-check { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.inv-check .form-title { margin: 0 0 6px; }
.inv-diff { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; }
.inv-diff .neg { color: var(--bad); }
.inv-diff .pos { color: var(--ok); }
@media (max-width: 640px) {
  .close-row, .inv-row { grid-template-columns: 1fr 1fr; }
  .close-head, .inv-head { display: none; }
}
.close-row { grid-template-columns: minmax(0, 1.9fr) 92px minmax(140px, 1fr) minmax(118px, 0.8fr) minmax(180px, 1.2fr); }
.close-head span { white-space: nowrap; }

/* Avviso della licenza sotto la barra in alto */
.license-banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; font-size: 14px; line-height: 1.4; border-bottom: 1px solid var(--line); flex: none; }
.license-banner.bad { background: var(--bad-bg); color: var(--bad); }
.license-banner.warn { background: var(--warn-bg); color: var(--warn); }
.license-banner strong { font-weight: 700; }
.menu-license { display: block; margin-top: 4px; }
@media (max-width: 640px) {
  .license-banner { padding: 8px 14px; font-size: 14px; }
}

/* Società dimostrativa: strisce oblique, si riconosce a colpo d'occhio (testo scuro: contrasto alto) */
.demo-stripes { background: repeating-linear-gradient(135deg, #fff1d6 0 10px, #ffe0a3 10px 20px) !important; color: #3b2a05 !important; }
.sel-item.demo-stripes.Mui-focusVisible, .sel-item.demo-stripes:hover { background: repeating-linear-gradient(135deg, #ffe7b8 0 10px, #ffd27f 10px 20px) !important; }
.sel-item.demo-stripes + .sel-item, .sel-item + .sel-item.demo-stripes { margin-top: 2px; }
.menu-company.demo .sel.bare .sel-btn { background: repeating-linear-gradient(135deg, #fff1d6 0 10px, #ffe0a3 10px 20px); color: #3b2a05; }

/* «Perché c'è»: richieste del cliente da cui nasce la pagina */

.why-modal .modal-body { display: flex; flex-direction: column; gap: 20px; }
.why-sub { font-size: 14px; }
.why-group h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--ink-3); }
.why-item { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 0 10px 10px 0; margin-bottom: 8px; }
.why-item p { margin: 2px 0 0; line-height: 1.5; color: var(--ink); white-space: pre-line; }
.why-ref { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.why-quote { font-style: italic; }
.why-group.scelta h3 { color: var(--warn); }
.why-group.scelta .why-item { border-left-color: var(--warn); background: var(--warn-bg); }
.why-group.foto .why-item { border-left-color: var(--ink-3); }

/* Scansione dell'assegno: copia per archivio */
.scan-img { display: block; max-width: 100%; max-height: 62vh; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; object-fit: contain; }
.scan-pdf { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.scan-confirm { font-size: 14px; color: var(--ink-2); }

/* Tabella di conversione dell'articolo: cartoni, pezzi e kg */
.conv { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.conv p { font-size: 14px; }
.conv-empty { margin-top: 10px; font-size: 14px; }
.conv-table { width: 100%; max-width: 440px; border-collapse: collapse; font-size: 14px; }
.conv-table caption { text-align: left; font-weight: 700; color: var(--ink-2); padding-bottom: 6px; }
.conv-table th, .conv-table td { padding: 6px 10px; }
.conv-table thead th { font-weight: 600; color: var(--ink-3); }
.conv-table tbody th { text-align: left; font-weight: 600; color: var(--ink); }
.conv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Riga corta con la spiegazione completa al passaggio del mouse */
.conv-tip { display: inline-flex; align-items: center; gap: 6px; cursor: help; }

/* Prezzi d'acquisto concordati con i fornitori */
.pp-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); }
.pp-add { flex: 1; min-width: 240px; max-width: 420px; }
.price-in { width: 130px; margin-left: auto; }
.agreed-diff { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--warn); white-space: nowrap; cursor: help; }
.filters.top { align-items: flex-start; }
.pp-supplier { width: 380px; max-width: 100%; }
.pp-supplier .combo { width: 100%; }

/* ============================================================================
   Tema Minimal: componenti (valori presi da starter-vite-ts/src/theme di Minimal)
   ============================================================================ */
h1 { font-size: 24px; font-weight: 700; letter-spacing: 0; line-height: 1.5; }
h2 { font-size: 18px; font-weight: 700; line-height: 1.5; }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* Pulsanti: come i «contained» e «outlined» di Minimal, angoli 8 px, scritta in grassetto */

.btn.primary .kbd { background: rgba(255, 255, 255, 0.16); color: #fff; }

.icon-btn { border-radius: 50%; color: var(--ink-3); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.kbd { border-radius: 6px; background: var(--soft); color: var(--ink-3); }

/* Etichette dei campi: scure anche mentre si scrive */
.field label, .field label.Mui-focused { color: var(--ink); }


/* Struttura: barra in alto e menu laterale come il layout «dashboard» di Minimal */

.menu-item { border-radius: 6px; color: var(--ink); font-weight: 500; }
.menu-item:hover { background: var(--hover); }
.tabbar { border-bottom: 1px solid rgba(145, 158, 171, 0.12); }
.tab { border-radius: 8px; background: transparent; color: var(--ink-3); }
.tab:hover { background: var(--hover); color: var(--ink); }
.tab.on { background: var(--accent-soft); color: var(--accent); }

/* Solo sul computer: misure del menu di Minimal (sul tablet il menu resta a sole icone) */

/* Schede: niente bordo, ombra leggera e angoli da 16 px (Card di Minimal) */
.panel, .tile, .auth-card, .start-item, .linked-item { border: 0; border-radius: 16px; box-shadow: var(--shadow); }
.panel { box-shadow: var(--shadow); }
.auth { background: radial-gradient(1000px 500px at 50% -10%, rgba(0, 167, 111, 0.1), transparent 70%), var(--page); }
.doc-actions { background: linear-gradient(to top, var(--page) 75%, rgba(255, 255, 255, 0)); }
.doc-actions.sticky-actions { border: 0; box-shadow: var(--shadow-lg); }

/* Tabelle: intestazione su grigio neutro, righe separate da una linea tratteggiata */
.grid tr.clickable:hover td { background: var(--hover); }
.grid tr.selected td, .grid tr.selected:hover td { background: var(--accent-soft); }
.grid tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent-bright); }

/* Finestre e menu a tendina */

.ctx-menu { border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); }
.ctx-menu .menu-item { border-radius: 6px; }
.tour-card { border-radius: 16px; box-shadow: var(--shadow-dialog); }
.why-item { border-radius: 0 8px 8px 0; }

/* Pulsanti con un colore loro: «Perché c'è» come il pulsante «soft» di Minimal */


/* ============================================================================
   Strada B: Material UI con il tema Minimal per pulsanti, avvisi, conferme, finestre e interruttori.
   Qui solo struttura e piccoli accordi.
   ============================================================================ */
.MuiButton-root.btn { gap: 8px; white-space: nowrap; }
.MuiButton-root.btn .ic { flex: none; }
.note { margin-bottom: 16px; }
.note .MuiAlert-message p + * { margin-top: 8px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.5; }
.modal-reason { margin-top: 4px; font-size: 14px; }
.check.switch { margin: 4px 0; }
.check.switch .MuiFormControlLabel-label { font-size: 15px; }

/* Struttura: layout «dashboard» originale del tema Minimal (minimal/layouts); qui solo le pagine dentro il contenitore */
.nav-ic { flex: none; display: block; }
.content { flex: 1 1 auto; min-width: 0; }
/* Telefono: le righe degli elenchi sono schede con l'etichetta a sinistra (le regole del computer non valgono qui) */
@media (max-width: 640px) {
  .grid td { border: 0; padding: 4px 0 4px 124px; }
  .grid td.main { padding: 0 0 8px; }
  .grid td.act { padding: 8px 0 0; }
  .grid td.empty { padding: 20px 0; }
  .grid tr { border: 0; border-radius: 16px; box-shadow: var(--shadow); }
  .panel { border-radius: 0; }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .panel { border-radius: 16px 0 0 16px; }
}

/* ============================================================================
   Campi, menu a tendina, date, caselle e tabelle: componenti di Material UI con il tema Minimal.
   Qui solo i colori del gestionale che il tema non conosce.
   ============================================================================ */
.MuiOutlinedInput-root { background: #fff; }
.MuiOutlinedInput-root.Mui-disabled { background: var(--soft); }
/* Righe di totale in fondo alle tabelle: testo normale, almeno 14 px (il tema le fa più piccole) */
.grid tfoot td { font-size: 14px; color: var(--ink); line-height: 1.5; }

/* Pulsanti di Material UI (ButtonBase e IconButton) con l'aspetto di sempre: il contenuto parte da sinistra */
.alert-row, .quick-row, .link-item, .phone-item, .tab-main { justify-content: flex-start; }
.tab-x { padding: 0; }
/* Scelta tra poche voci (ToggleButtonGroup): testo a 14 px (Material UI lo fa a 13 nella misura piccola), alta come i campi */
.seg .MuiToggleButton-root { font-size: 14px; font-weight: 600; white-space: nowrap; padding: 0 14px; height: 32px; }
.filters .seg { height: 40px; align-items: center; }
/* Interruttori del Venduto: in fila sotto i filtri */
.filter-switches.inline { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 4px 28px; min-height: 0; margin: -4px 0 16px; }
/* Filtri del Venduto: cliente, agente e articolo più stretti, così stanno in una riga con categoria e famiglia */
.sales-filters .filter-wide { min-width: 200px; flex: 1 1 200px; max-width: 320px; }
/* Date nei filtri: larghe quanto basta per gg/mm/aaaa e il calendario, così i filtri stanno in una riga */
.filters .date { width: 190px; }
@media (max-width: 640px) {
  .filters .date { width: auto; }
  /* Scelta tra poche voci sul telefono: a tutta larghezza, le voci vanno a capo */
  .filters .field:has(.seg) { flex: 1 1 100%; }
  .filters .seg { width: 100%; height: auto; flex-wrap: wrap; }
  .filters .seg .MuiToggleButton-root { flex: 1 1 auto; }
  .sales-filters .filter-wide { min-width: 0; max-width: none; flex: 1 1 100%; }
}
/* Registro attività: data e ora su una riga */
.audit-grid td.main { white-space: nowrap; }

/* Campo a scelta troppo stretto per il nome scelto: il nome intero sotto il campo */
.combo-full { display: block; margin-top: 4px; font-size: 14px; line-height: 1.35; color: var(--ink-3); overflow-wrap: anywhere; }

/* ---- Ticket: pulsante in alto, finestra «Nuovo ticket», sezione ---------------------------------- */
.tk-head.tk-wide { height: 36px; white-space: nowrap; margin-right: 4px; }
.tk-split .MuiButton-root { height: 36px; white-space: nowrap; }
.tk-split .MuiButton-root.on { background: var(--accent-soft); color: var(--accent); }
.tk-head.tk-narrow .MuiButton-root { min-width: 40px; padding: 0 8px; }
.tk-head.tk-narrow { display: none; }
@media (max-width: 640px) {
  .tk-head.tk-wide { display: none; }
  .tk-head.tk-narrow { display: inline-flex; }
}
.tk-form > .field { margin-bottom: 16px; }
.tk-label { font-weight: 600; font-size: 14px; color: var(--ink); margin: 4px 0 8px; }
.tk-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 16px; min-height: 24px; }
.tk-file { position: relative; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 44px 8px 8px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); }
.tk-file > .tk-x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; background: var(--panel); }
.tk-file > .tk-x:hover { background: var(--soft); }
.tk-photo { flex-direction: column; align-items: stretch; width: 232px; padding: 8px; }
.tk-photo > .tk-x { top: 14px; right: 14px; box-shadow: var(--shadow); }
.tk-img { position: relative; display: block; height: 130px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--soft); cursor: pointer; }
.tk-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.tk-mark { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: rgba(28, 37, 46, 0.8); color: #fff; font-size: 14px; font-weight: 600; }
.tk-img:hover .tk-mark, .tk-img:focus-visible .tk-mark { background: var(--accent); }
.tk-name { display: flex; flex-direction: column; min-width: 0; padding: 8px 4px 2px; font-size: 14px; line-height: 1.4; }
.tk-name > span:first-child { overflow-wrap: anywhere; font-weight: 600; }
.tk-doc { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--soft); color: var(--ink-2); }
.tk-voice { min-width: 300px; }
.tk-voice > .ic { flex: none; margin-left: 4px; color: var(--accent); }
.tk-voice-body { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.tk-voice audio, .tk-att audio { width: 280px; max-width: 100%; height: 40px; }
.tk-wait { padding-right: 16px; }
.tk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tk-paste { flex-basis: 100%; }
.tk-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid rgba(255, 86, 48, 0.32); border-radius: 12px; background: rgba(255, 86, 48, 0.06); }
.tk-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #ff2d20; animation: tk-blink 1.2s ease-in-out infinite; }
@keyframes tk-blink { 50% { opacity: 0.25; } }
.tk-meter { width: 140px; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.tk-meter > span { display: block; width: 100%; height: 100%; background: var(--accent-bright); transform: scaleX(0.03); transform-origin: left center; transition: transform 80ms linear; }
.tk-drag { outline: 2px dashed var(--accent-bright); outline-offset: 8px; border-radius: 12px; }
.tk-leave { flex: 1; min-width: 200px; font-size: 14px; font-weight: 600; color: var(--bad); }
.tk-marker { display: block; width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 8px; cursor: crosshair; touch-action: none; }
/* Elenco */
.tk-search { flex: 0 1 340px; min-width: 0; }
.tk-search .MuiInputBase-root { width: 100%; }
.tk-what > span { display: block; }
.tk-what .tk-kind { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.tk-what .tk-text { max-width: 680px; overflow-wrap: anywhere; }
.tk-has-reply { display: inline-flex !important; align-items: center; gap: 4px; margin-top: 2px; font-weight: 600; color: var(--accent); }
.tk-counts { display: inline-flex; gap: 12px; color: var(--ink-2); white-space: nowrap; }
.tk-counts > span { display: inline-flex; align-items: center; gap: 4px; }
/* Dettaglio */
.tk-view section { margin-bottom: 20px; }
.tk-view-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.tk-h { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.tk-message { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--soft); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-reply .tk-message { background: var(--accent-soft); margin-bottom: 6px; }
.tk-atts { display: flex; flex-direction: column; gap: 16px; }
.tk-att-photo { margin: 0; }
.tk-att-photo img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.tk-att-photo figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.tk-att-wait { display: flex; align-items: center; justify-content: center; height: 160px; border-radius: 8px; background: var(--soft); }
.tk-att-voice { display: flex; flex-direction: column; gap: 6px; }
.tk-att-voice strong { display: inline-flex; align-items: center; gap: 6px; }
.tk-att-doc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; }
.tk-admin { padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .tk-photo, .tk-voice { width: 100%; min-width: 0; }
  .tk-rec-hint { display: none; }
  .tk-search { flex: 1 1 100%; }
  /* Scelte affiancate nelle finestre: sul telefono vanno a capo invece di uscire dal riquadro */
  .modal .seg { width: 100%; height: auto; flex-wrap: wrap; }
  .modal .seg .MuiToggleButton-root { flex: 1 1 auto; }
}

/* ---- Tema scuro (Impostazioni → Scuro) --------------------------------------------------------------
   I colori del gestionale seguono il tema: stesse variabili, valori scuri di Minimal (fondo grigio 900, riquadri
   grigio 800, testo bianco, grigio 500 per il secondario). Le parti con il bianco scritto fisso prendono il riquadro.
   Il tema chiaro resta com'era; le stampe restano sempre chiare (vedi in fondo). */
[data-color-scheme='dark'] {
  --panel: var(--palette-background-paper, #1c252e);
  --soft: #28323d;
  --row-soft: #222b35;
  --ink: #ffffff;
  --ink-2: #c4cdd5;
  --ink-3: #919eab;             /* testo secondario: 5,6:1 sui riquadri */
  --hover: rgba(145, 158, 171, 0.12);
  --accent: var(--palette-primary-light, #5be49b);
  --accent-2: var(--palette-primary-lighter, #c8fad6);
  --ok: #77ed8b;
  --warn: #ffd666;
  --bad: #ffac82;
  --info: #61f3f3;
  --shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2), 0 12px 24px -4px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 0 2px 0 rgba(0, 0, 0, 0.24), -20px 20px 40px -4px rgba(0, 0, 0, 0.24);
}
[data-color-scheme='dark'] .tabbar,
[data-color-scheme='dark'] .start-item,
[data-color-scheme='dark'] .linked-item,
[data-color-scheme='dark'] .link-item,
[data-color-scheme='dark'] .tile,
[data-color-scheme='dark'] .alert-row,
[data-color-scheme='dark'] .quick-row,
[data-color-scheme='dark'] .back-link,
[data-color-scheme='dark'] .tour-card,
[data-color-scheme='dark'] .tour-keys .kbd,
[data-color-scheme='dark'] .sticky-actions,
[data-color-scheme='dark'] .scan-box .in.MuiOutlinedInput-root { background: var(--panel); }
[data-color-scheme='dark'] .MuiOutlinedInput-root { background: transparent; }
[data-color-scheme='dark'] .tab:hover { background: var(--hover); }
[data-color-scheme='dark'] .tab-x:hover { background: rgba(255, 255, 255, 0.08); }
[data-color-scheme='dark'] .membership,
[data-color-scheme='dark'] .child-row,
[data-color-scheme='dark'] .grid tr.sub-row td,
[data-color-scheme='dark'] .lines tr.note-row td,
[data-color-scheme='dark'] .lines tr.note-row td.c-prod { background: var(--row-soft); }
[data-color-scheme='dark'] .update { border-bottom-color: var(--line); color: var(--accent); }
[data-color-scheme='dark'] .sheet-notes { color: var(--warn); }
[data-color-scheme='dark'] .alert-row.warn { background: var(--warn-bg); border-color: rgba(255, 171, 0, 0.32); }
[data-color-scheme='dark'] .alert-row.bad { background: var(--bad-bg); border-color: rgba(255, 86, 48, 0.32); }
[data-color-scheme='dark'] .doc-actions { background: linear-gradient(to top, var(--page) 75%, transparent); }
/* Pulsante principale nello scuro: chiaro con testo scuro (come Minimal); il tasto scritto dentro resta leggibile */
[data-color-scheme='dark'] .btn.primary .kbd { background: rgba(28, 37, 46, 0.1); color: #1c252e; }
@media (max-width: 640px) {
  [data-color-scheme='dark'] .grid tr,
  [data-color-scheme='dark'] .lines tr { background: var(--panel); }
}
/* Bozza: «Salva la bozza» e «Conferma …» con l'effetto scritto sotto ciascuno */
.act-choice { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.act-hint { max-width: 360px; font-size: 14px; line-height: 1.3; color: var(--ink-3); text-align: center; }
@media (max-width: 640px) {
  .act-choice { flex: 1 1 140px; }
  .doc-actions .act-choice .btn { width: 100%; }
}
/* Leggibilità (contrasto almeno 4,5:1, chiaro e scuro): scelta selezionata e pulsanti rossi con la tinta del testo */
.seg .MuiToggleButton-root.Mui-selected { color: var(--accent); }
.btn.danger.MuiButton-outlined, .btn.danger.MuiButton-text { color: var(--bad); }
/* Stampe e PDF: sempre chiari, anche con il tema scuro */
@media print {
  [data-color-scheme='dark'] {
    color-scheme: light;
    --page: #ffffff; --bg: #f4f6f8; --panel: #ffffff; --soft: #f4f6f8; --row-soft: #fafbfc;
    --ink: #1c252e; --ink-2: #454f5b; --ink-3: #637381;
    --ok: #007867; --warn: #7a4100; --bad: #b71d18; --info: #006c9c;
  }
}

/* ---- Lettura merce: postazione di magazzino (telefono, terminale, PC in banchina) ------------------------- */
.wh { max-width: 1000px; }
.wh-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.wh-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 180px; padding: 28px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow); font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.wh-choice:hover, .wh-choice:focus-visible { border-color: var(--accent); }
.wh-choice-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.wh-choice-ic .ic { width: 28px; height: 28px; }
.wh-choice-title { font-size: 24px; font-weight: 700; }
.wh-choice-text { font-size: 16px; color: var(--ink-3); }
.wh-list { padding: 20px; margin-bottom: 20px; }
.wh-list h2 { margin-bottom: 12px; }
.wh-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 8px; }
.wh-list-head h2 { margin: 0; }
.wh-row { display: flex; align-items: center; gap: 16px; width: 100%; margin-top: 8px; padding: 16px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.wh-row:hover, .wh-row:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.wh-row .grow { display: flex; flex-direction: column; gap: 4px; }
.wh-row strong { font-size: 18px; }
.wh-go { flex: none; padding: 8px 16px; border-radius: 10px; background: var(--ink); color: var(--panel); font-size: 15px; font-weight: 700; }
.wh-progress { display: flex; align-items: center; gap: 10px; }
.wh-progress .meter { flex: 0 1 200px; }
/* Lettura dei cartoni */
.wh-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 16px; }
.wh-top h1 { font-size: 26px; }
.wh-total { display: flex; flex-direction: column; align-items: flex-end; font-size: 16px; color: var(--ink-3); }
.wh-total strong { font-size: 24px; color: var(--ink); }
.wh-signal { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 20px 24px; border: 2px solid var(--line-2); border-radius: 18px; background: var(--panel); color: var(--ink); }
.wh-signal > .ic { flex: none; width: 36px; height: 36px; }
.wh-signal strong { display: block; font-size: 22px; line-height: 1.3; }
.wh-signal .grow > span { display: block; margin-top: 4px; font-size: 16px; }
.wh-signal.ok { border-color: #22c55e; background: var(--ok-bg); color: var(--ok); }
.wh-signal.warn { border-color: #ffab00; background: var(--warn-bg); color: var(--warn); }
.wh-signal.bad { border-color: #ff5630; background: var(--bad-bg); color: var(--bad); }
.wh-scan { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.wh-field { flex: 1 1 320px; }
.wh-field .MuiInputBase-root { min-height: 56px; }
.wh-field input { font-size: 20px; }
.wh .btn.wh-btn { height: 52px; padding: 0 20px; font-size: 16px; }
.wh-item { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.wh-list h2 + .wh-item { border-top: 0; }
.wh-item .grow { display: flex; flex-direction: column; gap: 6px; }
.wh-item strong { font-size: 17px; }
.wh-count { flex: none; font-size: 17px; font-weight: 700; white-space: nowrap; }
.wh-item.complete .wh-count { color: var(--ok); }
.wh-item.over .wh-count { color: var(--warn); }
.wh-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: var(--page); }
@media (max-width: 640px) {
  .wh-choice { min-height: 140px; padding: 20px; }
  .wh-choice-title { font-size: 21px; }
  .wh-top h1 { font-size: 21px; }
  .wh-signal { padding: 16px; }
  .wh-signal strong { font-size: 19px; }
  .wh-actions .grow { display: none; }
  .wh-actions .btn { flex: 1 1 auto; }
  .wh-item { flex-wrap: wrap; }
  .wh-top { flex-direction: column; align-items: stretch; gap: 8px; }
  .wh-top > .btn { align-self: flex-start; }
  .wh-total { flex-direction: row; align-items: baseline; gap: 10px; }
  .wh-scan > .btn { flex: 1 1 auto; }
}
.wh-back .ic { transform: rotate(180deg); }

/* Officina (modifiche automatiche dai ticket): numero sul pulsante, domande e risposte, preventivo, prova */
.tk-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 6px; border-radius: 11px; background: var(--palette-error-dark, #b71d18); color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.tk-head.tk-narrow .tk-count { margin-left: 4px; }
.tk-thread { display: flex; flex-direction: column; gap: 10px; }
.tk-thread > .tk-h { margin-bottom: 2px; }
.tk-notice { margin: 0; }
.tk-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; }
.tk-msg.tecnoside { align-self: flex-start; border-top-left-radius: 4px; background: var(--accent-soft); }
.tk-msg.cliente { align-self: flex-end; border-top-right-radius: 4px; background: var(--soft); }
.tk-msg.faint p { color: var(--ink-3); font-style: italic; }
.tk-msg-who { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.tk-msg p { margin: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-quote-num { margin: 0 0 8px; font-size: 15px; }
.tk-try { margin-top: 10px; }
.tk-confirm { flex: 1; min-width: 200px; font-size: 14px; font-weight: 600; color: var(--ink); }
@media (max-width: 640px) {
  .tk-msg { max-width: 100%; }
  .tk-close-extra { display: none !important; }
}

/* Trasporti (ACQ-09): pannello del vettore con tariffe, registro dei viaggi e fatture */
.tr-section { margin-top: 20px; }
.tr-rate-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 12px; }
.tr-rate-form .field { margin: 0; }
.tr-rate-form .btn.primary { margin-left: auto; }
.tr-trips { display: inline-flex; align-items: center; gap: 8px; }
.tr-trips .btn.small { min-width: 32px; padding: 0 8px; }
.tr-invoices { list-style: none; margin: 0; padding: 0; }
.tr-invoices li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 14px; }
.tr-invoices li:last-child { border-bottom: 0; }

/* Ambiente di prova dell'Officina: riga fissa in basso, sopra a tutto, che non blocca i clic */
.prova-flag {
  position: fixed; left: 50%; bottom: 12px; z-index: 2000; transform: translateX(-50%); pointer-events: none;
  padding: 6px 16px; border-radius: 999px; background: var(--palette-warning-main, #ffab00); color: #1c252e;
  font-size: 14px; font-weight: 700; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16); white-space: nowrap;
}
