/* Evo Sushi — "Matcha"
   Chiaro, arioso, geometrico. Verdi tenui, righe sottili, molto spazio. */

@font-face {
  font-family: 'Jost';
  src: url('fonts/jost.woff2') format('woff2-variations'), url('fonts/jost.woff2') format('woff2');
  font-weight: 100 900;
  font-display: block;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('fonts/plexmono.woff2') format('woff2');
  font-weight: 400;
  font-display: block;
}

:root {
  --fondo:     #F6F8F3;
  --superficie:#FFFFFF;
  --superficie-2:#F1F5EE;
  --testo:     #1E2620;
  --testo-2:   #5F6E62;
  --testo-3:   #909E92;
  --filo:      #E2E8DE;
  --filo-forte:#CBD5C6;
  --matcha:    #6E9350;
  --matcha-cupo:#3F5A36;
  --matcha-velo:#E8EFE1;
  --salvia:    #A9BCA1;
  --argilla:   #B24F30;
  --argilla-velo:#F7E7E1;
  --ombra:     0 1px 2px rgba(30, 48, 34, .04), 0 12px 30px -22px rgba(30, 48, 34, .3);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo:     #0E1310;
    --superficie:#151B16;
    --superficie-2:#1A211B;
    --testo:     #E3EADF;
    --testo-2:   #9DAA9C;
    --testo-3:   #6F7C70;
    --filo:      #252E26;
    --filo-forte:#374037;
    --matcha:    #9DC77D;
    --matcha-cupo:#B9DA9D;
    --matcha-velo:#1C2A19;
    --salvia:    #6F8768;
    --argilla:   #E58462;
    --argilla-velo:#2A1A15;
    --ombra:     0 1px 2px rgba(0,0,0,.3), 0 12px 30px -22px rgba(0,0,0,.9);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--testo);
  font-family: 'Jost', 'Avenir Next', system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--matcha); outline-offset: 2px; }

/* ---------- struttura ---------- */

.app { display: flex; min-height: 100dvh; }

.rail {
  width: 232px;
  flex: none;
  padding: 34px 26px;
  border-right: 1px solid var(--filo);
  display: flex;
  flex-direction: column;
  gap: 34px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.rail-marchio { display: grid; gap: 2px; }
.rail-punto {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--matcha); display: block; margin-bottom: 16px;
}
.rail-nome { font-size: 1.06rem; font-weight: 500; letter-spacing: .01em; }
.rail-luogo { font-size: .82rem; color: var(--testo-3); letter-spacing: .08em; text-transform: uppercase; }

.rail-nav { display: grid; gap: 2px; }
.rail-voce {
  appearance: none; background: none; border: 0; text-align: left;
  padding: 11px 12px; margin-left: -12px; border-radius: 3px;
  font-size: .98rem; font-weight: 400; color: var(--testo-2); cursor: pointer; min-height: 44px;
}
.rail-voce:hover { background: var(--superficie-2); color: var(--testo); }
.rail-voce[aria-current="true"] { background: var(--matcha-velo); color: var(--matcha-cupo); font-weight: 500; }

.rail-azione { margin-top: auto; }
.rail-piede { margin: 0; font-size: .74rem; line-height: 1.5; color: var(--testo-3); }

.contenuto {
  flex: 1 1 auto;
  min-width: 0;
  padding: 40px clamp(20px, 4vw, 56px) 80px;
}
#view { max-width: 1060px; }

@media (max-width: 900px) {
  .rail { display: none; }
  .contenuto { padding: 24px clamp(16px, 5vw, 28px) 112px; }
}

/* barra in basso, solo su schermi stretti */
.barra-basso { display: none; }
@media (max-width: 900px) {
  .barra-basso {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    background: var(--superficie);
    border-top: 1px solid var(--filo);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .barra-voce {
    appearance: none; background: none; border: 0; padding: 16px 6px; min-height: 58px;
    font-size: .88rem; color: var(--testo-2); cursor: pointer;
  }
  .barra-voce[aria-current="true"] { color: var(--matcha-cupo); font-weight: 500; box-shadow: inset 0 2px 0 var(--matcha); }
  .barra-azione { color: var(--matcha-cupo); font-weight: 500; border-left: 1px solid var(--filo); }
}

/* ---------- testata della vista ---------- */

.testata {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 36px;
}
.testata h1 {
  margin: 0; font-size: clamp(1.45rem, 4.5vw, 2rem); font-weight: 300;
  letter-spacing: -.015em; line-height: 1.15;
}
.testata .sopratitolo {
  margin: 0 0 6px; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--testo-3);
}
.frecce { display: flex; gap: 6px; }

