/* Stili delle viste del gestionale. */

/* Oggi --------------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--hairline); text-decoration: none; color: inherit;
  transition: transform .25s var(--spring), box-shadow .25s var(--ease); }
a.stat:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.stat span { font-size: var(--t-sm); color: var(--muted); font-weight: 560; display: flex; align-items: center; gap: 6px; }
.stat span svg { width: 15px; height: 15px; }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat small { color: var(--muted); font-size: var(--t-xs); }
.stat.is-alert b { color: var(--bad); }
@media (max-width: 1080px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.adesso { padding: 22px 24px; display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: end; min-height: 230px; cursor: pointer; border: 0; text-align: left; width: 100%; font: inherit;
  transition: transform .3s var(--spring), box-shadow .3s var(--ease); box-shadow: 0 18px 40px -18px rgb(150 10 20 / .55); }
.adesso:hover { transform: translateY(-2px); box-shadow: 0 24px 50px -18px rgb(150 10 20 / .6); }
.adesso:active { transform: scale(.99); }
.adesso__top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; align-self: start; }
.adesso__top .live { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: #fff; color: #A0141E; font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.adesso__top .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.adesso__ora { font-size: clamp(56px, 6vw, 84px); }
.adesso__ora small { font-family: var(--font-ui); font-size: 18px; font-weight: 500; margin-left: 10px; letter-spacing: -.01em; }
.adesso__chi { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; font-size: var(--t-md); }
.facce { display: flex; }
.facce .avatar { width: 32px; height: 32px; font-size: 11px; letter-spacing: 0; background: rgb(255 255 255 / .24); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 0 0 1.5px rgb(255 255 255 / .55); }
.facce .avatar + .avatar { margin-left: -6px; }
.adesso__side { display: grid; justify-items: end; gap: 10px; }
.adesso__vuota { padding: 26px 24px; min-height: 180px; display: grid; align-content: end; gap: 6px; }
.adesso__vuota .hero__big { font-size: 40px; }

.timeline { list-style: none; margin: 0; padding: 6px 0; position: relative; }
.timeline > li { display: grid; grid-template-columns: 62px 18px 1fr; gap: 0 12px; padding: 0 var(--s5); position: relative; }
.timeline__ora { padding-top: 13px; text-align: right; }
.timeline__ora b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.timeline__ora small { color: var(--muted); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.timeline__asse { position: relative; }
.timeline__asse::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); border-radius: 2px; }
.timeline > li:first-child .timeline__asse::before { top: 18px; }
.timeline > li:last-child .timeline__asse::before { bottom: calc(100% - 18px); }
.timeline__asse i { position: absolute; left: 2px; top: 16px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 3px var(--gc); }
.timeline > li.is-past .timeline__asse i { background: var(--gc); box-shadow: none; opacity: .5; }
.timeline > li.is-now .timeline__asse i { background: var(--gc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gc) 25%, transparent); }
.timeline__card { margin: 6px 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gc) 7%, var(--surface)); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--gc) 16%, var(--line));
  display: grid; gap: 8px; cursor: pointer; transition: transform .25s var(--spring), box-shadow .2s var(--ease); text-align: left; border: 0; font: inherit; color: inherit; width: 100%; }
.timeline__card:hover { box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--gc) 40%, var(--line)), var(--shadow-lift); transform: translateY(-1px); }
.timeline > li.is-past .timeline__card { opacity: .62; }
.timeline > li.is-off .timeline__card { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--sunken-2) 8px 16px); }
.timeline__testa { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline__testa .grow { flex: 1; }

.inbox > li { --sep-left: 62px; }
.inbox .tile { width: 32px; height: 32px; border-radius: 9px; }
.inbox .grow b { font-weight: 560; }

/* Riga di una lezione */
.ora-blocco { display: grid; justify-items: center; width: 60px; padding: 7px 0; border-radius: 12px; text-decoration: none; border: 0; color: inherit; font: inherit;
  background: color-mix(in srgb, var(--gc) 12%, var(--surface)); }
