/* Palette del sito asiloconiugigola.edu.it */
:root {
  --giallo: #fec624;
  --giallo-chiaro: #ffe08a;
  --titolo: #25283e;
  --blu-2: #3a3f63;
  --testo: #5b5a7b;
  --fondo: #f4f2ec;
  --bianco: #ffffff;
  --verde: #3aa655;
  --rosso: #e05252;
  --ambra: #e8a200;
  --teal: #14919b;
  --viola: #7a5cc4;
  --bordo: #e7e3d8;
  --ombra: 0 6px 20px rgba(37, 40, 62, .10);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--fondo); color: var(--testo);
  font-family: "Quicksand", -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 4.5rem;
  background-image: radial-gradient(rgba(254, 198, 36, .10) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}
h1 { color: var(--titolo); }

/* ---- login ---- */
.login-body, .menu-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.login-card {
  background: var(--bianco); border-radius: 24px; padding: 2rem;
  width: min(340px, 92vw); text-align: center; box-shadow: var(--ombra);
  border-top: 6px solid var(--giallo);
}
.login-card .logo { width: 110px; }
.login-card h1 { font-size: 1.25rem; }
.login-card input {
  width: 100%; padding: .8rem; font-size: 1.5rem; text-align: center;
  border: 2px solid var(--bordo); border-radius: 14px; letter-spacing: .3em;
  font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--giallo); }
.login-card button {
  width: 100%; margin-top: 1rem; padding: .9rem; font-size: 1.1rem;
  background: var(--giallo); color: var(--titolo); font-weight: 700;
  border: none; border-radius: 14px; cursor: pointer; font-family: inherit;
  box-shadow: 0 3px 0 #d9a505;
}
.login-card button:active { transform: translateY(2px); box-shadow: none; }
.errore { color: var(--rosso); margin: .5rem 0 0; font-weight: 700; }

/* ---- menu principale ---- */
.menu { width: min(440px, 94vw); text-align: center; }
.menu .logo { width: 130px; filter: drop-shadow(0 4px 8px rgba(37,40,62,.15)); }
.menu h1 { margin: .4rem 0 0; font-size: 1.5rem; }
.menu .sotto { margin: .2rem 0 1.4rem; }
.tile {
  display: flex; align-items: center; gap: 1rem; text-align: left;
  background: var(--bianco); border-radius: 20px; padding: 1.1rem 1.2rem;
  margin-bottom: .9rem; text-decoration: none; color: var(--testo);
  box-shadow: var(--ombra); border: 2px solid transparent;
  transition: transform .1s, border-color .1s;
}
a.tile:hover, a.tile:active { transform: translateY(-2px); border-color: var(--giallo); }
.tile-emoji {
  font-size: 1.8rem; background: var(--fondo); border-radius: 16px;
  width: 58px; height: 58px; display: grid; place-items: center; flex: none;
}
.tile-testo { flex: 1; }
.tile-testo strong { display: block; color: var(--titolo); font-size: 1.1rem; }
.tile-testo small { font-size: .85rem; }
.tile-freccia { font-size: 1.6rem; color: var(--giallo); font-weight: 700; }
.tile-off { opacity: .55; }