.btn-primario {
  appearance: none; border: 0; background: var(--matcha-cupo); color: #FFF;
  font-size: .92rem; font-weight: 500; letter-spacing: .01em;
  padding: 13px 20px; min-height: 46px; border-radius: 3px; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .btn-primario { background: var(--matcha); color: #101710; } }
.btn-primario:hover { opacity: .9; }

.btn-filo {
  appearance: none; background: var(--superficie); border: 1px solid var(--filo-forte); color: var(--testo);
  font-size: .92rem; padding: 12px 16px; min-height: 46px; min-width: 46px; border-radius: 3px; cursor: pointer;
}
.btn-filo:hover { border-color: var(--matcha); color: var(--matcha-cupo); }

/* ---------- il colpo d'occhio: contatore a tacche ---------- */

.quadro {
  background: var(--superficie);
  border: 1px solid var(--filo);
  border-radius: 4px;
  padding: clamp(22px, 3.4vw, 34px);
  margin-bottom: 18px;
}

.quadro-alto { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 26px 44px; }
.gran-numero { display: flex; align-items: baseline; gap: 12px; }
.gran-numero b {
  font-size: clamp(3.4rem, 11vw, 5rem); font-weight: 300; line-height: .9;
  letter-spacing: -.04em; color: var(--testo);
}
.gran-numero span { font-size: .96rem; color: var(--testo-2); max-width: 7rem; line-height: 1.25; }
.gran-numero.libero b { color: var(--matcha); }
.gran-numero.terzo b { font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 300; color: var(--testo-2); }
.gran-numero.terzo span { font-size: .88rem; }

.divisore-v { width: 1px; align-self: stretch; background: var(--filo); }
@media (max-width: 620px) { .divisore-v { display: none; } .quadro-alto { gap: 18px 34px; } }

/* 60 tacche: una per coperto. Piene quelle prese. */
.tacche {
  margin-top: 30px;
  display: flex; gap: 3px; align-items: flex-end;
  height: 46px;
}
.tacche i {
  flex: 1 1 0; min-width: 2px; height: 100%;
  background: var(--filo); display: block; border-radius: 1px;
}
.tacche i.presa { background: var(--salvia); }
.tacche i.presa.dish { background: var(--matcha); }
.tacche i.confine { background: var(--argilla); }
.tacche-legenda {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 0;
  font-size: .82rem; color: var(--testo-2);
}
.tacche-legenda b { color: var(--testo); font-weight: 500; }

/* il tetto, modificabile */
.tetto-riga {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--filo);
}
.tetto-comando { display: flex; align-items: center; gap: 4px; }
.tetto-comando .btn-filo { padding: 10px 14px; min-height: 42px; font-size: 1.05rem; }
.tetto-num { font-size: 1.35rem; font-weight: 500; min-width: 2.4ch; text-align: center; }
.tetto-testo { flex: 1 1 20rem; margin: 0; font-size: .88rem; line-height: 1.5; color: var(--testo-2); }
.tetto-testo b { color: var(--testo); font-weight: 500; }
.tetto-etichetta { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--testo-3); }

/* ---------- avviso disdetta ---------- */

