/* Noodles · nero laccato, rosso drago, oro e rosa ciliegio (dal logo) */
:root {
    --sfondo: #060304;
    --pannello: #110a0c;
    --pannello2: #190d11;
    --pannello3: #231218;
    --vetro: rgba(24, 12, 16, .72);
    --bordo: rgba(255, 255, 255, .06);
    --bordo2: rgba(255, 120, 130, .16);
    --testo: #f6efef;
    --tenue: #a8939a;
    --rosso: #e3202b;
    --rosso-vivo: #ff3a44;
    --rosso-scuro: #8f0f17;
    --sakura: #f6a8bd;
    --oro: #f2c46b;
    --argento: #e7e2e2;
    --verde: #3fd27a;
    --giallo: #ffc23d;
    --raggio: 18px;
    --ombra: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -18px rgba(0, 0, 0, .8);
    --titoli: "Russo One", "Outfit", system-ui, sans-serif;
    --kanji: "Noto Serif JP", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; color: var(--testo); font-family: "Outfit", system-ui, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
    min-height: 100vh;
    background:
        radial-gradient(1100px 700px at 100% -10%, rgba(227, 32, 43, .18), transparent 60%),
        radial-gradient(800px 600px at -10% 110%, rgba(143, 15, 23, .25), transparent 60%),
        radial-gradient(600px 500px at 55% 120%, rgba(246, 168, 189, .06), transparent 70%),
        var(--sfondo);
    background-attachment: fixed;
}
/* grana leggera, da carta di riso */
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .05; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: var(--rosso); color: #fff; }
a { color: var(--sakura); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: .01em; }
h2 { font-family: var(--titoli); font-size: 1.35rem; }
h3 { font-family: var(--titoli); font-size: .95rem; letter-spacing: .05em; text-transform: uppercase; color: var(--argento); }
strong { font-weight: 700; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a1a22; border-radius: 99px; border: 2px solid var(--sfondo); }
::-webkit-scrollbar-track { background: transparent; }