/* ---- testata ---- */
header {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(135deg, var(--titolo), var(--blu-2));
  color: var(--bianco);
  display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem;
  box-shadow: 0 2px 12px rgba(37, 40, 62, .25);
}
.logo-mini {
  width: 40px; height: 40px; object-fit: contain;
  background: var(--bianco); border-radius: 50%; padding: 3px;
  border: 2px solid var(--giallo);
}
.data-nav { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.data-titolo { text-align: center; line-height: 1.2; }
.data-titolo strong { display: block; font-size: 1.05rem; text-transform: capitalize; }
.vai-oggi { color: var(--giallo); font-size: .8rem; font-weight: 700; }
.freccia {
  color: var(--titolo); background: var(--giallo); text-decoration: none;
  font-size: 1.5rem; font-weight: 700; border-radius: 12px;
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  box-shadow: 0 2px 0 #d9a505;
}
.freccia.off { visibility: hidden; }

.avviso.chiuso {
  margin: 2.5rem auto; max-width: 480px; text-align: center;
  background: var(--bianco); border: 2px dashed var(--giallo);
  border-radius: 18px; padding: 2rem 1.5rem; font-size: 1.15rem;
  color: var(--titolo); font-weight: 700; box-shadow: var(--ombra);
}

/* ---- schede bambini ---- */
main { max-width: 680px; margin: 1rem auto; padding: 0 .7rem; }
.bimbo {
  background: var(--bianco); border-radius: 18px; padding: .85rem .95rem;
  margin-bottom: .85rem; box-shadow: var(--ombra);
  border-left: 6px solid var(--bordo); transition: border-color .25s;
}
.bimbo.sel-x    { border-left-color: var(--verde); }
.bimbo.sel-sp   { border-left-color: var(--ambra); }
.bimbo.sel-a    { border-left-color: var(--rosso); }
.bimbo.sel-xds  { border-left-color: var(--teal); }
.bimbo.sel-spds { border-left-color: var(--viola); }
.testa { display: flex; align-items: center; gap: .6rem; margin-bottom: .65rem; }
.nome { color: var(--titolo); font-weight: 700; font-size: 1.08rem; flex: 1; }
.bimbo.full .nome, .viola-txt { color: var(--viola); }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  color: var(--bianco); text-transform: uppercase;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.av0 { background: #f2a35c; } .av1 { background: #5ca9d6; } .av2 { background: #d66a8f; }
.av3 { background: #6cbf84; } .av4 { background: #9a83d0; } .av5 { background: #d6b25c; }
.legenda {
  font-size: .82rem; margin: 0 .2rem .8rem; text-align: center;
  background: rgba(122, 92, 196, .08); border-radius: 12px; padding: .5rem .8rem;
}
.progress {
  position: sticky; top: 56px; z-index: 4; height: 5px;
  background: rgba(37, 40, 62, .12);
}
.progress div {
  height: 100%; background: linear-gradient(90deg, var(--giallo), var(--verde));
  border-radius: 0 4px 4px 0; transition: width .35s ease;
}

.codici { display: grid; gap: .45rem; }
.codici.tre    { grid-template-columns: repeat(3, 1fr); }
.codici.cinque { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 560px) {
  .codici.cinque { grid-template-columns: repeat(3, 1fr); }
}
.cod {
  min-height: 80px; cursor: pointer; position: relative;
  border: 2px solid var(--bordo); border-radius: 16px; background: var(--bianco);
  color: var(--titolo); font-family: inherit; padding: .5rem .3rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .18rem;
  transition: transform .08s, opacity .2s, box-shadow .2s;
  box-shadow: 0 2px 0 var(--bordo);
}
.cod:active { transform: scale(.95); }
.scelto .cod:not(.attivo) { opacity: .55; }
.cod.attivo::before {
  content: "✓"; position: absolute; top: -8px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bianco); color: inherit; border: 2px solid currentColor;
  font-size: .8rem; font-weight: 700; display: grid; place-items: center;
}
.cod .emo { font-size: 1.35rem; line-height: 1; }
.cod .lbl { font-weight: 700; font-size: .78rem; line-height: 1.15; text-align: center; }
.cod.attivo {
  color: var(--bianco); transform: scale(1.03);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 4px 12px rgba(37, 40, 62, .18);
}
.cod.attivo::before { color: var(--titolo); }
.cod.attivo .lbl { color: var(--bianco); }
.cod-x.attivo    { background: var(--verde); border-color: var(--verde); }
.cod-sp.attivo   { background: var(--ambra); border-color: var(--ambra); }
.cod-a.attivo    { background: var(--rosso); border-color: var(--rosso); }
.cod-xds.attivo  { background: var(--teal);  border-color: var(--teal); }
.cod-spds.attivo { background: var(--viola); border-color: var(--viola); }
.cod:disabled { opacity: .5; }

footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bianco); border-top: 3px solid var(--giallo);
  padding: .75rem; text-align: center; font-size: 1rem;
  box-shadow: 0 -4px 16px rgba(37, 40, 62, .08);
}
footer b { color: var(--titolo); font-size: 1.1rem; }

