@font-face { font-family: "Bestia Display"; src: url("/static/display.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  --blu: #0b3fa0; --blu-notte: #082a70; --blu-profondo: #061d52; --blu-chiaro: #e6edfa;
  --rosso: #e4003a; --rosso-scuro: #b8002f;
  --bianco: #fff; --carta: #f1f4fa; --testo: #0e1b38; --grigio: #56627a; --bordo: #d5dcea;
  --verde: #12784a; --ambra: #8f5d00;
  --display: "Bestia Display", Impact, "Arial Black", system-ui, sans-serif;
  --raggio: 14px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--testo); background: var(--carta); line-height: 1.5; }
h1, h2, h3 { margin: 0; }
h2 { font-family: var(--display); font-size: 1.25rem; text-transform: uppercase; letter-spacing: .01em; color: var(--blu-notte); }
h3 { font-size: 1rem; }
a { color: var(--blu); }
small { display: block; color: var(--grigio); font-size: .8rem; }
.muted { color: var(--grigio); font-size: .9rem; }
.ico { flex: none; }
.skip { position: absolute; left: -999px; top: 0; z-index: 10; padding: .6rem 1rem; color: var(--bianco); background: var(--rosso); }
.skip:focus { left: 0; }

/* Moduli e pulsanti */
label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 1rem; }
input, select { display: block; width: 100%; margin-top: .35rem; padding: .7rem .8rem; font: inherit; font-weight: 400; color: inherit; background: var(--bianco); border: 2px solid var(--bordo); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #b3c0d9; }
input:focus, select:focus { outline: none; border-color: var(--blu); box-shadow: 0 0 0 4px rgba(11, 63, 160, .18); }
a:focus-visible, .btn:focus-visible, button:focus-visible { outline: 3px solid var(--rosso); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .65rem 1.1rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; color: var(--blu-notte); background: var(--bianco); border: 2px solid var(--blu-notte); border-radius: 10px; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { background: var(--blu-chiaro); }
.btn.primary { font-family: var(--display); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; color: var(--bianco); background: var(--rosso); border-color: var(--rosso); box-shadow: 4px 4px 0 var(--blu-profondo); }
.btn.primary:hover { background: var(--rosso-scuro); border-color: var(--rosso-scuro); transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--blu-profondo); }
.btn.primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--blu-profondo); }
.btn.small { white-space: nowrap; padding: .3rem .65rem; font-size: .8rem; border-width: 1.5px; border-radius: 8px; }
.btn.danger { color: var(--rosso-scuro); border-color: var(--rosso-scuro); }
.btn.danger:hover { color: var(--bianco); background: var(--rosso); }
.btn.ghost { color: var(--bianco); background: transparent; border-color: rgba(255, 255, 255, .4); }
.btn.ghost:hover { background: rgba(255, 255, 255, .14); border-color: var(--bianco); }
button.link { padding: 0; font: inherit; font-size: .9rem; color: var(--grigio); text-decoration: underline; background: none; border: 0; cursor: pointer; }