/* ---- petali che cadono, appena accennati */
#petali { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
#petali i {
    position: absolute; top: -20px; width: 11px; height: 9px; border-radius: 10px 1px 10px 1px;
    background: linear-gradient(135deg, #ffd3df, var(--sakura)); opacity: .35;
    animation: cade linear infinite;
}
@keyframes cade {
    0% { transform: translate(0, -20px) rotate(0); }
    50% { transform: translate(60px, 50vh) rotate(200deg); }
    100% { transform: translate(-20px, 105vh) rotate(420deg); }
}
@media (prefers-reduced-motion: reduce) { #petali { display: none; } * { animation-duration: .01ms !important; } }

.caricamento { display: grid; place-items: center; height: 100vh; }
.caricamento img { width: 140px; filter: drop-shadow(0 0 30px rgba(227, 32, 43, .5)); animation: respira 1.6s ease-in-out infinite; }
@keyframes respira { 50% { transform: scale(1.05); filter: drop-shadow(0 0 45px rgba(227, 32, 43, .75)); } }

/* ---- ingresso */
.ingresso { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; z-index: 1; }
.ingresso::before {
    content: "麺"; position: fixed; font-family: var(--kanji); font-weight: 900; font-size: min(70vw, 620px); line-height: 1;
    color: rgba(227, 32, 43, .045); left: 50%; top: 50%; transform: translate(-50%, -52%); pointer-events: none;
}
.ingresso .scatola { max-width: 440px; width: 100%; text-align: center; position: relative; animation: sale .6s cubic-bezier(.2, .8, .2, 1); }
.logo-grande { width: min(300px, 75vw); display: block; margin: 0 auto -6px; filter: drop-shadow(0 10px 40px rgba(227, 32, 43, .45)); animation: galleggia 6s ease-in-out infinite; }
@keyframes galleggia { 50% { transform: translateY(-6px); } }
.ingresso .carta { padding: 28px 28px 32px; }
.ingresso p { color: var(--tenue); margin: 6px 0; }
.ingresso .motto { font-family: var(--titoli); letter-spacing: .3em; text-transform: uppercase; font-size: .76rem; color: var(--sakura); margin-bottom: 14px; }

/* ---- struttura */
.guscio { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; position: relative; z-index: 1; }
.laterale {
    background: linear-gradient(180deg, rgba(22, 10, 14, .92), rgba(9, 4, 6, .96));
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--bordo); padding: 18px 14px; position: sticky; top: 0; height: 100vh;
    overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.laterale::after {
    content: "麺"; position: absolute; bottom: 80px; right: 8px; font-family: var(--kanji); font-size: 8rem; line-height: 1;
    color: rgba(227, 32, 43, .05); pointer-events: none; font-weight: 900;
}
.marchio { display: flex; justify-content: center; padding: 0 0 6px; }
.marchio img { width: 150px; filter: drop-shadow(0 6px 24px rgba(227, 32, 43, .35)); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.marchio img:hover { transform: rotate(-3deg) scale(1.04); }
.sezione {
    font-family: var(--titoli); font-size: .64rem; text-transform: uppercase; letter-spacing: .24em; color: var(--sakura);
    padding: 16px 10px 6px; display: flex; align-items: center; gap: 8px; opacity: .8;
}
.sezione::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(246, 168, 189, .25), transparent); }
.voce {
    display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; cursor: pointer; color: var(--tenue);
    border: 1px solid transparent; background: none; text-align: left; width: 100%; font-weight: 500;
    transition: background .2s, color .2s, transform .2s;
}
.voce span {
    width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; flex: none;
    background: rgba(255, 255, 255, .03); border: 1px solid var(--bordo); font-size: .95rem; transition: background .2s, box-shadow .2s;
}
.voce:hover { background: rgba(255, 255, 255, .035); color: var(--testo); transform: translateX(2px); }
.voce.attiva {
    background: linear-gradient(90deg, rgba(227, 32, 43, .22), rgba(227, 32, 43, .02));
    border-color: rgba(227, 32, 43, .28); color: #fff;
}
.voce.attiva span { background: linear-gradient(180deg, var(--rosso-vivo), var(--rosso-scuro)); border-color: transparent; box-shadow: 0 6px 18px rgba(227, 32, 43, .45); }
.io { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 4px; border-top: 1px solid var(--bordo); position: relative; z-index: 1; }
.io .nome { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.io .sotto { color: var(--sakura); font-size: .76rem; letter-spacing: .03em; }
.contenuto { padding: 32px 40px 80px; max-width: 1280px; width: 100%; min-width: 0; animation: sale .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes sale { from { opacity: 0; transform: translateY(8px); } }

.testata { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--bordo); position: relative; }
.testata::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 120px; height: 2px; background: linear-gradient(90deg, var(--rosso-vivo), var(--oro), transparent); }
.titolo-pagina {
    font-family: var(--titoli); font-size: 2.1rem; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1;
    background: linear-gradient(180deg, #ffffff 0%, var(--argento) 55%, #9d9696 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
    display: flex; align-items: center;
}
.testata .icona {
    font-size: 1.4rem; margin-right: 14px; color: #fff; -webkit-text-fill-color: #fff; width: 48px; height: 48px; display: inline-grid; place-items: center;
    border-radius: 14px; background: linear-gradient(160deg, rgba(227, 32, 43, .35), rgba(143, 15, 23, .15)); border: 1px solid rgba(227, 32, 43, .35);
    box-shadow: 0 10px 30px -10px rgba(227, 32, 43, .6);
}
.testata p { margin: 8px 0 0; color: var(--tenue); }

.menu-mobile { display: none; }

@media (max-width: 900px) {
    .guscio { grid-template-columns: 1fr; }
    .laterale { display: none; }
    .laterale.aperto { display: flex; position: fixed; inset: 0; z-index: 50; width: 100%; height: 100vh; }
    .menu-mobile {
        display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--bordo);
        background: rgba(12, 6, 8, .9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 40;
    }
    .menu-mobile img { height: 44px; }
    .contenuto { padding: 20px 16px 60px; }
    .titolo-pagina { font-size: 1.45rem; }
    .testata .icona { width: 40px; height: 40px; }
}

/* ---- carte */
.carta {
    background: linear-gradient(180deg, rgba(30, 15, 20, .78), rgba(14, 7, 10, .82));
    backdrop-filter: blur(10px);
    border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 20px; position: relative; overflow: hidden;
    box-shadow: var(--ombra);
}
.carta::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 90, 100, .55), transparent);
}
.carta h3 { margin-bottom: 14px; }
.carta.allarme { border-color: rgba(255, 194, 61, .35); background: linear-gradient(90deg, rgba(255, 194, 61, .1), rgba(14, 7, 10, .8)); padding: 14px 18px; }
.griglia { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.colonne { columns: 2 380px; column-gap: 16px; }
.colonne > * { break-inside: avoid; margin-bottom: 16px; }

.tessere { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tessera {
    background: linear-gradient(160deg, rgba(40, 17, 24, .85), rgba(14, 7, 10, .9)); border: 1px solid var(--bordo);
    border-radius: var(--raggio); padding: 16px 18px; position: relative; overflow: hidden; box-shadow: var(--ombra);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s;
}
.tessera:hover { transform: translateY(-2px); border-color: rgba(227, 32, 43, .3); }
.tessera::after {
    content: ""; position: absolute; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 50%;
    background: radial-gradient(circle, rgba(227, 32, 43, .25), transparent 70%);
}
.tessera.buono::after { background: radial-gradient(circle, rgba(63, 210, 122, .22), transparent 70%); }
.tessera.cattivo::after { background: radial-gradient(circle, rgba(255, 58, 68, .35), transparent 70%); }
.tessera.oro::after { background: radial-gradient(circle, rgba(242, 196, 107, .3), transparent 70%); }
.tessera .etichetta { color: var(--sakura); font-size: .7rem; text-transform: uppercase; letter-spacing: .15em; font-weight: 600; }
.tessera .valore {
    font-family: var(--titoli); font-size: 1.8rem; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #fff, #b9b3b3); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tessera.buono .valore { background-image: linear-gradient(180deg, #b6ffd2, var(--verde)); }
.tessera.cattivo .valore { background-image: linear-gradient(180deg, #ffb3b7, var(--rosso-vivo)); }
.tessera.oro .valore { background-image: linear-gradient(180deg, #fff1cf, var(--oro)); }
.tessera .nota { color: var(--tenue); font-size: .8rem; margin-top: 5px; }
@media (max-width: 1100px) { .g2-1 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .g2, .g3 { grid-template-columns: 1fr; }
    .tessere { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tessera .valore { font-size: 1.35rem; }
}

/* ---- bottoni */
.bottone {
    border: 1px solid rgba(255, 90, 98, .5); border-radius: 12px; padding: 9px 17px; font-weight: 600; cursor: pointer;
    background: linear-gradient(180deg, var(--rosso-vivo), var(--rosso) 55%, var(--rosso-scuro)); color: #fff;
    box-shadow: 0 8px 22px -6px rgba(227, 32, 43, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
    transition: transform .1s, filter .15s, box-shadow .2s; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
.bottone:hover { filter: brightness(1.1); box-shadow: 0 12px 30px -6px rgba(227, 32, 43, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
.bottone:active { transform: translateY(1px) scale(.99); }
.bottone:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); box-shadow: none; }
.bottone.piatto { background: rgba(255, 255, 255, .04); color: var(--testo); border: 1px solid rgba(255, 255, 255, .1); box-shadow: none; text-shadow: none; }
.bottone.piatto:hover { border-color: rgba(227, 32, 43, .6); background: rgba(227, 32, 43, .1); }
.bottone.rosso { background: linear-gradient(180deg, #ff4d55, #b3121c); }
.bottone.verde { background: linear-gradient(180deg, #4be08a, #1f9a52); border-color: rgba(75, 224, 138, .5); box-shadow: 0 8px 22px -6px rgba(63, 210, 122, .5); }
.bottone.piccolo { padding: 5px 11px; font-size: .84rem; border-radius: 9px; }
.bottone.discord { background: linear-gradient(180deg, #6b77ff, #4752c4); border-color: rgba(120, 130, 255, .6); box-shadow: 0 10px 28px -6px rgba(88, 101, 242, .6); padding: 13px 26px; font-size: 1.02rem; }

.schede { display: inline-flex; gap: 4px; padding: 4px; border-radius: 13px; background: rgba(0, 0, 0, .35); border: 1px solid var(--bordo); flex-wrap: wrap; }
.scheda { border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--tenue); font-weight: 600; transition: background .2s, color .2s; }
.scheda:hover { color: var(--testo); }
.scheda.attiva { background: linear-gradient(180deg, rgba(227, 32, 43, .9), var(--rosso-scuro)); color: #fff; box-shadow: 0 6px 16px -6px rgba(227, 32, 43, .7); }

/* ---- campi */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.campo label { font-size: .78rem; color: var(--tenue); font-weight: 500; letter-spacing: .02em; }
input, select, textarea {
    background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .09); border-radius: 11px; padding: 9px 11px; outline: none; width: 100%;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .16); }
input:focus, select:focus, textarea:focus { border-color: var(--rosso); box-shadow: 0 0 0 3px rgba(227, 32, 43, .2); background: rgba(0, 0, 0, .5); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; }
select option { background: #140a0c; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--rosso); flex: none; }
label.riga { cursor: pointer; }
.riga { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spinta { margin-left: auto; }
textarea { resize: vertical; }

/* ---- tabelle */
.tabella-guscio { overflow-x: auto; border: 1px solid var(--bordo); border-radius: var(--raggio); background: rgba(14, 7, 10, .8); backdrop-filter: blur(10px); box-shadow: var(--ombra); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--bordo); white-space: nowrap; }
th { font-family: var(--titoli); font-size: .66rem; text-transform: uppercase; letter-spacing: .15em; color: var(--sakura); font-weight: 400; background: rgba(0, 0, 0, .3); position: sticky; top: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(227, 32, 43, .06); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.spento td { opacity: .4; }
tr.attenzione td { background: rgba(255, 194, 61, .05); }
td input, td select { padding: 6px 9px; }

.persona { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--rosso-scuro), #2a1016); object-fit: cover; flex: none;
    display: grid; place-items: center; font-family: var(--titoli); color: #fff; font-size: .9rem; border: 1px solid rgba(255, 255, 255, .12);
}
.avatar.grande { width: 56px; height: 56px; font-size: 1.2rem; box-shadow: 0 0 0 3px rgba(227, 32, 43, .25); }
.etichettina { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .73rem; font-weight: 600; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); color: var(--tenue); }
.etichettina.verde { color: var(--verde); border-color: rgba(63, 210, 122, .4); background: rgba(63, 210, 122, .1); }
.etichettina.rosso { color: #ff6b73; border-color: rgba(255, 58, 68, .45); background: rgba(255, 58, 68, .12); }
.etichettina.giallo { color: var(--giallo); border-color: rgba(255, 194, 61, .4); background: rgba(255, 194, 61, .1); }
.tenue { color: var(--tenue); }
.piu { color: var(--verde); }
.meno { color: #ff6b73; }
.vuoto { color: var(--tenue); text-align: center; padding: 34px; }
.pallino { width: 9px; height: 9px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 4px rgba(63, 210, 122, .2); display: inline-block; animation: batte 1.5s infinite; }
@keyframes batte { 50% { box-shadow: 0 0 0 7px rgba(63, 210, 122, .05); } }
.margine { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--tenue); }
.margine.buono { color: var(--verde); }
.margine.cattivo { color: #ff6b73; }
.scorta { font-weight: 700; }
.scorta.bassa { color: var(--giallo); }
.scorta.bassa::before { content: "⚠ "; }

/* ---- timbro */
.timbro { text-align: center; padding: 34px 20px; }
.timbro.attivo { border-color: rgba(63, 210, 122, .4); background: radial-gradient(420px 220px at 50% 0%, rgba(63, 210, 122, .16), transparent 70%), linear-gradient(180deg, rgba(30, 15, 20, .78), rgba(14, 7, 10, .82)); }
.timbro .stato { color: var(--tenue); }
.timbro .orologio { font-family: var(--titoli); font-size: 3.6rem; font-variant-numeric: tabular-nums; margin: 8px 0 22px; letter-spacing: .03em; text-shadow: 0 0 40px rgba(255, 255, 255, .08); }
.timbro.attivo .orologio { color: #eafff1; text-shadow: 0 0 40px rgba(63, 210, 122, .35); }
.timbro .bottone { font-size: 1.1rem; padding: 15px 40px; border-radius: 15px; }

/* ---- obiettivi */
.obiettivo { display: flex; flex-direction: column; gap: 14px; }
.obiettivo h3 { margin-bottom: 0; }
.avanzamento-testa { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 7px; }
.avanzamento-testa strong { font-family: var(--titoli); color: var(--oro); }
.avanzamento-binario { height: 12px; border-radius: 99px; background: rgba(0, 0, 0, .45); border: 1px solid var(--bordo); overflow: hidden; }
.avanzamento-riempi {
    height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--rosso-scuro), var(--rosso-vivo), var(--oro));
    box-shadow: 0 0 18px rgba(255, 58, 68, .6); transition: width .9s cubic-bezier(.2, .8, .2, 1); position: relative;
}
.avanzamento-riempi::after {
    content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    animation: luccica 2.4s infinite; transform: translateX(-100%);
}
@keyframes luccica { to { transform: translateX(100%); } }
.avanzamento.pieno .avanzamento-riempi { background: linear-gradient(90deg, #1f9a52, var(--verde), #b6ffd2); box-shadow: 0 0 18px rgba(63, 210, 122, .6); }
.avanzamento.pieno .avanzamento-testa strong { color: var(--verde); }
.avanzamento .nota { color: var(--tenue); font-size: .78rem; margin-top: 5px; }

/* ---- conti */
.conto .voce-conto { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, .08); font-variant-numeric: tabular-nums; }
.conto .voce-conto small { display: block; color: var(--tenue); font-size: .74rem; }
.conto .voce-conto.meno strong { color: #ff8a90; }
.conto .voce-conto.uguale { border-bottom: 1px solid rgba(255, 255, 255, .14); border-top: 1px solid rgba(255, 255, 255, .14); margin: 4px 0; padding: 11px 0; }
.conto .voce-conto.uguale span { font-family: var(--titoli); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.conto .voce-conto.uguale strong { font-family: var(--titoli); font-size: 1.25rem; color: var(--oro); }
.conto .voce-conto:last-of-type.uguale { border-bottom: 0; }

/* ---- grafici */
.grafico-guscio { position: relative; }
.grafico-scorri { overflow-x: auto; }
.grafico { width: 100%; min-width: 520px; height: auto; display: block; }
.grafico .griglia-linea { stroke: rgba(255, 255, 255, .06); stroke-dasharray: 3 5; }
.grafico .zero-linea { stroke: rgba(255, 255, 255, .2); }
.grafico .asse { fill: var(--tenue); font-size: 11px; font-family: "Outfit", sans-serif; }
.grafico .barra { transition: opacity .2s; transform-box: fill-box; transform-origin: bottom; animation: cresce .7s cubic-bezier(.2, .8, .2, 1) both; }
.grafico .barra:hover { opacity: .8; }
@keyframes cresce { from { transform: scaleY(0); } }
.s-incasso { fill: #e3202b; background: #e3202b; }
.s-profitto { fill: #f2c46b; background: #f2c46b; }
.s-netto { fill: #3fd27a; background: #3fd27a; }
.s-ore { fill: #f6a8bd; background: #f6a8bd; }
.grafico .barra.negativa { fill: #7a2a30; }
.legenda { display: flex; gap: 16px; margin-bottom: 8px; font-size: .8rem; color: var(--tenue); flex-wrap: wrap; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- cassa */
.categoria { font-family: var(--titoli); margin: 6px 0 10px; color: var(--sakura); font-size: .7rem; text-transform: uppercase; letter-spacing: .22em; display: flex; align-items: center; gap: 10px; }
.categoria::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(246, 168, 189, .25), transparent); }
.prodotti { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; margin-bottom: 18px; }
.prodotto {
    background: linear-gradient(160deg, rgba(42, 18, 25, .9), rgba(17, 8, 11, .9)); border: 1px solid rgba(255, 255, 255, .07); border-radius: 14px; padding: 14px;
    cursor: pointer; text-align: left; transition: border-color .2s, transform .15s, box-shadow .2s; position: relative;
}
.prodotto:hover { border-color: rgba(227, 32, 43, .6); box-shadow: 0 12px 28px -10px rgba(227, 32, 43, .55); transform: translateY(-2px); }
.prodotto:active { transform: scale(.97); }
.prodotto .n { font-weight: 600; }
.prodotto .p { color: var(--oro); font-family: var(--titoli); margin-top: 6px; }
.prodotto .porzioni { font-size: .72rem; color: var(--tenue); margin-top: 4px; }
.prodotto .porzioni.poche { color: var(--giallo); }
.prodotto .q {
    position: absolute; top: -8px; right: -8px; background: linear-gradient(180deg, var(--rosso-vivo), var(--rosso-scuro)); color: #fff;
    font-family: var(--titoli); border-radius: 99px; min-width: 26px; height: 26px; display: grid; place-items: center; font-size: .78rem;
    padding: 0 7px; box-shadow: 0 4px 14px rgba(227, 32, 43, .6); animation: salta .25s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes salta { from { transform: scale(.4); } }
.ordine { background: linear-gradient(180deg, rgba(34, 14, 20, .9), rgba(12, 6, 8, .9)); }
.carrello-riga { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed rgba(255, 255, 255, .08); }
.carrello-riga .n { flex: 1; }
.quantita { display: flex; align-items: center; gap: 7px; }
.quantita button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); cursor: pointer; }
.quantita button:hover { border-color: var(--rosso); }
.totale { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--titoli); font-size: 1.5rem; margin: 16px 0; gap: 12px; flex-wrap: wrap; }
.totale span:last-child { color: #fff; text-shadow: 0 0 18px rgba(227, 32, 43, .5); }

/* ---- finestre */
.velo { position: fixed; inset: 0; background: rgba(4, 2, 3, .7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: compare .2s; }
.finestra {
    background: linear-gradient(180deg, #1a0c11, #0d0709); border: 1px solid rgba(255, 255, 255, .08); border-radius: 20px; width: 100%; max-width: 580px;
    max-height: 90vh; overflow-y: auto; padding: 26px; box-shadow: 0 40px 90px rgba(0, 0, 0, .75), 0 0 0 1px rgba(227, 32, 43, .1);
    position: relative; animation: sale .3s cubic-bezier(.2, .8, .2, 1);
}
.finestra::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--rosso-vivo), var(--oro), transparent); }
.finestra.larga { max-width: 860px; }
.finestra h2 { margin-bottom: 16px; }
@keyframes compare { from { opacity: 0; } }

#avvisi { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 400; max-width: calc(100% - 36px); }
.avviso {
    background: rgba(26, 12, 16, .92); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08); border-left: 4px solid var(--verde);
    padding: 12px 16px; border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); animation: entra .3s cubic-bezier(.2, .8, .2, 1);
}
.avviso.errore { border-left-color: var(--rosso-vivo); }
@keyframes entra { from { opacity: 0; transform: translateX(20px); } }

.lista-semplice { list-style: none; margin: 0; padding: 0; }
.lista-semplice li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bordo); }
.lista-semplice li:last-child { border-bottom: 0; }
.risultati { max-height: 220px; overflow-y: auto; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; margin-bottom: 12px; }
.risultato { display: flex; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer; }
.risultato:hover, .risultato.scelto { background: rgba(227, 32, 43, .12); }

/* ---- fattura e controllo presenza */
.zona-fattura { border: 2px dashed rgba(255, 255, 255, .12); border-radius: 14px; padding: 15px; text-align: center; cursor: pointer; margin-bottom: 12px; transition: border-color .2s, background .2s; }
.zona-fattura:hover { border-color: var(--rosso); background: rgba(227, 32, 43, .05); }
.zona-fattura.obbligatoria { border-color: rgba(246, 168, 189, .45); }
.velo.presenza { background: rgba(6, 2, 3, .86); z-index: 300; }
.velo.presenza .finestra { border-color: var(--rosso); animation: pulsa 1.4s ease-in-out infinite; }
.velo.presenza .orologio { font-family: var(--titoli); font-size: 3.2rem; font-variant-numeric: tabular-nums; margin: 10px 0 18px; color: #fff; text-shadow: 0 0 24px rgba(255, 58, 68, .7); }
.velo.presenza .bottone { font-size: 1.15rem; padding: 14px 36px; }
.velo.presenza .logo { font-size: 3.2rem; }
@keyframes pulsa { 50% { box-shadow: 0 0 0 10px rgba(227, 32, 43, .1), 0 30px 80px rgba(0, 0, 0, .7); } }
.miniatura { width: 48px; height: 36px; object-fit: cover; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .1); cursor: pointer; vertical-align: middle; }
.miniatura:hover { border-color: var(--rosso); }
.salva-fisso { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 18px; z-index: 5; }
.salva-fisso .bottone { padding: 13px 24px; box-shadow: 0 10px 34px rgba(0, 0, 0, .6), 0 6px 24px rgba(227, 32, 43, .35); }
.descrizione { font-size: .8rem; color: var(--tenue); margin: -4px 0 12px; }

/* ---- scheda del timbro: orologio e bottoni puliti */
.timbro .stato { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .04); border: 1px solid var(--bordo2); font-size: .9rem; }
.timbro .stato.acceso { color: #c9f5da; border-color: rgba(63, 210, 122, .35); background: rgba(63, 210, 122, .08); }
.pallino.spento { background: #6b5a60; box-shadow: none; animation: none; }
.timbro .orologio.fermo { color: #4a3a40; text-shadow: none; }
.timbro .bottone { display: inline-flex; align-items: center; gap: 10px; }
.icona-bottone { display: inline-flex; }
