/* CLEAN ARCHIVE - sito licenze */
:root { --bg:#161616; --card:#212121; --campo:#2a2a2a; --bd:#353535; --tx:#e9e9e9; --sec:#9e9e9e; --acc:#c8102e; --acc2:#e0223f; --ok:#2ea55a; --att:#f5b400; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 15px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: #ff6b80; }
a:hover { color: #ff97a6; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; }
h2 { font-size: 18px; margin: 28px 0 12px; }
.contenitore { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.lead { font-size: 17px; color: #d0d0d0; }
.sec { color: var(--sec); }
.piccolo { font-size: 13px; }
.obbl { color: var(--acc2); }
.nascosto { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* testata e piede */
.testa { border-bottom: 1px solid var(--bd); padding: 14px 0; }
.testa .contenitore { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marchio { display: flex; align-items: center; gap: 10px; color: var(--tx); text-decoration: none; font-weight: 600; font-size: 18px; }
.logo { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--acc); color: var(--acc2); align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.torna { color: var(--sec); text-decoration: none; }
.piede { border-top: 1px solid var(--bd); color: var(--sec); font-size: 13px; padding: 18px 0; margin-top: 40px; }

/* riquadri e moduli */
.intro { padding: 34px 0 10px; }
.riquadro { background: var(--card); border: 1px solid var(--bd); border-radius: 8px; padding: 26px; margin: 18px 0; }
.centrato { text-align: center; padding: 50px 26px; }
.griglia { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo.largo { width: 100%; }
.campo > span { font-size: 13px; color: #cfcfcf; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; background: var(--campo); color: var(--tx); border: 1px solid var(--bd); border-radius: 5px; padding: 10px 12px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc2); box-shadow: 0 0 0 3px rgba(200,16,46,.25); }
input:disabled { opacity: .4; }
textarea { resize: vertical; }
.ha-errore input, .ha-errore textarea { border-color: var(--acc2); }
.err { color: #ff7a8a; font-size: 13px; }
.errore { background: rgba(200,16,46,.15); border: 1px solid rgba(200,16,46,.5); color: #ffb3bd; border-radius: 6px; padding: 12px 14px; }
.avviso { background: rgba(245,180,0,.12); border: 1px solid rgba(245,180,0,.45); border-radius: 6px; padding: 12px 14px; }
.successo { background: rgba(46,165,90,.14); border: 1px solid rgba(46,165,90,.5); border-radius: 6px; padding: 12px 14px; }
.tipi { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tipi legend { margin-bottom: 10px; font-weight: 600; }
.tipo { position: relative; }
.tipo input { position: absolute; opacity: 0; }
.tipo span { display: inline-block; padding: 10px 18px; border: 1px solid var(--bd); border-radius: 5px; background: var(--campo); cursor: pointer; }
.tipo input:checked + span { border-color: var(--acc); background: rgba(200,16,46,.18); }
.tipo input:focus-visible + span { box-shadow: 0 0 0 3px rgba(200,16,46,.35); }
.consensi { margin: 24px 0 18px; display: flex; flex-direction: column; gap: 12px; }
.spunta { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.spunta input { margin-top: 4px; accent-color: var(--acc); width: 17px; height: 17px; flex: none; }
.tipo-privato .solo-impresa, .tipo-impresa .solo-privato { display: none; }

/* pulsanti */
button, .pulsante { display: inline-block; font: inherit; border-radius: 5px; padding: 9px 18px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--bd); background: #2c2c2c; color: var(--tx); }
button:hover, .pulsante:hover { background: #363636; color: var(--tx); }
.primario { background: var(--acc); border-color: var(--acc); color: #fff; }
.primario:hover { background: var(--acc2); color: #fff; }
.grande { padding: 13px 28px; font-size: 16px; }
.pericolo { border-color: rgba(200,16,46,.6); color: #ff8a99; background: transparent; }
.piccolo-btn { padding: 5px 11px; font-size: 13px; }

/* amministrazione */
body.admin main { max-width: 1280px; margin: 0 auto; padding: 20px; }
main.stretto { max-width: 720px; margin: 0 auto; padding: 30px 20px; }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--bd); padding: 12px 20px; }
.barra nav { display: flex; gap: 6px; flex-wrap: wrap; }
.barra nav a { color: var(--tx); text-decoration: none; padding: 6px 12px; border-radius: 4px; }
.barra nav a.attivo, .barra nav a:hover { background: #2c2c2c; }
.contatori { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.contatore { background: var(--card); border: 1px solid var(--bd); border-left: 4px solid #555; border-radius: 6px; padding: 10px 14px; text-decoration: none; color: var(--tx); }
.contatore b { display: block; font-size: 24px; }
.contatore.nuova { border-left-color: var(--acc); }
.contatore.licenza_inviata { border-left-color: var(--ok); }
.contatore.in_attesa { border-left-color: var(--att); }
.contatore.scadenza { border-left-color: #4a86c5; }
.filtri { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.filtri input[type=search] { max-width: 320px; }
.filtri select { max-width: 220px; }
.tabella-wrap { overflow-x: auto; }
table.dati { width: 100%; border-collapse: collapse; font-size: 14px; }
table.dati th { text-align: left; color: var(--sec); font-weight: 600; border-bottom: 1px solid var(--bd); padding: 8px; white-space: nowrap; }
table.dati td { border-bottom: 1px solid #2a2a2a; padding: 8px; vertical-align: top; }
table.dati tr:hover td { background: #1d1d1d; }
.etichetta { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; background: #333; white-space: nowrap; }
.etichetta.nuova { background: var(--acc); color: #fff; }
.etichetta.licenza_inviata { background: rgba(46,165,90,.25); color: #8fe0ab; }
.etichetta.in_attesa { background: rgba(245,180,0,.2); color: #ffd666; }
.etichetta.rifiutata, .etichetta.archiviata { background: #2c2c2c; color: var(--sec); }
.etichetta.scaduta { background: rgba(200,16,46,.2); color: #ff9aa7; }
.colonne { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
dl.scheda { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; margin: 0; }
dl.scheda dt { color: var(--sec); }
dl.scheda dd { margin: 0; word-break: break-word; }
.codice { font-family: Consolas, "Courier New", monospace; font-size: 13px; background: #111; border: 1px solid var(--bd); border-radius: 5px; padding: 10px 12px; word-break: break-all; user-select: all; }
.chiave { font-family: Consolas, "Courier New", monospace; font-size: 16px; background: #111; border: 1px solid var(--acc); border-radius: 6px; padding: 14px; word-break: break-all; user-select: all; }
.azioni { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.modulo label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.in-linea { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.in-linea label { margin: 0; }
table.controlli td { padding: 5px 8px; }
.ok { color: #8fe0ab; font-weight: 700; }
.no { color: #ff8a99; font-weight: 700; }
pre.email { white-space: pre-wrap; background: #111; border: 1px solid var(--bd); border-radius: 5px; padding: 10px; font-size: 13px; max-height: 260px; overflow: auto; }
details summary { cursor: pointer; color: var(--sec); }

@media (max-width: 760px) {
  .griglia, .colonne { grid-template-columns: 1fr; }
  dl.scheda { grid-template-columns: 1fr; }
  dl.scheda dt { margin-top: 6px; }
  h1 { font-size: 24px; }
  .riquadro { padding: 18px; }
}
