/* Gestionale Patrimonio — stile ispirato alla Fondazione Sant'Erasmo (bordeaux e grigio, Roboto Condensed)
   e, per le parti operative, ai gestionali desktop: barra comandi con tasti funzione, griglie fitte, schede a tab. */
:root {
  --primary: #581517;          /* bordeaux del logo */
  --primary-dark: #3d0e10;
  --primary-soft: #f4ebeb;
  --accent: #a07a7a;           /* filetti rosati del sito */
  --fascia: #d3d4d6;           /* fascia grigia sotto il menu */
  --bg: #eef0f2;
  --panel: #ffffff;
  --line: #c9ccd1;
  --line-soft: #e3e5e8;
  --text: #2c2f33;
  --muted: #6b7178;
  --sel: #f7cf9f;              /* riga selezionata (arancio, come nei gestionali desktop) */
  --sel-line: #d9933f;
  --hover: #fbf1e4;
  --ok: #2e7d32;
  --warn: #b26a00;
  --err: #b3261e;
  --radius: 4px;
  --barra-stato: 30px;
  --testata: 84px;
  --fascia-h: 54px;
  --font: 'Roboto', 'Segoe UI', Arial, sans-serif;
  --font-cond: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  --shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.4 var(--font); color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-rows: var(--testata) var(--fascia-h) 1fr var(--barra-stato); height: calc(100vh / var(--zoom, 1)); }