.disdetta-avviso {
  background: var(--argilla-velo);
  border: 1px solid var(--argilla);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  color: var(--argilla);
}
.disdetta-avviso .capo { font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
.disdetta-avviso .corpo { font-size: 1rem; }
.disdetta-avviso b { font-weight: 600; }

/* ---------- fasce come colonne ---------- */

.fasce-quadro { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--filo); border: 1px solid var(--filo); border-radius: 4px; overflow: hidden; margin-bottom: 40px; }
.fascia-colonna { background: var(--superficie); padding: 20px 18px 18px; }
.fascia-colonna h3 { margin: 0 0 14px; font-size: .84rem; font-weight: 500; letter-spacing: .04em; color: var(--testo-2); white-space: nowrap; }
.fascia-colonna .n { font-size: 2rem; font-weight: 300; line-height: 1; letter-spacing: -.03em; }
.fascia-colonna .n small { font-size: .78rem; font-weight: 400; color: var(--testo-3); margin-left: 6px; letter-spacing: 0; }
.fascia-colonna .asta { margin-top: 14px; height: 3px; background: var(--filo); position: relative; }
.fascia-colonna .asta i { position: absolute; inset: 0 auto 0 0; background: var(--matcha); }
.fascia-colonna.piena .asta i { background: var(--argilla); }
@media (max-width: 720px) {
  .fasce-quadro { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- prenotazioni a schede ---------- */

.gruppo { margin-bottom: 38px; }
.gruppo-titolo {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin: 0 0 16px;
}
.gruppo-titolo h2 { margin: 0; font-size: 1.06rem; font-weight: 500; letter-spacing: .01em; }
.gruppo-titolo span { font-size: .84rem; color: var(--testo-3); }

.schede { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }

.scheda {
  appearance: none; text-align: left; width: 100%;
  background: var(--superficie); border: 1px solid var(--filo); border-radius: 4px;
  padding: 18px 18px 16px; cursor: pointer; color: inherit;
  display: grid; gap: 10px; align-content: start; min-height: 116px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.scheda:hover { border-color: var(--filo-forte); box-shadow: var(--ombra); }
.scheda-alto { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scheda-nome { font-size: 1.06rem; font-weight: 500; line-height: 1.25; }
.scheda-coperti { font-size: 1.5rem; font-weight: 300; line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.scheda-coperti small { font-size: .74rem; color: var(--testo-3); margin-left: 4px; font-weight: 400; }
.scheda-basso { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scheda-codice { font-family: 'Plex Mono', ui-monospace, monospace; font-size: .74rem; color: var(--testo-3); letter-spacing: -.01em; margin-left: auto; }

/* segno del canale: parola minuscola dentro un filo */
.canale {
  font-size: .7rem; letter-spacing: .09em; text-transform: lowercase;
  padding: 3px 8px; border: 1px solid var(--filo-forte); border-radius: 2px; color: var(--testo-2);
}
.canale.dish { border-color: var(--matcha); color: var(--matcha-cupo); background: var(--matcha-velo); }

.stato-segno { font-size: .7rem; letter-spacing: .09em; text-transform: lowercase; padding: 3px 8px; border-radius: 2px; }
.stato-segno.modificata { background: var(--superficie-2); color: var(--testo-2); border: 1px solid var(--filo-forte); }
.stato-segno.cancellata { background: var(--argilla); color: #FFF; }
@media (prefers-color-scheme: dark) { .stato-segno.cancellata { color: #1A100C; } }

.scheda-nota {
  font-size: .88rem; line-height: 1.4; color: var(--testo-2);
  padding-top: 10px; border-top: 1px solid var(--filo);
}
.scheda-nota.allergia { color: var(--argilla); font-weight: 500; }

.scheda.cancellata { background: var(--argilla-velo); border-color: var(--argilla); }
.scheda.cancellata .scheda-nome { text-decoration: line-through; color: var(--argilla); }
.scheda.cancellata .scheda-coperti { color: var(--argilla); text-decoration: line-through; }

/* ---------- serata vuota ---------- */

.vuota {
  background: var(--superficie); border: 1px solid var(--filo); border-radius: 4px;
  padding: clamp(34px, 7vw, 70px) clamp(24px, 5vw, 54px);
  max-width: 40rem;
}
.vuota .cerchio {
  width: 46px; height: 46px; border: 1px solid var(--filo-forte); border-radius: 50%;
  margin-bottom: 24px; position: relative;
}
.vuota .cerchio::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 1px;
  background: var(--filo-forte); transform: translate(-50%, -50%);
}
.vuota h2 { margin: 0 0 12px; font-size: clamp(1.3rem, 4.4vw, 1.7rem); font-weight: 400; letter-spacing: -.01em; line-height: 1.2; }
.vuota p { margin: 0 0 10px; color: var(--testo-2); font-size: 1rem; max-width: 34rem; }
.vuota .btn-primario, .vuota .btn-filo { margin-top: 18px; }

/* ---------- settimana ---------- */

.grafico {
  background: var(--superficie); border: 1px solid var(--filo); border-radius: 4px;
  padding: clamp(22px, 3.4vw, 34px);
  margin-bottom: 22px;
}
.grafico-scorre { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.colonne {
  display: flex; align-items: flex-end; gap: clamp(8px, 1.6vw, 20px);
  height: 210px; min-width: 32rem; position: relative;
  border-bottom: 1px solid var(--filo-forte);
}
.linea-tetto {
  position: absolute; left: 0; right: 0; height: 1px; background: var(--argilla); opacity: .7;
}
.linea-tetto span {
  position: absolute; right: 0; top: -20px; font-size: .72rem; color: var(--argilla); letter-spacing: .06em;
}
.colonna { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; cursor: pointer; background: none; border: 0; padding: 0; color: inherit; }
.colonna .valore { font-size: .86rem; color: var(--testo-2); margin-bottom: 7px; text-align: center; }
.colonna .barra { background: var(--salvia); border-radius: 2px 2px 0 0; min-height: 2px; transition: background .14s ease; }
.colonna:hover .barra { background: var(--matcha); }
.colonna.oggi .barra { background: var(--matcha); }
.colonna.chiuso .barra { background: repeating-linear-gradient(45deg, var(--filo), var(--filo) 3px, transparent 3px, transparent 6px); border: 1px solid var(--filo); height: 12px !important; }
.giorni-etichette { display: flex; gap: clamp(8px, 1.6vw, 20px); min-width: 32rem; margin-top: 10px; }
.giorni-etichette span { flex: 1 1 0; text-align: center; font-size: .8rem; color: var(--testo-3); }
.giorni-etichette span.oggi { color: var(--matcha-cupo); font-weight: 500; }

.nota-vera {
  font-size: .9rem; color: var(--testo-2); line-height: 1.55; max-width: 46rem;
  background: var(--superficie-2); border-radius: 4px; padding: 18px 20px;
}
.nota-vera b { color: var(--testo); font-weight: 500; }

/* ---------- pannello laterale ---------- */

.foglio { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end; }
.foglio[hidden] { display: none; }
.foglio-velo { position: absolute; inset: 0; background: rgba(24, 34, 27, .34); }
@media (prefers-color-scheme: dark) { .foglio-velo { background: rgba(0, 0, 0, .6); } }

.pannello {
  position: relative;
  width: min(30rem, 100%);
  height: 100dvh;
  overflow-y: auto;
  background: var(--superficie);
  border-left: 1px solid var(--filo);
  padding: clamp(26px, 4vw, 38px) clamp(22px, 4vw, 34px) 40px;
}
@media (max-width: 620px) {
  .foglio { align-items: flex-end; justify-content: stretch; }
  .pannello {
    width: 100%; height: auto; max-height: 92dvh;
    border-left: 0; border-top: 1px solid var(--filo); border-radius: 8px 8px 0 0;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

.pannello-testa { margin-bottom: 26px; }
.pannello-testa .sopratitolo { margin: 0 0 8px; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--testo-3); }
.pannello-testa h2 { margin: 0; font-size: clamp(1.4rem, 5vw, 1.85rem); font-weight: 400; letter-spacing: -.015em; line-height: 1.15; }
.pannello-testa h2.cancellata { color: var(--argilla); text-decoration: line-through; }

.voci { margin: 0; display: grid; }
.voci > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 4px 16px; padding: 13px 0; border-bottom: 1px solid var(--filo); }
.voci dt { font-size: .8rem; color: var(--testo-3); }
.voci dd { margin: 0; font-size: 1rem; }
.voci dd.mono { font-family: 'Plex Mono', ui-monospace, monospace; font-size: .92rem; }
.voci dd.assente { color: var(--testo-3); font-size: .94rem; }
@media (max-width: 440px) { .voci > div { grid-template-columns: 1fr; } }

.commento {
  margin-top: 20px; padding: 18px 20px; border-radius: 4px;
  background: var(--matcha-velo); font-size: 1.02rem; line-height: 1.45;
}
.commento .capo { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--testo-3); margin-bottom: 8px; }
.commento.allergia { background: var(--argilla-velo); color: var(--argilla); }
.commento.allergia .capo { color: var(--argilla); }

.pannello-nota { margin-top: 20px; font-size: .86rem; line-height: 1.5; color: var(--testo-3); }

.pannello-azioni { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pannello-azioni > * { flex: 1 1 auto; }

/* modulo */
.gruppo-campo { margin-bottom: 24px; }
.gruppo-campo > label, .gruppo-campo > .etichetta {
  display: block; margin-bottom: 10px; font-size: .8rem; color: var(--testo-2);
}
.gruppo-campo input {
  width: 100%; padding: 13px 14px; min-height: 50px;
  background: var(--fondo); border: 1px solid var(--filo-forte); border-radius: 3px;
  font-family: inherit; font-size: 1.02rem; color: var(--testo);
}
.gruppo-campo input::placeholder { color: var(--testo-3); }
.gruppo-campo input:focus { border-color: var(--matcha); }

.pillole { display: flex; flex-wrap: wrap; gap: 7px; }
.pillola {
  appearance: none; background: var(--fondo); border: 1px solid var(--filo-forte); color: var(--testo);
  font-size: 1rem; padding: 12px 16px; min-width: 52px; min-height: 50px; border-radius: 3px; cursor: pointer;
}
.pillola[aria-pressed="true"] { background: var(--matcha-cupo); border-color: var(--matcha-cupo); color: #FFF; }
@media (prefers-color-scheme: dark) { .pillola[aria-pressed="true"] { background: var(--matcha); border-color: var(--matcha); color: #101710; } }
.pillole.larghe .pillola { flex: 1 1 44%; font-size: .96rem; }

@media (prefers-reduced-motion: no-preference) {
  .pannello { animation: entra .2s cubic-bezier(.2, .7, .3, 1); }
  @keyframes entra { from { transform: translateX(16px); opacity: 0; } }
  @media (max-width: 620px) { @keyframes entra { from { transform: translateY(20px); opacity: 0; } } }
}
