/* Autofficina Del Ponte — prototype stylesheet.
   Tokens identical to video/sorgente/styles.css (Pannello sagomato), components for a real workshop manager. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(fonts/Archivo-latin.woff2) format("woff2"); 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: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(fonts/Archivo-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Archivo Narrow"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/ArchivoNarrow-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo Narrow"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/ArchivoNarrow-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0, U+A720-A7FF; }
@font-face { font-family: "Saira Stencil One"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/SairaStencilOne-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: "Saira Stencil One"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/SairaStencilOne-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20C0, U+A720-A7FF; }

:root {
  --pannello: #5f7d6c;
  --pannello-scuro: #4f6b5c;
  --pannello-foro: #3a4f44;
  --piastra: #f3f2ec;
  --piastra-2: #e8e7df;
  --bianco: #fdfdfa;
  --inchiostro: #1d2321;
  --inchiostro-2: #48514c;
  --filo: #c9cac1;
  --manca: #c8321f;
  --manca-scuro: #a62716;
  --manca-velo: #f6e2dc;
  --in-lavorazione: #d9a520;
  --pagato: #2f6b3a;
  --pagato-velo: #e3ede3;
  --targa-blu: #003399;
  --metallo: #27302c;
  --ombra-piastra: 0 10px 18px -10px rgba(18, 28, 23, 0.55), 0 2px 4px rgba(18, 28, 23, 0.22);
  --ombra-bassa: 0 4px 10px -4px rgba(18, 28, 23, 0.45);
  --ui: "Archivo", "Helvetica Neue", "Liberation Sans", sans-serif;
  --stencil: "Saira Stencil One", "Archivo", sans-serif;
  --narrow: "Archivo Narrow", "Archivo", sans-serif;
  --binario: 118px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 90px; }
body {
  font-family: var(--ui); font-size: 16px; line-height: 1.4; color: var(--inchiostro);
  background-color: var(--pannello);
  background-image: radial-gradient(circle at 12px 12px, var(--pannello-foro) 0 3px, rgba(58, 79, 68, 0.35) 3.4px, transparent 4.2px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
::selection { background: var(--in-lavorazione); color: var(--inchiostro); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--in-lavorazione); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.ic.pieno { fill: currentColor; stroke: none; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--pannello-scuro); border-radius: 6px; border: 3px solid var(--piastra-2); }
::-webkit-scrollbar-track { background: var(--piastra-2); }

/* ---------- Shell ---------- */
.guscio { display: grid; grid-template-columns: var(--binario) minmax(0, 1fr); min-height: 100vh; }
.binario {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--pannello-scuro); box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; gap: 3px; padding: 14px 9px;
}
.binario .officina {
  font-family: var(--stencil); color: var(--piastra); font-size: 15px; line-height: 1.05; letter-spacing: 0.02em;
  text-align: center; padding: 6px 2px 14px; margin-bottom: 6px; border-bottom: 1px solid rgba(243, 242, 236, 0.22);
  text-decoration: none;
}
.zona {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border-radius: 4px;
  color: var(--piastra); text-decoration: none; font-family: var(--stencil); font-size: 12.5px; letter-spacing: 0.04em;
}
.zona svg.ic { width: 22px; height: 22px; }
.zona:hover { background: rgba(243, 242, 236, 0.1); }
.zona[aria-current="page"] { background: var(--piastra); color: var(--inchiostro); box-shadow: var(--ombra-bassa); }
.binario .spazio { flex-grow: 1; }

.corpo { display: flex; flex-direction: column; min-width: 0; }
.testata {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: rgba(79, 107, 92, 0.94); backdrop-filter: blur(6px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.testata .nome-officina { display: none; }
.cerca { position: relative; flex-grow: 1; max-width: 460px; }
.cerca label { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; background: var(--piastra); border-radius: 4px; box-shadow: var(--ombra-bassa); }
.cerca svg.ic { color: var(--inchiostro-2); }
.cerca input { border: 0; background: transparent; outline: 0; width: 100%; font-size: 17px; font-weight: 600; }
.cerca input::placeholder { color: #5a625e; font-weight: 500; }
.cerca-risultati {
  position: absolute; left: 0; right: 0; top: 52px; background: var(--bianco); border-radius: 5px; box-shadow: var(--ombra-piastra);
  padding: 6px; z-index: 30; display: flex; flex-direction: column;
}
.cerca-risultati a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 4px; text-decoration: none; }
.cerca-risultati a:hover, .cerca-risultati a:focus-visible { background: var(--piastra-2); }
.cerca-risultati .vuoto-cerca { padding: 12px; color: var(--inchiostro-2); font-weight: 600; }
.testata .spingi { flex-grow: 1; }
.campanella {
  position: relative; width: 46px; height: 46px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--piastra); color: var(--inchiostro); text-decoration: none; box-shadow: var(--ombra-bassa);
}
.campanella svg.ic { width: 22px; height: 22px; }
.campanella .conta-n {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--manca); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}