.ora-blocco b { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.1; }
.ora-blocco small { color: var(--muted); font-size: 11.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-allievo { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 .5px var(--line); font-size: 12.5px; font-weight: 560; text-decoration: none; color: var(--ink-2); }
.chip-allievo:hover { color: var(--brand); }
.chip-allievo em { font-style: normal; font-weight: 650; color: var(--info); font-size: 11.5px; }
.chip-allievo svg { width: 13px; height: 13px; color: var(--warn); }
.chip-allievo.has-flag { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.chip-allievo.is-off { text-decoration: line-through; color: var(--faint); background: transparent; }

/* Agenda: settimana a colonne --------------------------------------------------------- */
.week { overflow-x: auto; }
.week__head, .week__body { display: grid; grid-template-columns: 60px repeat(var(--cols), minmax(120px, 1fr)); min-width: calc(60px + var(--cols) * 120px); }
.week__head { border-bottom: .5px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--surface); border-radius: var(--r-panel) var(--r-panel) 0 0; }
.week__day { display: flex; align-items: baseline; gap: 8px; padding: 12px 12px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--muted); }
.week__day span { font-size: 12.5px; font-weight: 600; }
.week__day b { font-family: var(--font-title); font-weight: 500; font-size: 22px; color: var(--ink); line-height: 1; min-width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; }
.week__day:hover b { background: var(--sunken-2); }
.week__day.is-today span { color: var(--brand); }
.week__day.is-today b { background: var(--brand); color: #fff; font-weight: 650; }
.week__body { position: relative; height: calc(var(--ore) * 64px + 12px); }
.week__axis { position: relative; }
.week__axis span { position: absolute; right: 10px; translate: 0 -50%; margin-top: 6px; font-size: 11px; color: var(--faint); font-weight: 600; }
.week__col { position: relative; border-left: .5px solid var(--line); margin-top: 6px;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 .5px, transparent .5px 64px); }
.week__col.is-today { background-color: color-mix(in srgb, var(--brand) 3%, transparent); }
.week__lez {
  position: absolute; display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 0 6px; padding: 7px 9px 7px 11px;
  border-radius: 8px; border: 0; background: color-mix(in srgb, var(--gc) 16%, var(--surface));
  text-align: left; cursor: pointer; overflow: hidden; color: var(--ink); transition: box-shadow .15s var(--ease), transform .2s var(--spring);
}
.week__lez::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gc); }
.week__lez:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); z-index: 2; }
.week__lez .t { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.week__lez b { grid-column: 1; font-size: 13.5px; font-weight: 650; }
.week__lez .c { grid-column: 2; grid-row: 1 / span 2; align-self: start; font-size: 11.5px; font-weight: 700; color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.week__lez .c.is-full { color: var(--warn); }
.week__lez .c svg { width: 13px; height: 13px; }
.week__lez.is-past { opacity: .55; }
.week__lez.is-off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--sunken-2) 8px 16px); }
.week__lez.is-off b { text-decoration: line-through; color: var(--muted); }
.week__lez.is-off .c { color: var(--bad); }
.week__now { position: absolute; left: 0; right: 0; border-top: 1.5px solid var(--brand); z-index: 3; pointer-events: none; }
.week__now::before { content: ""; position: absolute; left: -5px; top: -5.5px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }

/* Allievi ------------------------------------------------------------------------ */
.selbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 10px 8px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 90%, transparent); color: var(--canvas); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  position: sticky; top: calc(var(--topbar) + 10px); z-index: 5; box-shadow: var(--shadow-pop); animation: toast .4s var(--spring); }
.selbar[hidden] { display: none; }
.selbar .select { background-color: var(--surface); color: var(--ink); height: 30px; width: auto; }
.selbar .btn--quiet { color: var(--canvas); }
.selbar .btn--quiet:hover { background: color-mix(in srgb, var(--canvas) 15%, transparent); }

/* Scheda allievo ---------------------------------------------------------------- */
.scheda-head { display: flex; align-items: center; gap: 20px; }
.scheda-head .grow { flex: 1; min-width: 0; }
.scheda-head h1 { font-size: var(--t-display); font-weight: 750; line-height: 1.05; letter-spacing: -.03em; }
.scheda-head__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); font-size: var(--t-md); }
.scheda-head__meta .sep { width: .5px; height: 16px; background: var(--line-strong); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.form-actions .field-error { margin-right: auto; }
.riga-contatto { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; }
.genitore { border: 0; border-radius: 14px; padding: 14px 16px 16px; margin: 0; min-width: 0; background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--line); }
.genitore legend { font-weight: 650; font-size: var(--t-md); padding: 0; float: left; width: 100%; margin-bottom: 10px; }
/* Safari affianca i campi al titolo flottante e li schiaccia: devono partire sotto. */
.genitore legend + * { clear: both; }
.genitore legend small { font-weight: 500; color: var(--muted); }
.linkbox { display: flex; gap: 10px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--sunken-2); box-shadow: inset 0 0 0 .5px var(--line); }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink-2); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.zona { box-shadow: inset 0 0 0 .5px var(--line); background: transparent; }
@media (max-width: 720px) {
  .riga-contatto { grid-template-columns: 1fr 1fr; }
  /* Oggi: la prossima lezione in una colonna, con il pulsante a tutta larghezza sotto il pollice */
  .adesso { grid-template-columns: 1fr; padding: 20px; min-height: 0; gap: 16px; }
  .adesso__ora { font-size: 64px; }
  .adesso__ora small { font-size: 17px; margin-left: 8px; white-space: nowrap; }
  .adesso__side { justify-items: stretch; }
  .adesso__side .btn { justify-content: center; height: 46px; }
}

