/* Debitori LuganoAuto: nero con azzurro, come il gestionale. Pulsanti grandi, leggibile anche sul telefono. */
:root {
    --fondo: #0a0a0a; --scheda: #171717; --bordo: #2e2e2e; --testo: #ededed; --sottile: #9a9a9a;
    --azzurro: #38bdf8; --azzurro-scuro: #0284c7; --rosso: #f87171; --arancio: #fbbf24; --verde: #4ade80; --giallo: #fde047;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--testo); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--azzurro); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; color: var(--azzurro); text-transform: uppercase; letter-spacing: .04em; }
h2:first-child { margin-top: 0; }
.testata { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; padding: .7rem 1rem; background: #000; border-bottom: 1px solid var(--bordo); position: sticky; top: 0; z-index: 5; }
.marchio { font-weight: 700; font-size: 1.2rem; color: #fff; text-decoration: none; }
.menu { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.menu a, .menu .link { color: var(--testo); text-decoration: none; padding: .3rem .5rem; border-radius: 6px; background: none; border: 0; font: inherit; cursor: pointer; }
.menu a.attivo, .menu a:hover, .menu .link:hover { background: #222; color: var(--azzurro); }
.contenuto { max-width: 1280px; margin: 0 auto; padding: 1rem; }
.pie { color: var(--sottile); font-size: .85rem; text-align: center; padding: 2rem 1rem; }
.scheda { background: var(--scheda); border: 1px solid var(--bordo); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.scheda.stretta { max-width: 560px; margin: 2rem auto; }
.colonne { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1rem; align-items: start; }
.colonne.tre { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
@media (max-width: 900px) { .colonne { grid-template-columns: 1fr; } }
.sottile { color: var(--sottile); font-size: .9rem; }
.rosso { color: var(--rosso); } .arancio { color: var(--arancio); } .verde { color: var(--verde); }
.inline { display: inline; }
.avvisi { margin-bottom: 1rem; }
.avviso { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .5rem; background: #1e293b; border: 1px solid #334155; }
.avviso.success { background: #0f2a1a; border-color: #166534; }
.avviso.error { background: #2a1010; border-color: #991b1b; }
.avviso.warning { background: #2a2210; border-color: #a16207; }
/* moduli */
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--sottile); }
.campo { width: 100%; padding: .55rem .7rem; border: 1px solid var(--bordo); border-radius: 8px; background: #0f0f0f; color: var(--testo); font: inherit; }
.campo:focus { outline: 2px solid var(--azzurro-scuro); }
.campo.corto { width: 7rem; }
textarea.campo { resize: vertical; line-height: 1.4; }
.griglia { display: grid; gap: .7rem; }
.griglia .pulsante { justify-self: start; }
.errore { color: var(--rosso); font-size: .85rem; }
/* pulsanti */
.pulsante { display: inline-block; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--azzurro-scuro); background: var(--azzurro-scuro); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.pulsante:hover { filter: brightness(1.15); }
.pulsante:disabled { opacity: .4; cursor: not-allowed; }
.pulsante.secondario { background: #222; border-color: #3a3a3a; color: var(--testo); }
.pulsante.verde { background: #15803d; border-color: #15803d; }
.pulsante.grande { padding: .8rem 1.4rem; font-size: 1.05rem; }
.pulsante.piccolo { padding: .3rem .6rem; font-size: .85rem; font-weight: 500; }
.pulsanti { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
summary.pulsante { list-style: none; }
summary::-webkit-details-marker { display: none; }
/* linguette e filtri */
.linguette { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.linguetta { padding: .5rem .9rem; border-radius: 999px; background: #1a1a1a; border: 1px solid var(--bordo); color: var(--testo); text-decoration: none; }
.linguetta.attiva { background: var(--azzurro-scuro); border-color: var(--azzurro-scuro); color: #fff; }
.linguetta .conta { color: inherit; opacity: .8; font-size: .85rem; margin-left: .3rem; }
.filtri { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.filtri .campo { width: auto; }
.filtri .cerca { flex: 1 1 220px; }
.riassunto { margin: .4rem 0 .8rem; }
/* tabelle */
.tabella { width: 100%; border-collapse: collapse; background: var(--scheda); border: 1px solid var(--bordo); border-radius: 12px; overflow: hidden; }
.tabella th, .tabella td { padding: .6rem .7rem; border-bottom: 1px solid var(--bordo); text-align: left; vertical-align: top; }
.tabella th { color: var(--sottile); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.tabella .num { text-align: right; white-space: nowrap; }
.tabella tr.antipatico td:first-child { border-left: 4px solid var(--rosso); }
.tabella tr.ritardatario td:first-child { border-left: 4px solid var(--arancio); }
.tabella tr.chiusa, .tabella tr.stato-chiuso { opacity: .55; }
.tabella tr.pagamento td { border-bottom: 0; padding-top: 0; }
.tabella.compatta th, .tabella.compatta td { padding: .45rem .5rem; font-size: .92rem; }
.tabella .vuoto { text-align: center; color: var(--sottile); padding: 2rem; }
.nome { font-weight: 600; text-decoration: none; }
.azioni { white-space: nowrap; }
.azioni details { position: relative; }
.riga-acconto { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.riga-acconto .campo { width: auto; }
.bollo { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; margin-left: .3rem; vertical-align: middle; background: #333; color: #fff; }
.bollo.rosso { background: #991b1b; } .bollo.arancio { background: #b45309; } .bollo.giallo { background: #a16207; } .bollo.grigio { background: #3f3f46; }
/* scheda del debitore */
.briciole { margin: 0 0 .4rem; }
.intestazione { margin-bottom: 1rem; }
.numeri { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: .5rem; }
.numeri .etichetta { display: block; color: var(--sottile); font-size: .8rem; text-transform: uppercase; }
.grande { font-size: 1.4rem; }
.livelli { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.livello { flex: 1 1 150px; flex-direction: row; align-items: center; gap: .5rem; padding: .6rem .8rem; border: 1px solid var(--bordo); border-radius: 8px; background: #0f0f0f; color: var(--testo); cursor: pointer; }
.livello.scelto { border-color: var(--azzurro); background: #0c1a24; }
.livello small { color: var(--azzurro); margin-left: auto; }
.testo-sollecito { font-size: 1rem; }
.storia { list-style: none; padding: 0; margin: 0; }
.storia li { padding: .6rem 0; border-bottom: 1px solid var(--bordo); }
.riga-esito { display: flex; gap: .4rem; margin-top: .4rem; }
.testo-mandato { white-space: pre-wrap; background: #0f0f0f; padding: .6rem; border-radius: 8px; font-size: .92rem; }
.aggiungi { margin-top: .6rem; }
.aggiungi form { margin-top: .6rem; }