.testata { display: flex; align-items: center; gap: 1.2rem; padding: 0 1.2rem; background: #fff; border-bottom: 1px solid var(--line-soft); position: relative; z-index: 30; }
.testata-logo img { display: block; height: 62px; width: auto; }
.testata-app { display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 1rem; font-family: var(--font-cond); }
.testata-nome { font-size: 1.25rem; font-weight: 700; color: var(--primary); letter-spacing: .3px; }
.testata-sotto { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.menu { margin-left: auto; display: flex; align-items: stretch; gap: .2rem; height: 100%; }
.menu-voce { position: relative; display: flex; align-items: center; }
.menu-voce > a, .menu-voce > button { display: flex; align-items: center; gap: .35rem; height: 100%; padding: 0 .9rem; border: 0; background: none; cursor: pointer;
  font-family: var(--font-cond); font-weight: 700; font-size: .98rem; letter-spacing: .8px; text-transform: uppercase; color: #333; text-decoration: none; }
.menu-voce > a:hover, .menu-voce > button:hover, .menu-voce.attiva > a, .menu-voce.attiva > button { color: var(--accent); }
.menu-voce.attiva > a::after, .menu-voce.attiva > button::after { content: ''; position: absolute; left: .9rem; right: .9rem; bottom: 18px; height: 2px; background: var(--accent); }
.menu-voce.disabilitata > button { color: #a9adb2; cursor: default; }
.sottomenu { position: absolute; top: calc(100% - 10px); right: 0; min-width: 250px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--primary);
  box-shadow: var(--shadow); padding: .3rem 0; display: none; z-index: 40; }
.menu-voce:hover .sottomenu, .menu-voce.aperta .sottomenu { display: block; }
.sottomenu a { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .9rem; color: var(--text); text-decoration: none; font-size: .9rem; }
.sottomenu a:hover { background: var(--primary-soft); color: var(--primary); }
.sottomenu kbd { color: var(--muted); }
.menu-toggle { display: none; margin-left: auto; font-size: 1.4rem; background: none; border: 0; cursor: pointer; color: var(--primary); }

.fascia { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.4rem; background: var(--fascia); }
.fascia h1 { margin: 0; font-family: var(--font-cond); font-weight: 400; font-size: 1.25rem; letter-spacing: 1px; text-transform: uppercase; color: #222;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.briciole { font-family: var(--font-cond); color: #6f7880; font-size: .95rem; white-space: nowrap; }
.briciole a { color: #6f7880; text-decoration: none; }
.briciole a:hover { color: var(--primary); }
.briciole .sep { margin: 0 .4rem; }

.area { overflow: auto; padding: .9rem 1.1rem; min-height: 0; }

@media (max-width: 1000px) {
  :root { --testata: 64px; --fascia-h: 44px; }
  .testata-logo img { height: 46px; }
  .testata-sotto { display: none; }
  .menu-toggle { display: block; }
  .menu { display: none; position: absolute; top: 100%; right: 0; left: 0; flex-direction: column; height: auto; background: #fff; border-bottom: 3px solid var(--primary); box-shadow: var(--shadow); }
  .menu.aperto { display: flex; }
  .menu-voce { flex-direction: column; align-items: stretch; }
  .menu-voce > a, .menu-voce > button { padding: .7rem 1rem; }
  .menu-voce.attiva > a::after, .menu-voce.attiva > button::after { display: none; }
  .sottomenu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 .4rem 1rem; }
  .briciole { display: none; }
  .area { padding: .6rem; }
}
@media (max-width: 560px) { .testata-app { display: none; } }

/* ---------- finestra di lavoro (pannello con barra del titolo) ---------- */
.finestra { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; flex-direction: column; min-height: 0; }
.finestra + .finestra { margin-top: .8rem; }
.finestra-titolo { display: flex; align-items: center; gap: .6rem; padding: .35rem .7rem; background: linear-gradient(#6a1d20, var(--primary)); color: #fff;
  border-radius: var(--radius) var(--radius) 0 0; font-family: var(--font-cond); font-size: 1rem; letter-spacing: .4px; }
.finestra-titolo .sx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finestra-titolo .dx { font-size: .85rem; opacity: .85; white-space: nowrap; }
.finestra-corpo { padding: .7rem; min-height: 0; }
.pagina-piena { display: flex; flex-direction: column; height: 100%; }
.pagina-piena > .finestra { flex: 1; }

/* ---------- barra comandi con tasti funzione ---------- */
.comandi { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px 4px; background: linear-gradient(#fafafa, #e9ebee); border-bottom: 1px solid var(--line); }
.cmd { display: inline-flex; align-items: center; gap: .35rem; height: 28px; padding: 0 .6rem; border: 1px solid transparent; border-radius: 3px; background: none; cursor: pointer;
  white-space: nowrap; font-size: .86rem; color: #23272b; }
.cmd:hover:not(:disabled) { background: #fff; border-color: #b9bec5; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.cmd:active:not(:disabled) { background: #f0e6e6; }
.cmd:disabled { opacity: .45; cursor: default; }
.cmd .ico { font-size: 1rem; line-height: 1; }
.cmd .tasto { color: var(--muted); font-size: .78rem; }
.cmd.primario { background: var(--primary); color: #fff; border-color: var(--primary-dark); }
.cmd.primario .tasto { color: #f0d6d6; }
.cmd.primario:hover:not(:disabled) { background: #6d1b1e; border-color: var(--primary-dark); }
.cmd.pericolo:hover:not(:disabled) { color: var(--err); border-color: #e0a9a5; }
.comandi .sep { width: 1px; height: 22px; background: #c3c7cc; margin: 0 4px; }
.comandi .spazio { flex: 1; }
.comandi .cerca { display: flex; align-items: center; gap: .3rem; }
.comandi .cerca input { height: 26px; width: 260px; padding: 0 .5rem; border: 1px solid #b9bec5; border-radius: 3px; background: #fff; }
@media (max-width: 1100px) { .cmd .tasto { display: none; } }
@media (max-width: 700px) { .cmd .etichetta { display: none; } .comandi .cerca input { width: 150px; } }

/* ---------- griglia dati ---------- */
.griglia-wrap { overflow: auto; border: 1px solid var(--line); background: #fff; min-height: 120px; position: relative; }
.griglia { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.griglia th { position: sticky; top: 0; z-index: 2; background: linear-gradient(#f7f8f9, #e2e5e9); border-bottom: 1px solid #aeb4bb; border-right: 1px solid #d2d6db;
  padding: 4px 6px; text-align: left; font-weight: 600; color: #30353a; white-space: nowrap; user-select: none; }
.griglia th.ord { cursor: pointer; }
.griglia th.ord:hover { background: linear-gradient(#fff, #eceef1); }
.griglia th .freccia { color: var(--primary); margin-left: .25rem; }
.griglia td { padding: 3px 6px; border-bottom: 1px solid #eceef0; border-right: 1px solid #f1f2f4; white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; height: 24px; }
.griglia tbody tr:nth-child(even) td { background: #f8f9fa; }
.griglia tbody tr:hover td { background: var(--hover); }
.griglia tbody tr.corrente td { font-weight: 600; }
.griglia tbody tr.sel td { background: var(--sel); border-bottom-color: var(--sel-line); }
.griglia tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.griglia tbody tr { cursor: default; }
.griglia .num { text-align: right; }
.griglia .centro { text-align: center; }
.griglia .rn { color: var(--muted); text-align: right; width: 1%; background: #f3f4f6 !important; border-right: 1px solid #d2d6db; }
.griglia tfoot td { position: sticky; bottom: 0; background: #efe6e6; font-weight: 700; border-top: 2px solid var(--accent); }
.griglia .vuota td { text-align: center; color: var(--muted); padding: 2rem; height: auto; background: #fff !important; }
.griglia .mini { width: 30px; height: 22px; object-fit: cover; border-radius: 2px; vertical-align: middle; border: 1px solid #ddd; }
.griglia .gruppo td { background: #e8dede !important; font-weight: 700; color: var(--primary-dark); font-family: var(--font-cond); font-size: 13px; }
.griglia .subtot td { background: #f6efef !important; font-weight: 600; border-bottom: 1px solid #d7c4c4; }
.griglia td.edit { cursor: text; background-image: linear-gradient(transparent 85%, rgba(88,21,23,.08) 85%); }
.griglia input.cella { width: 100%; border: 1px solid var(--primary); padding: 1px 4px; text-align: right; height: 20px; }

.badge { display: inline-block; padding: 0 .45rem; border-radius: 9px; font-size: .74rem; font-weight: 600; line-height: 1.55; border: 1px solid transparent; }
.badge.N, .badge.ATTIVO { background: #e6f2e7; color: var(--ok); border-color: #c4dfc6; }
.badge.D { background: #fff3e0; color: var(--warn); border-color: #f2d3a6; }
.badge.X, .badge.ELIMINATO { background: #fde8e7; color: var(--err); border-color: #f1c0bd; }
.badge.DISMESSO, .badge.CEDUTO { background: #eceff1; color: #546e7a; border-color: #cfd8dc; }
.badge.man { background: #e8eaf6; color: #303f9f; }
.badge.cons { background: #ede7f6; color: #4527a0; }
.badge.calc { background: #f1f3f4; color: #5f6368; }

/* ---------- totali in fondo (riquadri) ---------- */
.totali { display: flex; flex-wrap: wrap; gap: .6rem; padding: .55rem .7rem; background: #f6f2f2; border-top: 1px solid var(--line); }
.totale { display: flex; flex-direction: column; min-width: 140px; padding: .25rem .6rem; background: #fff; border: 1px solid #d8cccc; border-radius: 3px; }
.totale .et { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-family: var(--font-cond); }
.totale .val { font-size: 1.05rem; font-weight: 700; text-align: right; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: .4rem; margin-left: auto; color: var(--muted); }

/* ---------- filtri (pannello ripiegabile, stile "statistiche") ---------- */
.filtri { display: flex; flex-wrap: wrap; gap: .6rem; padding: .55rem .7rem; background: #fafbfc; border-bottom: 1px solid var(--line); }
.filtri fieldset { border: 1px solid #cfd3d8; border-radius: 3px; padding: .25rem .55rem .4rem; margin: 0; min-width: 0; }
.filtri legend { font-size: .72rem; color: var(--primary); text-transform: uppercase; font-family: var(--font-cond); letter-spacing: .5px; padding: 0 .25rem; }
.filtri label { display: inline-flex; align-items: center; gap: .25rem; margin-right: .55rem; white-space: nowrap; font-size: .84rem; }
.filtri select, .filtri input[type=number] { height: 24px; border: 1px solid #b9bec5; border-radius: 3px; background: #fff; max-width: 220px; }
.filtri .azioni { display: flex; align-items: flex-end; gap: .4rem; margin-left: auto; }

/* ---------- moduli (form) ---------- */
.scheda-testa { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: .6rem .8rem; background: #fbf8f8; border-bottom: 1px solid var(--line); }
.scheda-testa .foto-testa { width: 92px; height: 70px; border: 1px solid var(--line); border-radius: 3px; background: #f1f2f4 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #a5abb1; font-size: 1.6rem; cursor: pointer; }
.scheda-testa .inv { font-family: var(--font-cond); font-size: 1.5rem; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.scheda-testa .descr { font-size: 1.05rem; font-weight: 600; }
.scheda-testa .meta { color: var(--muted); font-size: .85rem; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.scheda-testa .valori { display: grid; grid-template-columns: auto auto; gap: .1rem .8rem; font-size: .85rem; text-align: right; }
.scheda-testa .valori b { font-variant-numeric: tabular-nums; color: var(--primary-dark); }

.tabs { display: flex; gap: 2px; padding: .5rem .7rem 0; border-bottom: 1px solid var(--line); background: #f4f5f7; overflow-x: auto; }
.tab { padding: .4rem 1rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; background: linear-gradient(#fbfbfc, #e8eaed); cursor: pointer;
  font-family: var(--font-cond); font-size: .95rem; letter-spacing: .3px; white-space: nowrap; margin-bottom: -1px; color: #444; }
.tab.attiva { background: #fff; color: var(--primary); font-weight: 700; border-top: 3px solid var(--primary); }
.tab .n { display: inline-block; min-width: 1.3em; margin-left: .25rem; padding: 0 .3rem; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: .78rem; text-align: center; }
.pannello { padding: .9rem; }

.gruppo-campi { border: 1px solid #d4d7dc; border-radius: 4px; padding: .5rem .8rem .8rem; margin: 0 0 .8rem; }
.gruppo-campi > legend { padding: 0 .4rem; font-family: var(--font-cond); font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .6px; font-size: .86rem; }
.campi { display: grid; grid-template-columns: repeat(12, 1fr); gap: .45rem .7rem; }
.campo { display: flex; flex-direction: column; gap: 2px; grid-column: span 3; min-width: 0; }
.campo.s1 { grid-column: span 1; } .campo.s2 { grid-column: span 2; } .campo.s4 { grid-column: span 4; } .campo.s5 { grid-column: span 5; }
.campo.s6 { grid-column: span 6; } .campo.s8 { grid-column: span 8; } .campo.s9 { grid-column: span 9; } .campo.s12 { grid-column: span 12; }
.campo > label { font-size: .76rem; color: #50565c; font-weight: 500; }
.campo > label .obb { color: var(--err); }
.campo input, .campo select, .campo textarea { height: 26px; padding: 0 .45rem; border: 1px solid #b9bec5; border-radius: 3px; background: #fff; width: 100%; min-width: 0; }
.campo textarea { height: auto; min-height: 60px; padding: .3rem .45rem; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid rgba(88,21,23,.25); border-color: var(--primary); background: #fffdf6; }
.campo input[readonly] { background: #f1f2f4; color: #555; }
.campo input.importo { text-align: right; font-variant-numeric: tabular-nums; }
.campo .aiuto { font-size: .72rem; color: var(--muted); }
.campo.check { flex-direction: row; align-items: center; gap: .4rem; padding-top: 1.1rem; }
.campo.check input { width: auto; height: auto; }
.campo.errore input, .campo.errore select { border-color: var(--err); background: #fff6f5; }
.con-bottone { display: flex; gap: 3px; }
.con-bottone > :first-child { flex: 1; min-width: 0; }
.con-bottone button { flex: none; height: 26px; padding: 0 .5rem; border: 1px solid #b9bec5; border-radius: 3px; background: #f4f5f7; cursor: pointer; }
@media (max-width: 900px) { .campo, .campo.s1, .campo.s2, .campo.s4, .campo.s5 { grid-column: span 6; } .campo.s6, .campo.s8, .campo.s9 { grid-column: span 12; } }
@media (max-width: 520px) { .campo, .campo.s1, .campo.s2 { grid-column: span 12; } .scheda-testa { grid-template-columns: auto 1fr; } .scheda-testa .valori { grid-column: span 2; text-align: left; } }

.riquadri { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.riquadro { border: 1px solid #d8cccc; border-left: 4px solid var(--primary); border-radius: 3px; padding: .4rem .7rem; background: #fff; }
.riquadro .et { font-size: .72rem; text-transform: uppercase; color: var(--muted); font-family: var(--font-cond); letter-spacing: .4px; }
.riquadro .val { font-size: 1.2rem; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.barra-avanz { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-top: .3rem; }
.barra-avanz > span { display: block; height: 100%; background: var(--primary); }

.avviso { padding: .5rem .75rem; border-radius: 3px; margin-bottom: .7rem; border: 1px solid #f2d3a6; background: #fff8ec; color: #7a4a00; }
.avviso.info { border-color: #c9d6e8; background: #f1f6fc; color: #284b73; }
.avviso.err { border-color: #f1c0bd; background: #fdf0ef; color: var(--err); }

/* ---------- foto ---------- */
.galleria { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.foto-card { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.foto-card.principale { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(88,21,23,.25); }
.foto-card img { width: 100%; height: 150px; object-fit: cover; display: block; cursor: zoom-in; background: #f1f2f4; }
.foto-card .info { padding: .35rem .5rem; font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; gap: .4rem; }
.foto-card .azioni { display: flex; gap: 2px; padding: 0 .35rem .4rem; }
.foto-card .azioni button { flex: 1; height: 24px; border: 1px solid #c9ccd1; background: #f7f8f9; border-radius: 3px; cursor: pointer; font-size: .78rem; }
.foto-card .azioni button:hover { background: #fff; border-color: var(--primary); color: var(--primary); }
.foto-card input.didascalia { border: 0; border-top: 1px solid var(--line-soft); padding: .3rem .5rem; font-size: .8rem; }
.zona-drop { border: 2px dashed #c9b3b3; border-radius: 6px; padding: 1.2rem; text-align: center; color: var(--muted); margin-bottom: .8rem; background: #fdfafa; }
.zona-drop.sopra { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.zona-drop .bottoni { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: .6rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 32px; padding: 0 1rem; border-radius: 4px; border: 1px solid #b9bec5; background: #fff; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primario { background: var(--primary); border-color: var(--primary-dark); color: #fff; }
.btn.primario:hover { background: #6d1b1e; color: #fff; }
.btn.grande { height: 44px; font-size: 1rem; padding: 0 1.4rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-icon { border: 0; background: none; cursor: pointer; font-size: 1rem; padding: .2rem .4rem; border-radius: 3px; color: inherit; }
.btn-icon:hover { background: rgba(255,255,255,.18); }

.camera video, .camera canvas { width: 100%; max-height: 60vh; background: #000; border-radius: 4px; display: block; }
.camera .comandi-cam { display: flex; gap: .6rem; justify-content: center; margin-top: .7rem; flex-wrap: wrap; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 200; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 90vh; box-shadow: 0 0 30px rgba(0,0,0,.6); }

/* ---------- scrivania ---------- */
.scrivania { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.tessera { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1rem 1.1rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .4rem;
  border-top: 4px solid var(--primary); transition: box-shadow .15s, transform .15s; }
a.tessera:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tessera.spenta { border-top-color: #c3c7cc; opacity: .7; }
.tessera h2 { margin: 0; font-family: var(--font-cond); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .6px; color: var(--primary); display: flex; gap: .5rem; align-items: center; }
.tessera.spenta h2 { color: #6b7178; }
.tessera p { margin: 0; color: var(--muted); }
.tessera .cifre { display: flex; gap: 1.2rem; margin-top: .4rem; flex-wrap: wrap; }
.tessera .cifre div { display: flex; flex-direction: column; }
.tessera .cifre b { font-size: 1.3rem; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.tessera .cifre span { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.sezione-titolo { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 1px; font-size: 1.05rem; color: #333; margin: 1.4rem 0 .6rem; padding-top: .9rem;
  border-top: 1px solid var(--accent); position: relative; }
.sezione-titolo::before { content: ''; position: absolute; left: 0; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sezione-titolo:first-child { margin-top: 0; }

/* ---------- modal, toast, conferma ---------- */
.modal-back { position: fixed; inset: 0 0 var(--barra-stato) 0; background: rgba(30, 20, 20, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 1rem; overflow: auto; }
.modal { background: #fff; border-radius: 5px; box-shadow: 0 10px 40px rgba(0,0,0,.3); width: 100%; max-width: 560px; display: flex; flex-direction: column; max-height: 86vh; }
.modal.larga { max-width: 900px; }
.modal-head { display: flex; align-items: center; gap: .6rem; padding: .5rem .5rem .5rem .9rem; background: linear-gradient(#6a1d20, var(--primary)); color: #fff; border-radius: 5px 5px 0 0; }
.modal-head h3 { margin: 0; flex: 1; font-family: var(--font-cond); font-weight: 600; font-size: 1.1rem; letter-spacing: .4px; }
.modal-body { padding: 1rem; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .6rem 1rem; border-top: 1px solid var(--line-soft); background: #fafafa; border-radius: 0 0 5px 5px; }
.toast-box { position: fixed; right: 16px; bottom: calc(var(--barra-stato) + 14px); z-index: 300; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, 90vw); }
.toast { padding: .6rem .9rem; border-radius: 4px; background: #333; color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: all .25s; border-left: 4px solid #999; }
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-left-color: #66bb6a; }
.toast-error { border-left-color: #ef5350; background: #4a1b1b; }
.toast-info { border-left-color: #c9a0a0; }
.caricamento { padding: 2rem; text-align: center; color: var(--muted); }
kbd { font: 600 .72rem var(--font); border: 1px solid #c3c7cc; border-bottom-width: 2px; border-radius: 3px; padding: 0 .3rem; background: #fafafa; color: #555; }
.scorciatoie td { padding: .2rem .6rem; }
.import-esito pre { background: #f6f7f8; padding: .6rem; border: 1px solid var(--line-soft); max-height: 260px; overflow: auto; font-size: .78rem; }

/* ---------- barra di stato (piè di pagina) e calcolatrice: public/js/barra-stato.js ---------- */
.barra-stato { display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: 0 .8rem; background: var(--primary-dark); color: #f3e7e7; font-size: .8rem; white-space: nowrap; overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.15); }
.barra-stato .bs-sinistra, .barra-stato .bs-destra { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.barra-stato .bs-firma { font-weight: 600; letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; }
.barra-stato .bs-versione { opacity: .85; font-variant-numeric: tabular-nums; }
.barra-stato .bs-db { opacity: .85; }
.barra-stato .bs-db.ko { color: #ffb4ab; opacity: 1; font-weight: 700; }
.barra-stato .bs-sep { opacity: .45; }
.barra-stato .bs-zoom { display: inline-flex; align-items: center; gap: 2px; }
.barra-stato .bs-risoluzione { opacity: .75; margin-right: .3rem; font-variant-numeric: tabular-nums; cursor: help; }
.barra-stato .bs-btn { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 4px;
  height: 22px; min-width: 24px; padding: 0 .4rem; font: inherit; line-height: 1; cursor: pointer; }
.barra-stato .bs-btn:hover:not(:disabled) { background: rgba(255,255,255,.22); }
.barra-stato .bs-btn:disabled { opacity: .4; cursor: default; }
.barra-stato .bs-zoom-val { min-width: 48px; font-variant-numeric: tabular-nums; }
.barra-stato .bs-auto.attivo { background: #fff; color: var(--primary-dark); font-weight: 700; }
.barra-stato .bs-calc { font-size: .95rem; padding: 0 .3rem; }
.barra-stato .bs-quando { font-variant-numeric: tabular-nums; }
.barra-stato .bs-data-breve { display: none; }
@media (max-width: 1100px) { .barra-stato .bs-data { display: none; } .barra-stato .bs-data-breve { display: inline; } }
@media (max-width: 900px) { .barra-stato .bs-risoluzione, .barra-stato .bs-db { display: none; } }
@media (max-width: 640px) {
  .barra-stato { font-size: .72rem; gap: .4rem; padding: 0 .4rem; }
  .barra-stato .bs-firma { max-width: 7.5rem; }
  .barra-stato .bs-destra > .bs-sep, .barra-stato .bs-quando .bs-data-breve, .barra-stato .bs-quando .bs-sep, .barra-stato .bs-auto { display: none; }
}
.calc { position: fixed; right: 12px; bottom: calc(var(--barra-stato) + 8px); z-index: 60; width: 248px; padding: .6rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.calc-testa { display: flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .35rem; }
.calc-testa span { flex: 1; }
.calc-testa button { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: .95rem; padding: .1rem .3rem; border-radius: 4px; }
.calc-testa button:hover { background: #eef2f7; color: var(--text); }
.calc-traccia { min-height: 1.1rem; text-align: right; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.calc-schermo { text-align: right; font-size: 1.6rem; font-weight: 600; padding: .2rem .4rem .4rem; font-variant-numeric: tabular-nums;
  overflow-x: auto; white-space: nowrap; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.calc-tasti { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.calc-tasto { height: 40px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 1.05rem; cursor: pointer; color: var(--text); }
.calc-tasto:hover { background: #f5eded; }
.calc-funz { background: #f3f4f6; }
.calc-op { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.calc-uguale { background: var(--primary); color: #fff; border-color: var(--primary-dark); font-weight: 700; }
.calc-uguale:hover { background: #6d1b1e; }

/* ---------- stampa ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 10px; }
  .app { display: block; height: auto; }
  .testata { height: auto; border: 0; padding: 0 0 4mm; }
  .testata-logo img { height: 40px; }
  .menu, .menu-toggle, .barra-stato, .calc, .comandi, .filtri, .tabs, .no-print, .toast-box, .pager { display: none !important; }
  .fascia { background: none; border-bottom: 1px solid #999; padding: 0 0 2mm; height: auto; }
  .area { overflow: visible; padding: 0; }
  .finestra { border: 0; box-shadow: none; }
  .finestra-titolo { background: none; color: #000; border-bottom: 1px solid #000; padding: 1mm 0; }
  .griglia-wrap { overflow: visible; max-height: none !important; border: 0; }
  .griglia th { position: static; background: #eee !important; }
  .griglia tfoot td { position: static; }
  .griglia tbody tr.sel td { background: none; }
  .stampa-tutto .pannello.hidden { display: block !important; }
  .stampa-tutto .pannello { break-inside: avoid-page; padding: 2mm 0; }
  .zona-drop, .foto-card .azioni, .foto-card input.didascalia:placeholder-shown, .con-bottone button { display: none !important; }
  .campo input, .campo select, .campo textarea { border: 0; border-bottom: 1px solid #bbb; border-radius: 0; background: none; }
}

/* icone SVG (public/js/icone.js) */
.ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; vertical-align: -0.15em; }
.cmd .ico { display: inline-flex; }
.tessera h2 .ic, .btn .ic { flex: none; }
.menu-voce > a, .menu-voce > button { white-space: nowrap; }
.barra-stato .bs-calc { display: inline-flex; align-items: center; }
.calc-testa span { display: inline-flex; align-items: center; gap: .3rem; }

/* nella finestra solo la griglia si allunga/accorcia; il resto mantiene la sua altezza */
.finestra > * { flex-shrink: 0; }
.finestra > .griglia-wrap { flex: 1 1 auto; min-height: 180px; border-left: 0; border-right: 0; }
.finestra .finestra > .griglia-wrap { max-height: 420px; }

/* =====================================================================================
   Accesso, utenti, modalità dispositivo (v1.1)
   ===================================================================================== */
.login-back { position: fixed; inset: 0 0 var(--barra-stato) 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 1rem; overflow: auto;
  background: linear-gradient(160deg, #f4ebeb 0%, #e6e7e9 55%, #d3d4d6 100%); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 8px; border-top: 5px solid var(--primary); box-shadow: 0 12px 40px rgba(60,20,20,.18);
  padding: 1.6rem 1.6rem 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.login-logo { width: 220px; max-width: 80%; align-self: center; }
.login-titolo { text-align: center; font-family: var(--font-cond); font-size: 1.3rem; font-weight: 700; color: var(--primary); letter-spacing: .4px; margin-bottom: .3rem; }
.login-card label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: #50565c; font-weight: 500; }
.login-card input { height: 40px; padding: 0 .7rem; border: 1px solid #b9bec5; border-radius: 4px; font-size: 1rem; width: 100%; }
.login-card input:focus { outline: 2px solid rgba(88,21,23,.25); border-color: var(--primary); }
.con-occhio { position: relative; }
.con-occhio .occhio { position: absolute; right: 4px; top: 4px; height: 32px; width: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.login-errore { min-height: 1.2em; color: var(--err); font-weight: 500; font-size: .9rem; }
.login-modo { margin-top: .6rem; padding-top: .8rem; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: .4rem; align-items: center; font-size: .8rem; color: var(--muted); }

.selettore-modo { display: inline-flex; gap: 2px; }
.selettore-modo button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1);
  color: inherit; border-radius: 4px; height: 22px; min-width: 26px; padding: 0 .3rem; cursor: pointer; }
.selettore-modo button.attivo { background: #fff; color: var(--primary-dark); }
.selettore-modo.grande button { height: 54px; min-width: 76px; flex-direction: column; gap: 2px; font-size: .72rem; border-color: var(--line); background: #f6f7f8; color: #444; }
.selettore-modo.grande button.attivo { background: var(--primary); color: #fff; border-color: var(--primary-dark); }
.sottomenu .selettore-modo button { border-color: var(--line); background: #f3f4f6; color: #444; height: 28px; min-width: 34px; }
.sottomenu .selettore-modo button.attivo { background: var(--primary); color: #fff; }
.menu-utente .nome-utente { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; }
.menu-utente > button { gap: .35rem; }
.sottomenu-testa { padding: .5rem .9rem .4rem; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; }
.sottomenu-testa span { font-size: .8rem; color: var(--muted); }
.sottomenu-modo { padding: .5rem .9rem; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--muted); }
.sottomenu a > span { display: inline-flex; align-items: center; gap: .3rem; }
.sola-lettura { padding: 0 .7rem; color: var(--muted); font-style: italic; }
.legenda-ruoli { display: flex; flex-direction: column; gap: .15rem; font-size: .8rem; color: #50565c; }
.benvenuto { margin: 0 0 .4rem; font-family: var(--font-cond); font-size: 1.05rem; color: var(--primary); }
.azioni-rapide { display: flex; gap: .6rem; flex-wrap: wrap; }

/* inserimento veloce */
.veloce .comuni { background: #fbf8f8; border-color: #dfcfcf; }
.veloce .bene { border-color: var(--primary); border-width: 2px; }
.veloce .gruppo-campi legend { display: inline-flex; align-items: center; gap: .3rem; }
.veloce-esito { color: var(--ok); font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; padding-right: .5rem; }

/* =====================================================================================
   Inventario mobile
   ===================================================================================== */
.inv { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: .7rem; padding-bottom: 5rem; font-size: 15px; }
.inv-testa { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: 6px; padding: .8rem 1rem; display: grid; grid-template-columns: 1fr auto; gap: .4rem .8rem; align-items: center; }
.inv-testa .inv-avanz { grid-column: 1 / -1; }
.inv-titolo { font-family: var(--font-cond); font-size: 1.35rem; font-weight: 700; color: var(--primary); }
.inv-campagna { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.inv-campagna input { height: 30px; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; }
.inv-totale { display: flex; flex-direction: column; align-items: flex-end; }
.inv-totale b { font-size: 1.4rem; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.inv-totale span { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.inv-avanz { height: 8px; background: #ece6e6; border-radius: 4px; overflow: hidden; }
.inv-avanz > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #8f3a3d); transition: width .3s; }
.inv-cerca { display: flex; gap: .4rem; }
.inv-cerca input { flex: 1; min-width: 0; height: 48px; font-size: 1.05rem; padding: 0 .8rem; border: 1px solid #b9bec5; border-radius: 6px; }
.inv-cerca .btn { height: 48px; min-width: 52px; padding: 0 .8rem; }
.inv-sezione { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .8px; color: #555; margin-top: .4rem; }
.inv-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.inv-chips button { height: 36px; padding: 0 .9rem; border-radius: 18px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; }
.inv-chips button.attivo { background: var(--primary); color: #fff; border-color: var(--primary-dark); }
.inv > input[type=search] { height: 42px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 6px; font-size: 1rem; }
.inv-lista { display: flex; flex-direction: column; gap: .45rem; }
.inv-locale { display: grid; grid-template-columns: 1fr auto; gap: .35rem .6rem; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 5px solid #c9b3b3;
  border-radius: 6px; padding: .7rem .8rem; text-decoration: none; color: var(--text); min-height: 64px; }
.inv-locale:active { background: var(--hover); }
.inv-locale.ok { border-left-color: var(--ok); }
.inv-locale .inv-avanz { grid-column: 1 / -1; height: 5px; }
.inv-locale-testo { display: flex; flex-direction: column; min-width: 0; }
.inv-locale-testo b { font-size: 1rem; }
.inv-locale-testo span { font-size: .82rem; color: var(--muted); }
.inv-locale-stato { min-width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.inv-locale.ok .inv-locale-stato { background: #e6f2e7; color: var(--ok); }
.inv-bene { display: flex; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; transition: background .3s; }
.inv-bene.ok { background: #f3f9f3; border-color: #c4dfc6; }
.inv-bene.appena { animation: lampo .45s; }
@keyframes lampo { from { background: #c8e6c9; } to { background: #f3f9f3; } }
.inv-bene-corpo { flex: 1; display: flex; gap: .7rem; padding: .55rem; text-decoration: none; color: var(--text); min-width: 0; }
.inv-bene-foto { width: 64px; height: 64px; flex: none; border-radius: 4px; overflow: hidden; background: #f1f2f4; display: flex; align-items: center; justify-content: center; }
.inv-bene-foto img { width: 100%; height: 100%; object-fit: cover; }
.inv-nofoto { color: #b5bac0; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.inv-bene-testo { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inv-bene-testo b { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-bene-testo span { font-size: .82rem; color: #50565c; }
.inv-bene-testo .inv-sotto { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-bene-testo .badge { align-self: flex-start; margin-top: 2px; }
.inv-spunta { flex: none; width: 64px; border: 0; border-left: 1px solid var(--line); background: #fafafa; color: #b5bac0; cursor: pointer; }
.inv-spunta:active { background: #e6f2e7; }
.inv-bene.ok .inv-spunta { color: var(--ok); background: #e6f2e7; }
.inv-indietro { display: inline-flex; align-items: center; gap: .35rem; color: var(--primary); text-decoration: none; font-weight: 500; padding: .3rem 0; align-self: flex-start; }
.inv-fab { position: fixed; right: 16px; bottom: calc(var(--barra-stato) + 16px); z-index: 50; display: inline-flex; align-items: center; gap: .4rem; height: 52px; padding: 0 1.2rem;
  border-radius: 26px; background: var(--primary); color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 6px 18px rgba(88,21,23,.35); }
.inv-foto-grande { position: relative; background: #f1f2f4; border-radius: 6px; overflow: hidden; min-height: 180px; display: flex; align-items: center; justify-content: center; }
.inv-foto-grande img { width: 100%; max-height: 46vh; object-fit: contain; display: block; background: #222; cursor: zoom-in; }
.inv-nofoto.grande { padding: 2.5rem 1rem; }
.inv-nfoto { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; padding: .1rem .5rem; border-radius: 10px; font-size: .78rem; }
.inv-bottoni { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.inv-bottoni .btn { height: 50px; font-size: 1rem; }
.inv-scheda { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem; }
.inv-num { font-family: var(--font-cond); color: var(--primary); font-weight: 700; font-size: 1.1rem; letter-spacing: .5px; }
.inv-num span { color: var(--muted); font-weight: 400; }
.inv-scheda h2 { margin: .1rem 0 .5rem; font-size: 1.2rem; }
.inv-scheda dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0 0 .6rem; font-size: .9rem; }
.inv-scheda dt { color: var(--muted); }
.inv-scheda dd { margin: 0; overflow-wrap: anywhere; }
.inv-ultima { display: flex; align-items: center; gap: .3rem; color: var(--warn); font-size: .88rem; font-weight: 500; }
.inv-ultima.ok { color: var(--ok); }
.inv-form { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .45rem; }
.inv-form label { font-size: .8rem; color: #50565c; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: .3rem; }
.inv-form input, .inv-form select { height: 46px; padding: 0 .7rem; border: 1px solid #b9bec5; border-radius: 6px; font-size: 1rem; background: #fff; width: 100%; min-width: 0; }
.inv-form .avviso { margin: 0; font-size: .88rem; }
.inv-due { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.inv-due > div { display: flex; flex-direction: column; gap: .3rem; }
.inv-cond { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.inv-cond button { height: 58px; border-radius: 6px; border: 2px solid var(--line); background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.inv-cond button b { font-size: 1.2rem; }
.inv-cond button span { font-size: .75rem; }
.inv-cond .cN.attivo { border-color: var(--ok); background: #e6f2e7; color: var(--ok); }
.inv-cond .cD.attivo { border-color: var(--warn); background: #fff3e0; color: var(--warn); }
.inv-cond .cX.attivo { border-color: var(--err); background: #fde8e7; color: var(--err); }
.inv-verifica { height: 58px; font-size: 1.15rem; margin-top: .6rem; }
.inv-storico { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .6rem 1rem; font-size: .85rem; }
.inv-storico summary { cursor: pointer; font-weight: 600; color: #50565c; }
.inv-storico ul { margin: .4rem 0 0; padding-left: 1.1rem; color: #50565c; }
.inv-link { text-align: center; color: var(--muted); padding: .4rem; }

/* =====================================================================================
   Modalità: tablet (tocco: comandi e campi più grandi) e smartphone (una colonna, menu compatto)
   ===================================================================================== */
[data-modo=tablet] body { font-size: 14px; }
[data-modo=tablet] .cmd { height: 38px; padding: 0 .75rem; font-size: .92rem; }
[data-modo=tablet] .cmd .tasto { display: none; }
[data-modo=tablet] .campo input, [data-modo=tablet] .campo select { height: 38px; font-size: .95rem; }
[data-modo=tablet] .griglia { font-size: 13.5px; }
[data-modo=tablet] .griglia td { height: 38px; }
[data-modo=tablet] .tab { padding: .6rem 1.1rem; }
[data-modo=tablet] .filtri select, [data-modo=tablet] .filtri input[type=number] { height: 34px; }
[data-modo=tablet] .filtri label { padding: .2rem 0; }
[data-modo=tablet] .comandi .cerca input { height: 36px; }
[data-modo=tablet] .menu-voce > a, [data-modo=tablet] .menu-voce > button { padding: 0 .7rem; }
[data-modo=tablet] .sottomenu a { padding: .75rem 1rem; }
[data-modo=tablet] .testata-sotto { display: none; }

[data-modo=smartphone] body { font-size: 14px; background: #e9eaec; }
[data-modo=smartphone] .app { --testata: 60px; --fascia-h: 40px; max-width: 520px; margin: 0 auto; background: var(--bg); box-shadow: 0 0 24px rgba(0,0,0,.12); }
[data-modo=smartphone] .testata { padding: 0 .7rem; gap: .6rem; }
[data-modo=smartphone] .testata-logo img { height: 44px; }
[data-modo=smartphone] .testata-app { display: none; }
[data-modo=smartphone] .menu-toggle { display: block; font-size: 1.7rem; }
[data-modo=smartphone] .menu { display: none; position: absolute; top: 100%; right: 0; left: 0; flex-direction: column; height: auto; background: #fff; border-bottom: 3px solid var(--primary); box-shadow: var(--shadow); }
[data-modo=smartphone] .menu.aperto { display: flex; }
[data-modo=smartphone] .menu-voce { flex-direction: column; align-items: stretch; }
[data-modo=smartphone] .menu-voce > a, [data-modo=smartphone] .menu-voce > button { padding: .8rem 1rem; }
[data-modo=smartphone] .menu-voce.attiva > a::after, [data-modo=smartphone] .menu-voce.attiva > button::after { display: none; }
[data-modo=smartphone] .sottomenu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 .4rem 1rem; }
[data-modo=smartphone] .sottomenu a { padding: .7rem .9rem; }
[data-modo=smartphone] .fascia { padding: 0 .8rem; }
[data-modo=smartphone] .fascia h1 { font-size: 1rem; }
[data-modo=smartphone] .briciole { display: none; }
[data-modo=smartphone] .area { padding: .6rem; }
[data-modo=smartphone] .cmd { height: 40px; min-width: 40px; justify-content: center; }
[data-modo=smartphone] .cmd .etichetta, [data-modo=smartphone] .cmd .tasto { display: none; }
[data-modo=smartphone] .cmd.primario .etichetta { display: inline; }
[data-modo=smartphone] .comandi .cerca { flex: 1 1 100%; }
[data-modo=smartphone] .comandi .cerca input { width: 100%; height: 38px; }
[data-modo=smartphone] .campo, [data-modo=smartphone] .campo.s1, [data-modo=smartphone] .campo.s2, [data-modo=smartphone] .campo.s3, [data-modo=smartphone] .campo.s4,
[data-modo=smartphone] .campo.s5, [data-modo=smartphone] .campo.s6, [data-modo=smartphone] .campo.s8, [data-modo=smartphone] .campo.s9 { grid-column: span 12; }
[data-modo=smartphone] .campo input, [data-modo=smartphone] .campo select { height: 42px; font-size: 1rem; }
[data-modo=smartphone] .griglia td { height: 40px; }
[data-modo=smartphone] .scheda-testa { grid-template-columns: auto 1fr; }
[data-modo=smartphone] .scheda-testa .valori { grid-column: span 2; text-align: left; }
[data-modo=smartphone] .totale { min-width: calc(50% - .3rem); flex: 1; }
[data-modo=smartphone] .barra-stato .bs-risoluzione, [data-modo=smartphone] .barra-stato .bs-db, [data-modo=smartphone] .barra-stato .bs-data,
[data-modo=smartphone] .barra-stato .bs-auto, [data-modo=smartphone] .barra-stato .bs-zoom { display: none; }
[data-modo=smartphone] .barra-stato .bs-data-breve { display: none; }
[data-modo=smartphone] .barra-stato .bs-firma { max-width: 8rem; }
[data-modo=smartphone] .inv-fab { right: max(16px, calc(50vw - 260px + 16px)); }
[data-modo=smartphone] .modal { max-width: 500px; }
@media (max-width: 520px) { [data-modo=smartphone] .app { box-shadow: none; } }

/* conferma scrivendo CANCELLA / DUPLICA */
.conferma-parola label { display: block; font-size: .9rem; margin-bottom: .35rem; }
.parola-conferma { width: 100%; height: 42px; padding: 0 .7rem; font-size: 1.15rem; font-weight: 700; letter-spacing: 2px; border: 2px solid #c9ccd1; border-radius: 4px; text-transform: none; }
.parola-conferma:focus { outline: none; border-color: var(--primary); }
.parola-conferma.giusta { border-color: var(--ok); background: #f3f9f3; }
.btn.primario.pericolo { background: var(--err); border-color: #8c1d17; }
.btn.primario.pericolo:hover { background: #c62828; }
.btn:disabled, .btn.primario:disabled { opacity: .45; cursor: not-allowed; }