/* Comunicazioni ------------------------------------------------------------------- */
.scelta-famiglie { max-height: 260px; overflow-y: auto; border-radius: 12px; padding: 4px; display: grid; gap: 1px; margin-top: 8px; background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--line); }
.scelta-famiglie .check { padding: 8px 10px; border-radius: 8px; align-items: flex-start; }
.scelta-famiglie .check:hover { background: var(--sunken-2); }
.scelta-famiglie .check[hidden] { display: none; }
.scelta-famiglie small { display: block; color: var(--muted); font-size: 12px; }
.notifica-prev { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: start; margin-top: 8px; padding: 12px 14px; border-radius: 22px; max-width: 420px;
  background: var(--material-thick); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); box-shadow: var(--shadow-lift); }
.notifica-prev img { width: 38px; height: 38px; border-radius: 9px; }
.notifica-prev b { font-size: 14px; font-weight: 650; }
.notifica-prev p { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notifica-prev small { color: var(--muted); font-size: 12px; }
.anteprima-telefono { padding: 22px 18px; border-radius: 22px; margin-top: 8px;
  background: radial-gradient(120% 140% at 0% 0%, #EE6A71, #C21F2B 45%, #5E0A12); }

/* Impostazioni ---------------------------------------------------------------------- */
.gruppo-card { position: relative; overflow: hidden; }
.gruppo-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--gc); }
.gruppo-card__nome { font-family: var(--font-display); font-weight: 400; font-size: 30px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.gruppo-card__nome::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--gc); }
.settimana-tipo { display: grid; grid-template-columns: repeat(var(--cols), minmax(140px, 1fr)); overflow-x: auto; }
.settimana-tipo__giorno { padding: 14px 12px; border-left: .5px solid var(--line); display: grid; gap: 8px; align-content: start; }
.settimana-tipo__giorno:first-child { border-left: 0; }
.settimana-tipo__giorno h3 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.orario-chip { display: grid; text-align: left; gap: 1px; padding: 9px 12px 9px 14px; border-radius: 10px; cursor: pointer; position: relative; overflow: hidden; border: 0; color: var(--ink);
  background: color-mix(in srgb, var(--gc) 14%, var(--surface)); transition: box-shadow .15s, transform .2s var(--spring); }
.orario-chip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gc); }
.orario-chip b { font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.orario-chip span { font-weight: 650; font-size: 13px; }
.orario-chip small { color: var(--muted); font-size: 12px; }
.orario-chip:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.orario-add { height: 38px; border: 0; border-radius: 10px; background: var(--sunken-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.orario-add:hover { color: var(--brand); background: var(--brand-soft); }
.orario-add svg { width: 18px; height: 18px; }

/* Import ---------------------------------------------------------------------------- */
.passi { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; counter-reset: passo; flex-wrap: wrap; }
.passi li { counter-increment: passo; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--sunken-2); color: var(--muted); font-weight: 590; font-size: 14px; }
.passi li::before { content: counter(passo); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 12px; font-weight: 700; }
.passi li.attivo { background: var(--brand-soft); color: var(--ink); }
.passi li.attivo::before { background: var(--brand); color: #fff; }
.passi li.fatto { color: var(--ok); }
.passi li.fatto::before { content: "✓"; background: var(--ok-soft); }
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; border: 1.5px dashed var(--line-strong); border-radius: 16px; cursor: pointer; text-align: center; transition: background .2s, border-color .2s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--brand); }
.dropzone small { color: var(--muted); }

/* Agenda: mese ------------------------------------------------------------------------ */
.month__head, .month__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month__head span { padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: right; border-bottom: .5px solid var(--line); }
.month__day { min-height: 118px; padding: 6px; border-right: .5px solid var(--line); border-bottom: .5px solid var(--line); display: grid; align-content: start; gap: 3px; min-width: 0; }
.month__day:nth-child(7n) { border-right: 0; }
.month__day.is-out { background: var(--surface-2); }
.month__day.is-out .month__num { color: var(--faint); }
.month__num { justify-self: end; border: 0; background: none; cursor: pointer; font-family: var(--font-title); font-weight: 500; font-size: 15px; min-width: 28px; height: 28px; border-radius: 50%; color: var(--ink); }
.month__num:hover { background: var(--sunken-2); }
.month__day.is-today .month__num { background: var(--brand); color: #fff; font-weight: 700; }
.month__lez { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; padding: 3px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); background: color-mix(in srgb, var(--gc) 16%, var(--surface)); }
.month__lez small { color: var(--muted); font-weight: 600; }
.month__lez.is-off { text-decoration: line-through; color: var(--muted); }

/* Istruttrici (impostazioni) */
.istr-card { display: grid; gap: 14px; }
.istr-card__head { display: flex; align-items: center; gap: 14px; }
.istr-card__head .grow { flex: 1; min-width: 0; }
.istr-card__head h3 { font-size: var(--t-lg); }
