/* Portale clienti Socrate (11/11/2026): stessa grafica della wallboard NOC (noc/static/index.html),
   fondo blu notte sfumato, riquadri con bagliore del colore di stato, icone a linea, animazioni morbide.
   Adattata al web: misure in px/rem invece che in vw, leggibile da PC e telefono. */
:root {
    --bg: #070c1c; --card: #0e1730; --card2: #13203f; --bordo: #22335e; --riga: rgba(255,255,255,.07);
    --testo: #f1f5fc; --testo2: #bcc7e0; --muto: #7f8cab;
    --brand: #3b7ff0; --brand-chiaro: #79a8ff; --ok: #32d583; --att: #fdb022; --crit: #f97066; --grigio: #8a93a8;
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", "Noto Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; color: var(--testo); font-family: var(--font);
    font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
    background: radial-gradient(110vw 70vh at 50% -18%, #15275a 0%, var(--bg) 62%) no-repeat, var(--bg); }
a { color: var(--brand-chiaro); }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
    stroke-linejoin: round; flex: none; vertical-align: -.14em; }

/* ---- testata (come la wallboard: icona, "Socrate" + nome in azzurro, sottotitolo maiuscolo) ---- */
.testata { border-bottom: 1px solid var(--bordo); background: rgba(7,12,28,.55); backdrop-filter: blur(6px);
    position: sticky; top: 0; z-index: 10; }
.testata-dentro { max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 72px; display: flex; align-items: center; gap: 16px; }
.marchio { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-width: 0; }
.marchio img { height: 46px; width: 46px; flex: none; }
.nome b { display: block; font-size: 22px; font-weight: 750; letter-spacing: -.01em; line-height: 1.05; color: var(--testo); }
.nome b span { color: var(--brand-chiaro); font-weight: 600; }
.nome small { display: block; color: var(--testo2); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etichetta-prova { font-size: 12px; color: #fed48a; border: 1px solid #6b5115; border-radius: 14px; padding: 3px 10px; white-space: nowrap; }
.utente { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--testo2);
    padding-left: 18px; border-left: 1px solid var(--bordo); }
.utente .chi { display: flex; align-items: center; gap: 8px; }
.utente .chi .i { color: var(--brand-chiaro); font-size: 18px; }
.utente a { color: var(--testo); text-decoration: none; border: 1px solid var(--bordo); background: #0b1430; border-radius: 8px;
    padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; transition: border-color .2s, background .2s; }
.utente a:hover { border-color: var(--brand); background: #10224d; }

.contenuto { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 24px 44px; }
.piede { text-align: center; color: var(--muto); font-size: 13px; padding: 18px; border-top: 1px solid var(--bordo); }
h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 span { color: var(--brand-chiaro); }
.nota { color: var(--muto); font-size: 13px; margin: 4px 0; }

/* ---- pulsanti ---- */
.pulsante { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(180deg, #4a8cf5, var(--brand));
    color: #fff; text-decoration: none; border: 1px solid #5b95f5; border-radius: 10px; padding: 10px 20px; font: inherit;
    font-weight: 650; cursor: pointer; box-shadow: 0 0 22px rgba(59,127,240,.35), inset 0 1px 0 rgba(255,255,255,.2);
    transition: transform .15s, box-shadow .2s; }
.pulsante:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(59,127,240,.55), inset 0 1px 0 rgba(255,255,255,.25); }
.pulsante.secondario { background: #0b1430; border-color: var(--bordo); color: var(--testo); box-shadow: none; }
.pulsante.secondario:hover { border-color: var(--brand); background: #10224d; }
.pulsante.piccolo { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* ---- pannelli (gradiente e ombra della wallboard) ---- */
.pannello { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--bordo); border-radius: 14px;
    padding: 18px 20px; margin-bottom: 18px; min-width: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 6px 20px rgba(0,0,0,.35); }
.pannello h2 { font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: 10px; margin: 0 0 6px; flex-wrap: wrap; }
.pannello h2 .i { font-size: 21px; color: var(--brand-chiaro); }
.pannello h2 small { color: var(--muto); font-weight: 500; font-size: 13px; }
.pannello.centrato { max-width: 640px; margin: 48px auto; padding: 30px 32px; }
.pannello.centrato h1 { margin-bottom: 10px; }

.barra-azioni { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.barra-azioni h1 { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 14px; font-size: 13px;
    background: var(--card); border: 1px solid var(--bordo); color: var(--testo2); white-space: nowrap; }
.badge .i { color: var(--brand-chiaro); }
.avviso-dati { background: #4a3307; color: #fff3d6; border: 1px solid #7a5512; border-radius: 10px; padding: 10px 16px;
    font-weight: 600; margin-bottom: 18px; }

/* ---- KPI: bordo e bagliore del colore di stato, come i 6 riquadri della wallboard ---- */
.kpi-riga { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { --c: var(--brand); margin: 0; border: 2px solid color-mix(in srgb, var(--c) 70%, transparent);
    background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, #0e1730), #0b1328 70%);
    box-shadow: 0 0 26px color-mix(in srgb, var(--c) 28%, transparent), inset 0 1px 0 rgba(255,255,255,.06); padding: 16px 18px; }
.kpi.ok { --c: var(--ok); } .kpi.att { --c: var(--att); } .kpi.crit { --c: var(--crit); } .kpi.grigio { --c: var(--grigio); opacity: .85; }
.kpi h2 { font-size: 14px; color: var(--testo2); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 8px; }
.kpi h2 .i { font-size: 22px; color: color-mix(in srgb, var(--c) 55%, white); }
.kpi .grande { display: block; font-size: 32px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.kpi .grande small { font-size: 17px; font-weight: 600; color: var(--testo2); letter-spacing: 0; }
.kpi.ok .grande { color: var(--ok); } .kpi.att .grande { color: var(--att); } .kpi.crit .grande { color: var(--crit); }
.kpi .sotto { color: var(--testo2); font-size: 13px; margin-top: 6px; }
.kpi.crit { animation: respiro-crit 2.8s ease-in-out infinite; }
/* barra del monte ore: quanto è stato usato */
.consumo { margin-top: 12px; }
.consumo svg { width: 100%; height: 8px; display: block; }
.consumo .fondo { fill: rgba(255,255,255,.1); }
.consumo .pieno { fill: var(--c); transform-box: fill-box; transform-origin: left; animation: avanza 1.4s cubic-bezier(.2,.9,.2,1) .35s both; }

/* ---- grafico ore per mese ---- */
.legenda { display: inline-flex; gap: 16px; font-size: 13px; color: var(--testo2); margin-left: auto; }
.legenda i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legenda .lav { background: var(--brand); } .legenda .via { background: #56658f; }
.grafico { overflow-x: auto; margin-top: 6px; }
.grafico svg { width: 100%; min-width: 620px; height: auto; max-height: 270px; display: block; }
.grafico .asse { stroke: var(--bordo); }
.grafico .barra { transform-box: fill-box; transform-origin: bottom; animation: cresce .9s cubic-bezier(.2,.9,.2,1) both; }
.grafico .lav { fill: url(#sfumatura-lav); } .grafico .via { fill: #56658f; }
.grafico text { fill: var(--testo2); font-family: var(--font); }
.grafico .valore { fill: var(--testo); font-weight: 600; animation: compare .5s ease both; }
.grafico g:hover .barra { filter: brightness(1.25); }
.grafico g:nth-child(2) .barra, .grafico g:nth-child(2) .valore { animation-delay: .04s; }
.grafico g:nth-child(3) .barra, .grafico g:nth-child(3) .valore { animation-delay: .08s; }
.grafico g:nth-child(4) .barra, .grafico g:nth-child(4) .valore { animation-delay: .12s; }
.grafico g:nth-child(5) .barra, .grafico g:nth-child(5) .valore { animation-delay: .16s; }
.grafico g:nth-child(6) .barra, .grafico g:nth-child(6) .valore { animation-delay: .2s; }
.grafico g:nth-child(7) .barra, .grafico g:nth-child(7) .valore { animation-delay: .24s; }
.grafico g:nth-child(8) .barra, .grafico g:nth-child(8) .valore { animation-delay: .28s; }
.grafico g:nth-child(9) .barra, .grafico g:nth-child(9) .valore { animation-delay: .32s; }
.grafico g:nth-child(10) .barra, .grafico g:nth-child(10) .valore { animation-delay: .36s; }
.grafico g:nth-child(11) .barra, .grafico g:nth-child(11) .valore { animation-delay: .4s; }
.grafico g:nth-child(12) .barra, .grafico g:nth-child(12) .valore { animation-delay: .44s; }
.grafico g:nth-child(13) .barra, .grafico g:nth-child(13) .valore { animation-delay: .48s; }

/* ---- tabelle (righe sottili come la wallboard) ---- */
.intestazione-tabella { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.intestazione-tabella h2 { margin: 0; }
.cerca { margin-left: auto; position: relative; min-width: 260px; }
.cerca .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muto); font-size: 16px; }
.filtro { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--bordo); border-radius: 10px; font: inherit; font-size: 14px;
    background: #0b1430; color: var(--testo); outline: none; transition: border-color .2s, box-shadow .2s; }
.filtro::placeholder { color: var(--muto); }
.filtro:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,127,240,.25); }
.scorre { overflow: auto; max-height: 540px; border: 1px solid var(--bordo); border-radius: 10px; background: rgba(7,12,28,.35); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { position: sticky; top: 0; z-index: 1; background: #0f1a36; text-align: left; font-size: 12px; color: var(--muto); font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--bordo); }
td { padding: 8px 12px; border-top: 1px solid var(--riga); white-space: nowrap; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(59,127,240,.08); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.forte { font-weight: 650; }
td.vuoto { color: var(--testo2); text-align: center; padding: 26px; }
tr.nascosta { display: none; }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 7px; white-space: nowrap; }
.pill.stato-aperto { background: #c2343f; color: #fff; }
.pill.stato-in-lavorazione { background: #b07a10; color: #fff; }
.pill.stato-chiuso { background: #1f8a55; color: #fff; }
.pill.grigio { background: #2a3658; color: var(--testo2); }
details.sezione-dora { border-top: 1px solid var(--riga); padding: 12px 0; }
details.sezione-dora:first-of-type { border-top: 0; }
details.sezione-dora summary { cursor: pointer; font-weight: 650; display: flex; align-items: center; gap: 10px; list-style: none; }
details.sezione-dora summary::-webkit-details-marker { display: none; }
details.sezione-dora summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--brand-chiaro);
    border-bottom: 2px solid var(--brand-chiaro); transform: rotate(-45deg); transition: transform .2s; margin-right: 4px; }
details.sezione-dora[open] summary::before { transform: rotate(45deg); }
details.sezione-dora[open] > div { animation: sale .35s ease both; }
.aggiornato { color: var(--muto); font-size: 13px; text-align: right; display: flex; justify-content: flex-end; align-items: center; gap: 6px; }

/* ---- pagine di accesso ---- */
.codici { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; background: #0b1430; border: 1px solid var(--bordo);
    padding: 12px 16px; border-radius: 10px; font-family: Consolas, monospace; font-size: 13px; }
.codici dt { font-weight: 600; font-family: var(--font); color: var(--testo2); }
.codici dd { margin: 0; user-select: all; }
.elenco-clienti { display: flex; flex-wrap: wrap; gap: 10px; }
.utenti-prova { padding-left: 18px; } .utenti-prova li { margin: 10px 0; }
.icona-grande { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; margin-bottom: 14px;
    background: radial-gradient(circle at 50% 35%, #2b5fc4, #10224d); box-shadow: 0 0 30px rgba(59,127,240,.45);
    font-size: 26px; color: #fff; animation: respiro 3s ease-in-out infinite; }

/* ---- animazioni (le stesse curve della wallboard) ---- */
@keyframes sale { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes avanza { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cresce { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes compare { from { opacity: 0; } to { opacity: 1; } }
@keyframes respiro { 50% { box-shadow: 0 0 12px rgba(59,127,240,.25); } }
@keyframes respiro-crit { 50% { box-shadow: 0 0 8px color-mix(in srgb, var(--crit) 15%, transparent); } }
.entra { animation: sale .6s cubic-bezier(.2,.9,.2,1) both; }
.kpi-riga > .entra:nth-child(2) { animation-delay: .07s; }
.kpi-riga > .entra:nth-child(3) { animation-delay: .14s; }
.kpi-riga > .entra:nth-child(4) { animation-delay: .21s; }
.contenuto > .entra:nth-of-type(2) { animation-delay: .25s; }
.contenuto > .entra:nth-of-type(3) { animation-delay: .32s; }
.contenuto > .entra:nth-of-type(4) { animation-delay: .39s; }
.contenuto > .entra:nth-of-type(5) { animation-delay: .46s; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- telefono ---- */
@media (max-width: 760px) {
    .testata-dentro { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
    .marchio img { height: 38px; width: 38px; }
    .nome b { font-size: 19px; } .nome small { display: none; }
    .utente { margin-left: 0; width: 100%; padding-left: 0; border-left: 0; justify-content: flex-end; }
    .utente .chi { margin-right: auto; }
    .contenuto { padding: 18px 14px 32px; }
    h1 { font-size: 20px; }
    .cerca { margin-left: 0; min-width: 0; width: 100%; }
    .kpi .grande { font-size: 27px; }
    .pannello { padding: 16px; }
}