.vista:focus { outline: none; }
.vista { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pagina-testa { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pagina-testa .titoli { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pagina-testa h1 { font-family: var(--stencil); font-weight: 400; font-size: 28px; line-height: 1.05; color: var(--piastra); letter-spacing: 0.02em; }
.pagina-testa .sotto { font-size: 19px; font-weight: 800; color: var(--piastra); }
.pagina-testa .azioni { display: flex; gap: 10px; flex-wrap: wrap; }
.indietro-link { display: inline-flex; align-items: center; gap: 6px; color: var(--piastra); font-weight: 800; text-decoration: none; font-size: 19px; }
.indietro-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Plates ---------- */
.piastra { position: relative; background: var(--piastra); border-radius: 5px; box-shadow: var(--ombra-piastra); padding: 20px 22px; }
.piastra.stretta { padding: 14px 16px; }
.piastra-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.etichetta { font-size: 13px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--inchiostro-2); display: inline-flex; align-items: center; gap: 8px; }
.etichetta svg.ic { width: 18px; height: 18px; }
.titolo-piastra { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.titolo-piastra svg.ic { width: 22px; height: 22px; }
.conta { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--inchiostro); color: var(--piastra); font-size: 14px; font-weight: 800; }

/* hung plates: only on Oggi */
.barra-ganci { height: 12px; border-radius: 6px; background: linear-gradient(180deg, #56615b, #2a332f 60%, #1f2623); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35); }
.piastra-appesa { margin-top: 18px; padding-top: 30px; }
.gancio { position: absolute; top: -22px; left: 50%; width: 34px; height: 30px; margin-left: -17px; color: var(--metallo); pointer-events: none; }
.gancio path { fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; }
.gancio circle { fill: currentColor; }
.foro { position: absolute; top: 9px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--pannello-foro); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }

/* ---------- Plate (targa) ---------- */
.targa {
  display: inline-flex; align-items: stretch; height: 34px; border-radius: 4px; overflow: hidden; flex-shrink: 0; vertical-align: middle;
  background: #fbfbf8; border: 1.5px solid #1d2321; font-family: var(--narrow); font-weight: 700; color: #111; line-height: 1; text-decoration: none;
}
.targa .ue, .targa .prov { width: 18px; background: var(--targa-blu); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 3px; font-family: var(--ui); font-size: 9px; font-weight: 700; }
.targa .ue svg { width: 12px; height: 12px; margin-bottom: 2px; }
.targa .ue svg circle { fill: #ffcc00; }
.targa .numero { display: flex; align-items: center; padding: 0 9px; font-size: 21px; letter-spacing: 0.05em; white-space: nowrap; }
.targa.grande { height: 64px; border-width: 2px; border-radius: 6px; }
.targa.grande .ue, .targa.grande .prov { width: 32px; font-size: 15px; padding-bottom: 7px; }
.targa.grande .ue svg { width: 20px; height: 20px; margin-bottom: 4px; }
.targa.grande .numero { font-size: 44px; padding: 0 18px; }
.targa.piccola { height: 26px; }
.targa.piccola .ue, .targa.piccola .prov { width: 13px; font-size: 7px; padding-bottom: 2px; }
.targa.piccola .ue svg { width: 9px; height: 9px; }
.targa.piccola .numero { font-size: 16px; padding: 0 7px; }
a.targa:hover { box-shadow: 0 0 0 3px var(--in-lavorazione); }

/* ---------- States as physical marks ---------- */
.cartellino {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 21px; border-radius: 3px 4px 4px 3px;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; border: 1.5px solid transparent;
}
.cartellino::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--piastra); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.25); }
.cartellino.lavorazione { background: var(--in-lavorazione); color: var(--inchiostro); }
.cartellino.finita { background: var(--inchiostro); color: var(--piastra); }
.cartellino.scaduto { background: var(--manca); color: #fff; }
.cartellino.bozza, .cartellino.consegnata { background: transparent; border-color: var(--inchiostro); color: var(--inchiostro); }
.cartellino.consegnata { border-style: solid; color: var(--inchiostro-2); border-color: var(--inchiostro-2); }
.cartellino.attesa { background: var(--manca-velo); border: 1.5px dashed var(--manca); color: var(--manca-scuro); }
.cartellino.dettato { background: var(--inchiostro); color: var(--piastra); padding-left: 10px; text-transform: none; letter-spacing: 0; }
.cartellino.dettato::before { display: none; }
.cartellino.dettato svg.ic { width: 14px; height: 14px; color: var(--in-lavorazione); }
.timbro {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 11px; border: 3px double var(--pagato); border-radius: 4px;
  color: var(--pagato); font-family: var(--stencil); font-size: 17px; letter-spacing: 0.1em; transform: rotate(-6deg); background: rgba(47, 107, 58, 0.06); white-space: nowrap;
}
.timbro.piccolo { height: 24px; font-size: 13px; padding: 0 7px; }
.sagoma { border: 2.5px dashed var(--manca); border-radius: 6px; background: var(--manca-velo); }
.soldi { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.rosso { color: var(--manca); }
.verde { color: var(--pagato); }
.debole { color: var(--inchiostro-2); }
.piccolo-testo { font-size: 14px; font-weight: 600; }
.persona { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.iniziale { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--pannello-scuro); color: var(--piastra); font-size: 12px; font-weight: 800; flex-shrink: 0; }
.avanzamento { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.barretta { width: 70px; height: 8px; border-radius: 4px; background: var(--filo); overflow: hidden; }
.barretta i { display: block; height: 100%; background: var(--inchiostro); }

/* ---------- Tables ---------- */
.tabella { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.tabella th { text-align: left; font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--inchiostro-2); padding: 0 12px 9px; border-bottom: 2px solid var(--inchiostro); white-space: nowrap; }
.tabella td { padding: 12px 12px; border-bottom: 1px solid var(--filo); vertical-align: middle; }
.tabella tr:last-child td { border-bottom: 0; }
.tabella .num { text-align: right; }
.tabella tr.cliccabile { cursor: pointer; }
.tabella tr.cliccabile:hover td { background: var(--piastra-2); }
.tabella a.riga-link { font-weight: 800; text-decoration: none; }
.tabella a.riga-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tabella tfoot td { font-weight: 800; border-top: 2px solid var(--inchiostro); border-bottom: 0; }
.n-scheda { font-family: var(--stencil); font-size: 15px; letter-spacing: 0.03em; white-space: nowrap; }

/* ---------- Tabs ---------- */
.linguette { display: flex; gap: 6px; flex-wrap: wrap; }
.linguetta {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 4px; text-decoration: none; font-weight: 700; font-size: 15px;
  background: var(--pannello-scuro); color: var(--piastra);
}
.linguetta:hover { background: #445d50; }
.linguetta[aria-current="true"] { background: var(--piastra); color: var(--inchiostro); box-shadow: var(--ombra-bassa); }
.linguetta .conta { height: 22px; min-width: 22px; font-size: 12px; background: rgba(29, 35, 33, 0.72); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 4px;
  border: 2px solid var(--inchiostro); background: transparent; color: var(--inchiostro); font-size: 15.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms ease-out, box-shadow 150ms ease-out;
}
.btn:hover { background: var(--piastra-2); }
.btn:active { transform: translateY(1px); }
.btn.pieno { background: var(--inchiostro); color: var(--piastra); }
.btn.pieno:hover { background: #2f3835; }
.btn.pieno svg.ic { color: var(--in-lavorazione); }
.btn.voce { background: var(--inchiostro); color: var(--piastra); border-color: var(--inchiostro); min-height: 46px; box-shadow: var(--ombra-bassa); }
.btn.voce svg.ic { color: var(--in-lavorazione); width: 22px; height: 22px; }
.btn.su-parete { background: var(--piastra); border-color: var(--piastra); box-shadow: var(--ombra-bassa); }
.btn.su-parete:hover { background: #fff; }
.btn.pericolo { border-color: var(--manca); color: var(--manca-scuro); }
.btn.pericolo:hover { background: var(--manca-velo); }
.btn.pagato { border-color: var(--pagato); color: var(--pagato); }
.btn.pagato:hover { background: var(--pagato-velo); }
.btn.piccolo { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.motivo { font-size: 14px; font-weight: 600; color: var(--inchiostro-2); }
.azioni-riga { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span:not(.aiuto), .campo > .etichetta-campo { font-size: 13px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--inchiostro-2); }
.campo input, .campo select, .campo textarea {
  min-height: 46px; padding: 10px 12px; border: 2px solid var(--inchiostro); border-radius: 4px; background: var(--bianco); font-size: 16px; font-weight: 600; width: 100%;
}
.campo textarea { min-height: 88px; resize: vertical; line-height: 1.4; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 3px solid var(--in-lavorazione); outline-offset: 1px; }
.campo .aiuto { font-size: 13.5px; font-weight: 600; color: var(--inchiostro-2); }
.campi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.campi.tre { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.campi .largo { grid-column: 1 / -1; }

.spunta { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; border: 2.5px solid var(--inchiostro); border-radius: 4px; background: var(--bianco); cursor: pointer; flex-shrink: 0; position: relative; margin: 0; }
.spunta:checked { background: var(--inchiostro); }
.spunta:checked::after { content: ""; position: absolute; left: 8px; top: 3px; width: 7px; height: 13px; border: solid var(--piastra); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.spunta:hover { box-shadow: 0 0 0 3px rgba(217, 165, 32, 0.45); }

.interruttore { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.interruttore input { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 13px; background: var(--filo); position: relative; cursor: pointer; margin: 0; transition: background-color 150ms ease-out; }
.interruttore input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 150ms ease-out; }
.interruttore input:checked { background: var(--inchiostro); }
.interruttore input:checked::after { transform: translateX(20px); }

.scelte { display: flex; gap: 8px; flex-wrap: wrap; }
.scelta { position: relative; }
.scelta input { position: absolute; opacity: 0; pointer-events: none; }
.scelta span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--inchiostro); border-radius: 4px; font-weight: 700; cursor: pointer; background: var(--bianco); }
.scelta input:checked + span { background: var(--inchiostro); color: var(--piastra); }
.scelta input:focus-visible + span { outline: 3px solid var(--in-lavorazione); outline-offset: 2px; }

/* ---------- Feedback ---------- */
.avvisi { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.avviso {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px 10px 12px; border-radius: 6px;
  background: var(--inchiostro); color: var(--piastra); font-weight: 700; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.6);
  animation: avviso-entra 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.avviso .segno { width: 28px; height: 28px; border-radius: 50%; background: var(--pagato); display: inline-flex; align-items: center; justify-content: center; }
.avviso .segno svg.ic { width: 16px; height: 16px; stroke-width: 3; color: #fff; }
.avviso button { border: 0; background: transparent; color: var(--in-lavorazione); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; min-height: 36px; padding: 0 6px; }
@keyframes avviso-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.striscia-conferma {
  display: flex; flex-direction: column; gap: 12px; margin-top: 10px; padding: 14px 16px; border-radius: 5px; background: var(--bianco);
  border: 2px solid var(--inchiostro); box-shadow: var(--ombra-bassa); animation: avviso-entra 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.striscia-conferma .domanda { font-weight: 800; font-size: 16px; }

.pannello-laterale {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; z-index: 50; background: var(--piastra);
  box-shadow: -18px 0 36px -18px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; animation: pannello-entra 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pannello-laterale .pl-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 2px solid var(--inchiostro); }
.pannello-laterale .pl-corpo { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.pannello-laterale .pl-piede { padding: 14px 22px 20px; border-top: 1px solid var(--filo); display: flex; gap: 10px; }
@keyframes pannello-entra { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.vuoto { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px; border: 2px dashed var(--filo); border-radius: 6px; }
.vuoto .vt { font-weight: 800; font-size: 17px; }
.vuoto p { color: var(--inchiostro-2); font-weight: 600; }

/* ---------- Layout helpers ---------- */
.griglia-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.griglia-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.colonna { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.riga-flex { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tra { justify-content: space-between; }
.nascosto, [hidden] { display: none !important; }
.solo-lettore { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.solo-stampa { display: none; }

/* ---------- Photo placeholders ---------- */
.foto-striscia { display: flex; gap: 12px; flex-wrap: wrap; }
.foto {
  width: 132px; height: 100px; border-radius: 5px; position: relative; overflow: hidden; flex-shrink: 0;
  background: repeating-linear-gradient(135deg, #cfd3ca 0 10px, #c4c9bf 10px 20px); border: 1.5px solid var(--filo);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 6px 8px;
}
.foto svg.ic { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -22px 0 0 -15px; color: var(--inchiostro-2); }
.foto .didascalia { position: relative; font-size: 12px; font-weight: 800; background: rgba(253, 253, 250, 0.9); border-radius: 3px; padding: 2px 6px; align-self: flex-start; }

/* ---------- Paper (PDF preview / print) ---------- */
.foglio { background: #fffffc; border-radius: 3px; box-shadow: var(--ombra-piastra); padding: 40px 44px 34px; display: flex; flex-direction: column; gap: 20px; max-width: 820px; }
.foglio-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 16px; border-bottom: 3px solid var(--inchiostro); }
.foglio .f-off { font-family: var(--stencil); font-size: 26px; line-height: 1.05; }
.foglio .f-tipo { text-align: right; font-weight: 800; letter-spacing: 0.06em; font-size: 13px; }
.foglio .f-n { font-family: var(--stencil); font-size: 30px; }
.foglio .f-totale { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; background: var(--piastra); border-radius: 4px; font-size: 19px; font-weight: 800; }
.foglio .f-totale .soldi { font-size: 30px; }
.logo-segnaposto { width: 64px; height: 64px; border: 2px dashed var(--filo); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--inchiostro-2); text-align: center; }

/* ---------- Chat (identical classes to the video) ---------- */
.telefono {
  width: 390px; max-width: 100%; height: 760px; overflow: hidden; display: flex; flex-direction: column; border-radius: 26px; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6), 0 0 0 10px #151a18;
  background-color: #dfe3db; background-image: radial-gradient(circle at 12px 12px, rgba(58, 79, 68, 0.16) 0 2.6px, transparent 3.2px); background-size: 24px 24px;
}
.chat-testa { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 16px 10px 12px; background: var(--pannello-scuro); color: var(--piastra); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--piastra); color: var(--inchiostro); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar svg.ic { width: 24px; height: 24px; }
.chat-testa .nome { font-size: 18px; font-weight: 800; }
.chat-testa .stato { font-size: 14px; font-weight: 600; opacity: 0.92; }
.chat-corpo { flex-grow: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; }
.giorno { align-self: center; padding: 4px 12px; border-radius: 12px; background: rgba(29, 35, 33, 0.72); color: var(--piastra); font-size: 13px; font-weight: 700; }
.bolla { max-width: 300px; padding: 10px 12px 8px; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); font-size: 16px; line-height: 1.38; }
.bolla.mia { align-self: flex-end; background: #fbfbf6; border-bottom-right-radius: 3px; }
.bolla.bot { align-self: flex-start; background: var(--piastra); border-bottom-left-radius: 3px; border-top: 4px solid var(--inchiostro); max-width: 330px; }
.bolla .ora { display: block; text-align: right; font-size: 12px; font-weight: 600; color: var(--inchiostro-2); margin-top: 4px; }
.vocale { display: flex; align-items: center; gap: 10px; }
.vocale .play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--inchiostro); color: var(--piastra); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vocale .play svg.ic { width: 16px; height: 16px; }
.onda { display: flex; align-items: center; gap: 3px; height: 32px; }
.onda i { display: block; width: 3px; border-radius: 2px; background: var(--inchiostro); }
.onda i.spenta { background: #9aa39e; }
.vocale .durata { font-size: 14px; font-weight: 700; color: var(--inchiostro-2); }
.trascritto { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--filo); font-size: 16px; line-height: 1.4; }
.trascritto .etichetta { display: block; font-size: 12px; margin-bottom: 3px; }
.scheda-bot { display: flex; flex-direction: column; gap: 8px; min-width: 0; width: 296px; max-width: 100%; }
.scheda-bot .esito { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; }
.spunta-tonda { width: 30px; height: 30px; border-radius: 50%; background: var(--inchiostro); color: var(--piastra); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.spunta-tonda svg.ic { width: 17px; height: 17px; stroke-width: 3; }
.righe { display: flex; flex-direction: column; }
.riga { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 34px; padding: 5px 0; border-bottom: 1px solid var(--filo); font-size: 15px; }
.riga:last-child { border-bottom: 0; }
.riga .k { color: var(--inchiostro-2); font-weight: 600; }
.riga .v { font-weight: 800; text-align: right; }
.scheda-bot .nota { font-size: 14px; font-weight: 600; color: var(--inchiostro-2); }
.azioni-bot { display: flex; gap: 8px; flex-wrap: wrap; }
.azioni-bot .btn { min-height: 40px; font-size: 14px; padding: 0 12px; flex-grow: 1; }
.chat-piede { display: flex; align-items: center; gap: 10px; padding: 10px 12px 14px; background: var(--piastra); box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12); }
.chat-piede .campo-chat { flex-grow: 1; min-height: 48px; border-radius: 24px; background: #fff; border: 1.5px solid var(--filo); padding: 0 16px; font-size: 16px; font-weight: 600; }
.microfono { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--inchiostro); color: var(--in-lavorazione); display: flex; align-items: center; justify-content: center; box-shadow: var(--ombra-bassa); flex-shrink: 0; }
.microfono svg.ic { width: 26px; height: 26px; }

/* ---------- Bottom bar (phone) ---------- */
.barra-basso { display: none; }

@media (max-width: 720px) {
  .guscio { grid-template-columns: minmax(0, 1fr); }
  .binario { display: none; }
  .testata { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .testata .nome-officina { display: block; font-family: var(--stencil); color: var(--piastra); font-size: 18px; flex-grow: 1; text-decoration: none; }
  .cerca { order: 3; max-width: none; flex-basis: 100%; }
  .testata .spingi, .testata .solo-ufficio { display: none; }
  .vista { padding: 16px 12px 110px; gap: 16px; }
  .pagina-testa h1 { font-size: 24px; }
  .pagina-testa .azioni { width: 100%; }
  .piastra { padding: 16px 14px; }
  .griglia-2, .griglia-3, .campi, .campi.tre { grid-template-columns: minmax(0, 1fr); }
  .tabella.a-schede thead { display: none; }
  .tabella.a-schede, .tabella.a-schede tbody, .tabella.a-schede tr, .tabella.a-schede td { display: block; width: 100%; }
  .tabella.a-schede tr { padding: 12px 0; border-bottom: 1px solid var(--filo); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
  .tabella.a-schede td { border: 0; padding: 0; width: auto; }
  .tabella.a-schede td.num { text-align: left; }
  .tabella.a-schede td[data-etichetta]::before { content: attr(data-etichetta) " "; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--inchiostro-2); }
  body, .tabella, .riga, .btn, .campo .aiuto, .motivo, .piccolo-testo, .avanzamento { font-size: 16px; }
  .etichetta, .campo > span:not(.aiuto) { font-size: 14.5px; }
  .cartellino { font-size: 14px; height: 30px; }
  .foto .didascalia { font-size: 14px; }
  .tabella.a-schede td[data-etichetta]::before { font-size: 14px !important; }
  .barra-basso a[data-zona="chat"] { background: var(--inchiostro); }
  .barra-basso a[data-zona="chat"] svg.ic { color: var(--in-lavorazione); }
  .btn { min-height: 48px; }
  .avvisi { top: 12px; bottom: auto; left: 12px; right: 12px; align-items: stretch; }
  .pannello-laterale { width: 100vw; }
  .foglio { padding: 22px 16px; }
  .telefono { width: 100%; height: calc(100vh - 170px); min-height: 520px; border-radius: 0; box-shadow: none; }
  .barra-basso {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--pannello-scuro); box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .barra-basso a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; border-radius: 6px; color: var(--piastra); text-decoration: none; font-family: var(--stencil); font-size: 12px; letter-spacing: 0.04em; }
  .barra-basso a svg.ic { width: 24px; height: 24px; }
  .barra-basso a[aria-current="page"] { background: var(--piastra); color: var(--inchiostro); }
}

/* ---------- Print: only the paper ---------- */
@media print {
  body { background: #fff; }
  .binario, .testata, .barra-basso, .avvisi, .non-stampare { display: none !important; }
  .guscio { display: block; }
  .vista { padding: 0; }
  .foglio { box-shadow: none; max-width: none; padding: 0; }
  .pagina-testa { display: none; }
  .solo-stampa { display: block !important; }
}