/* ---- riepilogo mese ---- */
.mese-main { max-width: 1240px; }
.tabella-scroll {
  overflow-x: auto; background: var(--bianco); border-radius: 18px;
  box-shadow: var(--ombra); padding: .3rem;
}
.mese-tab { border-collapse: collapse; width: 100%; font-size: .88rem; }
.mese-tab th, .mese-tab td { padding: .5rem .45rem; text-align: right; white-space: nowrap; }
.mese-tab th { white-space: normal; }
.mese-tab th {
  background: var(--titolo); color: var(--bianco); font-weight: 700;
  position: sticky; top: 0; font-size: .75rem; line-height: 1.2;
}
.mese-tab thead tr th:first-child { border-radius: 12px 0 0 0; }
.mese-tab thead tr th:last-child { border-radius: 0 12px 0 0; }
.mese-tab .sx { text-align: left; }
.mese-tab tbody td.sx { color: var(--titolo); font-weight: 700; }
.mese-tab tbody tr:nth-child(even) { background: var(--fondo); }
.mese-tab .evid { background: var(--giallo-chiaro); color: var(--titolo); font-weight: 700; }
.mese-tab th.evid { background: var(--giallo); color: var(--titolo); }
.mese-tab tfoot td { border-top: 3px solid var(--giallo); font-weight: 700; color: var(--titolo); }
.mese-tab .prec { background: #ecebe4; color: #6d6c60; }
.mese-tab th.prec { background: var(--blu-2); }
.nota { font-size: .82rem; margin: .8rem .3rem; }
.mese-tab tbody td.sx.viola-txt { color: var(--viola); }

/* ---- logout e admin ---- */
.logout {
  position: fixed; top: .9rem; right: .9rem; z-index: 6;
  background: var(--bianco); color: var(--testo); text-decoration: none;
  border: 2px solid var(--bordo); border-radius: 99px;
  padding: .35rem .9rem; font-size: .85rem; font-weight: 700;
  box-shadow: var(--ombra);
}
.logout:hover { border-color: var(--rosso); color: var(--rosso); }
.tile-admin { border: 2px dashed var(--giallo); }

/* ---- pagamenti ---- */
.pill {
  display: inline-block; padding: .18rem .6rem; border-radius: 99px;
  font-size: .75rem; font-weight: 700; color: var(--bianco); white-space: nowrap;
}
.pill-ok   { background: var(--verde); }
.pill-warn { background: var(--ambra); }
.pill-no   { background: var(--rosso); }
.flash-ok {
  background: rgba(58, 166, 85, .12); border: 2px solid var(--verde);
  border-radius: 12px; padding: .7rem 1rem; font-weight: 700; color: var(--titolo);
}
.btn-giallo, .btn-grigio {
  font-family: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  border: none; border-radius: 12px; padding: .7rem 1.2rem; color: var(--titolo);
}
.btn-giallo { background: var(--giallo); box-shadow: 0 3px 0 #d9a505; }
.btn-grigio { background: var(--fondo); border: 2px solid var(--bordo); }
.btn-grande { width: 100%; margin-top: 1rem; padding: 1rem; font-size: 1.05rem; }
.riga-azioni { margin: .8rem 0; }
.upload-box {
  background: var(--bianco); border-radius: 18px; padding: 1.2rem 1.4rem;
  margin-top: 1.4rem; box-shadow: var(--ombra);
}
.upload-box h2 { color: var(--titolo); font-size: 1.1rem; margin: 0 0 .4rem; }
.upload-box input[type=file] { font-family: inherit; margin: .5rem 0; display: block; }

/* ---- proposte di abbinamento ---- */
.proposta {
  display: flex; gap: .8rem; align-items: flex-start; cursor: pointer;
  background: var(--bianco); border-radius: 14px; border-left: 6px solid var(--verde);
  padding: .8rem 1rem; margin-bottom: .6rem; box-shadow: var(--ombra);
}
.proposta.dubbia { border-left-color: var(--ambra); }
.proposta input { width: 22px; height: 22px; margin-top: .2rem; flex: none; }
.p-corpo { flex: 1; }
.p-riga1 { display: block; color: var(--titolo); }
.p-causale { display: block; font-size: .8rem; margin-top: .2rem; overflow-wrap: anywhere; }
.p-nota { display: block; font-size: .8rem; color: var(--ambra); font-weight: 700; margin-top: .2rem; }
