/* Pagina dei contratti con lo stile del Foglio (Foglio/odg/public/style.css): Archivo, palette, barra scura, sotto-schede, pannello.
   Archivo variabile, SIL Open Font License: file in fonts/, dentro il sito (niente Google Fonts). */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400 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+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: 'Archivo'; font-style: normal; font-weight: 400 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; }

:root {
  --paper: #f3f2f2;
  --surface: #eae9e9;
  --ink: #201e1d;
  --accent: #e73925;
  --divider: color-mix(in srgb, #201e1d 40%, transparent);
  --n500: #9b9797;
  --n700: #605d5d;
  --desk: #e7e5e4;
  --font: 'Archivo', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--desk); color: var(--ink); font: 13px/1.45 var(--font); }
button, select, input { font: inherit; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Barra in alto, come il Foglio ── */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 0 20px; min-height: 52px;
  background: var(--ink); color: #eae7e7; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.bar .grp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar .grp:last-child { margin-left: auto; }
.bar .brand { font-weight: 800; font-size: 12px; letter-spacing: .2em; }
.bar .vr { width: 1px; height: 18px; background: #4a4747; margin: 0 8px; }
.bar .status { font-size: 11px; color: var(--n500); white-space: nowrap; }
.ptitle { font-weight: 700; font-size: 14px; letter-spacing: -.01em; text-transform: uppercase; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psel { background: none; border: 1px solid #4a4747; border-radius: 999px; color: #fff; padding: 4px 10px; font-weight: 700; text-transform: uppercase; }
.psel option { color: var(--ink); }
.btn { border: 1px solid #4a4747; border-radius: 999px; background: none; color: #d9d6d6; padding: 5px 14px; cursor: pointer; font-size: 12.5px; }
.btn:hover { background: #2d2b2b; color: #fff; border-color: #6a6666; }
.btn.acc { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.acc:hover { background: #f04a37; border-color: #f04a37; }

/* ── Sotto-schede dei gruppi, come Scene / Elementi / Cast nello Spoglio ── */
.subnav { position: sticky; top: 52px; z-index: 9; background: var(--desk); border-bottom: 1px solid var(--divider); }
.subnav .in { max-width: 1480px; margin: 0 auto; padding: 0 44px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.subnav .in::-webkit-scrollbar { display: none; }
.stab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 14px 10px; border: 0; border-bottom: 2px solid transparent; background: none;
  font: 500 13px var(--font); color: var(--n700); cursor: pointer; white-space: nowrap; }
.stab:hover { color: var(--ink); background: rgba(32,30,29,.04); }
.stab.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.nb { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; font: 700 10px/1 var(--font); }
.nb.cnt { color: var(--n700); background: rgba(32,30,29,.07); font-weight: 600; }
.nb.miss { background: var(--accent); color: #fff; }

/* ── Pannello di lavoro ── */
.sheet { margin: 20px auto; background: var(--paper); box-shadow: 0 2px 10px rgba(20,20,19,.12); }
.sheet.wide { width: calc(100vw - 48px); max-width: 1480px; padding: 22px 44px 28px; }
.panel h2 { font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.panel .help { color: var(--n700); font-size: 12px; margin: 6px 0 12px; max-width: 80ch; }
.testa { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; }
.tools .sp { flex: 1; }
.lbl { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--n700); }
.lbl.ink { color: var(--ink); font-size: 10px; }
.seg { display: inline-flex; gap: 4px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 4px 12px; background: rgba(32,30,29,.07); font: 500 11.5px var(--font); cursor: pointer; color: var(--ink); }
.fchip:hover { background: rgba(32,30,29,.12); }
.fchip.on { background: var(--ink); color: var(--paper); }
.mini { border: 0; border-radius: 999px; background: rgba(32,30,29,.07); color: var(--ink); padding: 4px 12px; cursor: pointer; font-size: 11.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: background .12s, color .12s; display: inline-block; }
.mini:hover { background: var(--ink); color: var(--paper); }
.mini.acc { background: var(--accent); color: #fff; font-weight: 600; }
.mini.acc:hover { background: var(--ink); }
.errore { color: var(--accent); font-weight: 600; }
.errore:empty { display: none; }

/* tabella dei documenti, come le tabelle dello Spoglio */
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.t th { text-align: left; padding: 6px 8px; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--n700); border-bottom: 1px solid var(--divider); }
.t td { padding: 9px 8px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.t th:first-child, .t td:first-child { padding-left: 0; }
.t th:last-child, .t td:last-child { padding-right: 0; }
.t .nome { font-weight: 700; font-size: 13px; }
.t .tipo { color: var(--n700); }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgba(32,30,29,.07); font-size: 11px; font-weight: 500; white-space: nowrap; }
.mancano { color: var(--accent); font-size: 11.5px; }
.ok { color: var(--n500); }
.drive { font-size: 11.5px; overflow-wrap: anywhere; }
.azioni { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.esito { margin: 6px 0 0; font-size: 11.5px; text-align: right; overflow-wrap: anywhere; }
.esito:empty { display: none; }

/* accesso, come la pagina di accesso del Foglio */
.sheet.login { width: 340px; max-width: calc(100vw - 32px); margin-top: 12vh; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--n700); }
.login input { font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); padding: 7px 8px; border: 1px solid var(--divider); background: #fff; }
.login input:focus { outline: 1px solid var(--ink); }
.login .btn { align-self: flex-start; padding: 7px 18px; }
.login h1 { margin: 0 0 4px; }

/* telefono: barra più stretta, pannello a tutta larghezza, ogni documento è un blocco */
@media (max-width: 760px) {
  .bar { gap: 10px; padding: 0 14px; }
  .bar .status { display: none; }
  .subnav .in { padding: 0 8px; }
  .sheet.wide { width: auto; margin: 12px 8px; padding: 16px; }
  .testa { flex-direction: column; align-items: stretch; gap: 10px; }
  .tools .sp { display: none; }
  #genera-gruppo { flex-basis: 100%; }
  #genera-gruppo .mini { width: 100%; padding: 8px 12px; }
  .t thead { display: none; }
  .t, .t tbody, .t tr, .t td { display: block; width: 100%; }
  .t tr { padding: 10px 0; border-bottom: 1px solid var(--divider); }
  .t td { border: 0; padding: 2px 0; }
  .t td:empty { display: none; }
  .azioni { justify-content: flex-start; margin-top: 6px; }
  .azioni .mini { flex: 1 1 auto; text-align: center; padding: 7px 12px; }
  .esito { text-align: left; }
}