.flash { padding: .8rem 1rem; margin: 0 0 1.25rem; font-size: .92rem; border-radius: 10px; border: 2px solid; }
.flash.error { color: var(--rosso-scuro); background: #ffe9ee; border-color: var(--rosso); }
.flash.ok { color: #0c4f31; background: #e4f5ec; border-color: var(--verde); }
.flash p { margin: .4rem 0 0; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; font-weight: 700; letter-spacing: .06em; overflow-wrap: anywhere; }

.tag { display: inline-block; padding: .15rem .6rem; font-size: .72rem; font-weight: 800; font-style: normal; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; color: var(--grigio); background: #e7ebf3; border-radius: 6px; }
.tag.ok { color: var(--bianco); background: var(--verde); }
.tag.warn { color: var(--ambra); background: #fdefcf; }
.tag.off { color: var(--bianco); background: var(--rosso-scuro); }

/* Scritta "adesivo" e nastro di testo */
.wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; font-family: var(--display); text-transform: uppercase; line-height: 1; transform: rotate(-4deg); }
.wordmark span { display: block; border: 4px solid var(--bianco); transform: skewX(-8deg); }
.wordmark .w1 { padding: .15em .5em; font-size: 1.3rem; color: var(--blu-notte); background: var(--bianco); border-radius: 8px 8px 0 0; margin-left: .4rem; margin-bottom: -4px; }
.wordmark .w2 { padding: .12em .35em .16em; font-size: 3.4rem; color: var(--bianco); background: var(--rosso); border-radius: 12px; box-shadow: 7px 7px 0 var(--blu-profondo); position: relative; z-index: 1; }
.wordmark .w3 { padding: .3em .7em; font-size: .95rem; color: var(--bianco); background: var(--blu-notte); border-radius: 0 0 10px 10px; margin-left: 1.6rem; margin-top: -4px; }
.wordmark.small { transform: rotate(-3deg); }
.wordmark.small span { border-width: 3px; }
.wordmark.small .w1 { font-size: .7rem; margin-bottom: -3px; border-radius: 5px 5px 0 0; }
.wordmark.small .w2 { font-size: 1.35rem; border-radius: 8px; box-shadow: 4px 4px 0 var(--blu-profondo); }

.ticker { overflow: hidden; white-space: nowrap; font-size: .68rem; font-weight: 800; letter-spacing: .28em; color: rgba(255, 255, 255, .38); user-select: none; }
.ticker span { display: inline-block; }

/* Pagine pubbliche e di accesso: aspetto neutro */
body.pub { --accento: #1f2a44; min-height: 100vh; display: flex; flex-direction: column; color: #1c2333; background: #f5f6f8; }
body.pub a { color: #1f2a44; }
body.pub .btn { color: #1f2a44; border: 1px solid #c9ced8; border-radius: 8px; box-shadow: none; }
body.pub .btn:hover { background: #eceef2; transform: none; }
body.pub .btn.primary { font-family: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: #fff; background: var(--accento); border-color: var(--accento); box-shadow: none; }
body.pub .btn.primary:hover, body.pub .btn.primary:active { background: #111a2e; transform: none; box-shadow: none; }
body.pub input, body.pub select { border: 1px solid #c9ced8; border-radius: 8px; }
body.pub input:focus { border-color: var(--accento); box-shadow: 0 0 0 3px rgba(31, 42, 68, .15); }
body.pub a:focus-visible, body.pub .btn:focus-visible { outline: 3px solid rgba(31, 42, 68, .45); }
.pub-brand { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.pub-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid #e1e4ea; }
.pub-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.pub-hero { padding: 4rem 0; text-align: center; }
.pub-hero h1 { font-size: 2.2rem; margin-bottom: 1rem; }
.pub-hero p { margin: 0 auto .6rem; max-width: 34rem; font-size: 1.05rem; }
.pub-hero .btn { margin-top: 1.4rem; min-width: 10rem; }
.pub-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin: 0; padding: 1.25rem 1rem; font-size: .85rem; }
.pub-foot a { color: #56627a; }
.legal h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.legal h2 { margin: 1.8rem 0 .5rem; font-family: inherit; font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: inherit; }
.legal p, .legal li { font-size: .95rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .5rem; }
.legal mark { padding: 0 .3em; background: #ffe58a; }
body.auth .auth-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 410px; padding: 2rem; background: #fff; border: 1px solid #e1e4ea; border-radius: 12px; box-shadow: 0 8px 30px rgba(20, 28, 48, .08); }
.auth-card h1 { font-size: 1.3rem; margin-bottom: 1.1rem; }
.auth-card .btn.primary { width: 100%; margin-top: .25rem; }
.auth-card form + p, .auth-card form + form { margin-top: 1.1rem; }
.auth-card > .muted { margin: 0 0 1rem; }
.qr { display: flex; justify-content: center; margin: 1rem 0; }
.qr svg { max-width: 100%; height: auto; border: 1px solid #c9ced8; border-radius: 8px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: 1rem; margin: 1rem 0 1.5rem; list-style: none; font-family: ui-monospace, Consolas, monospace; font-weight: 700; background: #eef0f4; border-radius: 8px; }

/* Applicazione: barra laterale */
body.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.4rem 1rem 1rem; overflow-y: auto; color: var(--bianco); background: var(--blu-notte) url("/static/onde.svg"); }
.side .brand { display: flex; align-items: center; gap: .5rem; margin: 0 0 1.6rem .2rem; text-decoration: none; }
.side .brand img { height: 64px; width: auto; filter: drop-shadow(3px 3px 0 rgba(6, 29, 82, .8)); }
.side nav { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.side nav a, .side nav .soon { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; font-size: .93rem; font-weight: 600; color: var(--bianco); text-decoration: none; border-radius: 10px; border-left: 4px solid transparent; transition: background .12s, transform .12s; }
.side nav a:hover { background: rgba(255, 255, 255, .13); transform: translateX(2px); }
.side nav a.active { color: var(--blu-notte); background: var(--bianco); border-left-color: var(--rosso); box-shadow: 4px 4px 0 var(--blu-profondo); }
.side nav a.active .ico { color: var(--rosso); }
.side nav .soon { color: rgba(255, 255, 255, .55); cursor: default; }
.side nav .soon em { margin-left: auto; font-size: .62rem; font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .4rem; color: rgba(255, 255, 255, .75); border: 1px solid rgba(255, 255, 255, .3); border-radius: 5px; }
.side nav h2 { margin: 1.3rem 0 .4rem .8rem; font-family: inherit; font-size: .68rem; font-weight: 800; letter-spacing: .14em; color: rgba(255, 255, 255, .6); }
.side .me { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .2); }
.side .who { display: flex; align-items: center; gap: .7rem; padding: .5rem; margin-bottom: .7rem; color: var(--bianco); text-decoration: none; border-radius: 10px; }
.side .who:hover, .side .who.active { background: rgba(255, 255, 255, .13); }
.side .who small { color: rgba(255, 255, 255, .7); }
.avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-family: var(--display); font-size: .95rem; color: var(--bianco); background: var(--rosso); border: 2px solid var(--bianco); border-radius: 10px; transform: rotate(-4deg); }
.side .me .btn { width: 100%; }

/* Applicazione: testata e contenuto */
.hero { position: relative; overflow: hidden; padding: 0 2.25rem 2rem; color: var(--bianco); background: var(--blu) url("/static/onde.svg"); border-bottom: 6px solid var(--rosso); }
.hero .ticker { margin: 0 -2.25rem 1.6rem; padding: .6rem 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.hero-text { position: relative; z-index: 1; max-width: 46rem; }
.sticker { display: inline-block; padding: .1em .4em .14em; font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.05; text-transform: uppercase; color: var(--bianco); background: var(--rosso); border: 4px solid var(--bianco); border-radius: 12px; box-shadow: 6px 6px 0 var(--blu-profondo); transform: rotate(-2deg) skewX(-6deg); transform-origin: left center; }
.hero p { margin: 1.1rem 0 0; font-size: 1.02rem; font-weight: 500; color: rgba(255, 255, 255, .92); }
.hero-fig { position: absolute; right: 2.5rem; top: -12%; height: 175%; width: auto; transform: rotate(9deg); filter: drop-shadow(7px 7px 0 rgba(6, 29, 82, .6)); pointer-events: none; }

.content { padding: 2rem 2.25rem 3rem; max-width: 1280px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.25rem; margin-bottom: 2.5rem; }
.tile { position: relative; padding: 1.1rem 1.25rem 1rem; background: var(--bianco); border: 2px solid var(--blu-notte); border-radius: var(--raggio); box-shadow: 5px 5px 0 var(--blu-notte); }
.tile .ico { position: absolute; top: 1rem; right: 1rem; width: 24px; height: 24px; color: var(--rosso); }
.tile b { display: block; font-family: var(--display); font-size: 2.9rem; line-height: 1; color: var(--blu); }
.tile span { display: block; margin-top: .3rem; font-size: .85rem; font-weight: 600; color: var(--grigio); }
.tile.zero { border-color: var(--bordo); box-shadow: 5px 5px 0 var(--bordo); }
.tile.zero b, .tile.zero .ico { color: #a9b4c9; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .7rem; }
.progress-label { font-size: .85rem; font-weight: 700; color: var(--grigio); }
.progress { display: flex; gap: 5px; margin-bottom: 1.4rem; }
.progress i { flex: 1; height: 10px; background: #dbe2ef; border-radius: 3px; transform: skewX(-20deg); }
.progress i.on { background: var(--rosso); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; }
.card { position: relative; overflow: hidden; padding: 1.15rem 1.2rem 1.1rem; background: var(--bianco); border: 2px solid var(--bordo); border-radius: var(--raggio); transition: transform .14s, box-shadow .14s, border-color .14s; }
.card:hover { transform: translate(-2px, -2px); border-color: var(--blu-notte); box-shadow: 5px 5px 0 var(--blu-notte); }
.card.on { border-color: var(--blu-notte); box-shadow: 5px 5px 0 var(--rosso); }
.card .num { position: absolute; bottom: -.6rem; right: .6rem; font-family: var(--display); font-size: 4rem; line-height: 1; color: var(--blu-chiaro); user-select: none; }
.card header { position: relative; display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; }
.card-ico { display: grid; place-items: center; width: 38px; height: 38px; color: var(--bianco); background: var(--blu); border-radius: 10px; transform: rotate(-4deg); }
.card.on .card-ico { background: var(--rosso); }
.card h3 { font-family: var(--display); font-size: 1.1rem; text-transform: uppercase; color: var(--blu-notte); }
.card p { position: relative; margin: 0 0 .9rem; font-size: .88rem; color: var(--grigio); min-height: 3.9em; }

.panel { padding: 1.4rem; margin-bottom: 1.5rem; background: var(--bianco); border: 2px solid var(--bordo); border-radius: var(--raggio); }
.panel h2 { margin-bottom: 1rem; }
form.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; align-items: end; }
form.row .btn { margin-bottom: 1rem; }
form.stack { max-width: 400px; }
form.inline { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
form.inline select { width: auto; margin: 0; padding: .3rem .45rem; font-size: .85rem; border-width: 1.5px; border-radius: 8px; }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin: .4rem 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--grigio); }
.roles li { padding: .6rem .8rem; background: var(--carta); border-left: 4px solid var(--blu); border-radius: 8px; }
.roles strong { display: block; color: var(--testo); }
.table-wrap { overflow-x: auto; border: 1px solid var(--bordo); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .7rem .85rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--bordo); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7f9fd; }
th { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--blu-notte); background: var(--blu-chiaro); white-space: nowrap; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 1rem 0 0; font-size: .88rem; color: var(--grigio); }
.panel > form:last-child { margin-top: 1rem; }

@media (max-width: 1100px) { .hero-fig { opacity: .35; right: -1rem; } }
@media (max-width: 860px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .7rem 1rem; }
  .side .brand { margin: 0; }
  .side .brand img { height: 44px; }
  .side nav { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; gap: .3rem; padding-bottom: .2rem; }
  .side nav .soon, .side nav h2 { display: none; }
  .side nav a { white-space: nowrap; border-left: 0; padding: .45rem .7rem; }
  .side nav a.active { box-shadow: none; }
  .side .me { display: flex; align-items: center; gap: .5rem; margin: 0 0 0 auto; padding: 0; border: 0; }
  .side .who { margin: 0; padding: .2rem; }
  .side .who > span:last-child { display: none; }
  .side .me .btn { width: auto; padding: .45rem .7rem; }
  .hero { padding: 0 1rem 1.5rem; }
  .hero .ticker { margin: 0 -1rem 1.2rem; }
  .hero-fig { display: none; }
  .content { padding: 1.25rem 1rem 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
