/* ===== "Chiudi la giornata" interattiva: ricreazione della pagina dell'ufficio (jckite: conferme.css, mio_lavoro.css, inventario.css) =====
   Stessi colori e misure del gestionale. Prefisso .ch- */
.ch { --ch-navy: #163459; --ch-muted: #5d6e86; --ch-text-2: #2f4566; --ch-text-3: #4f6280; --ch-border: #d9edf6; --ch-soft: #e7f8fd; --ch-ink: #0a7299;
    --ch-grey-soft: #f2f4f7; --ch-grey-bg: #f7fafc; --ch-segment: #edf2f7; --ch-pos: #10b981; --ch-pos-ink: #027a48; --ch-warn: #f59e0b; --ch-warn-ink: #b45309;
    --ch-neg-ink: #b42318;
    position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; background: #fcfcfc; color: var(--ch-navy);
    font: 400 14px/1.4 var(--sans); }
.ch svg { width: 1em; height: 1em; fill: currentColor; flex: 0 0 auto; }
.ch-testa { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ch-titolo { margin: 0 0 2px; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.ch-sotto { margin: 0; font-size: 13.5px; color: var(--ch-muted); }

/* KPI: come le schede in alto dell'app, cliccabili (filtrano) */
.ch-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ch-kpi { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-width: 0; text-align: left; cursor: pointer; font: inherit; color: inherit;
    background: #fff; border: 1px solid var(--ch-border); border-radius: 12px; box-shadow: 0 1px 2px rgba(22, 52, 89, .05), 0 4px 14px rgba(22, 52, 89, .06);
    transition: transform .15s, box-shadow .15s, border-color .15s; }
.ch-kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(22, 52, 89, .1); }
.ch-kpi.is-on { border-color: var(--lp-azzurro); }
.ch-kpi-ico { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--ch-soft); color: var(--ch-ink); }
.ch-kpi.is-warn .ch-kpi-ico { background: #fffbeb; color: var(--ch-warn-ink); }
.ch-kpi.is-pos .ch-kpi-ico { background: #ecfdf5; color: var(--ch-pos-ink); }
.ch-kpi-txt { display: flex; flex-direction: column; min-width: 0; }
.ch-kpi-txt small { font-size: 11.5px; color: var(--ch-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-kpi-txt b { font-size: 16.5px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ch-kpi-txt em { font-style: normal; font-size: 11.5px; color: var(--ch-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }

/* barra: segmenti + conferma tutte */
.ch-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ch-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--ch-segment); border-radius: 12px; }
.ch-seg-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ch-muted);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.ch-seg-btn:hover { color: var(--ch-navy); }
.ch-seg-btn.is-active { background: #fff; color: var(--ch-navy); box-shadow: 0 1px 3px rgba(22, 52, 89, .12); }
.ch-seg-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; background: rgba(102, 112, 133, .14); font-variant-numeric: tabular-nums; }
.ch-seg-btn.is-active .ch-seg-n { background: var(--lp-azzurro); color: #fff; }
.ch-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--ch-border); background: #fff; color: var(--ch-navy); transition: background .15s, box-shadow .15s, transform .05s; }
.ch-btn:hover { background: var(--ch-grey-bg); }
.ch-btn:active { transform: translateY(1px); }
.ch-btn.is-primary { background: var(--lp-azzurro); border-color: var(--lp-azzurro); color: #fff; box-shadow: 0 4px 12px rgba(7, 188, 231, .28); }
.ch-btn.is-primary:hover { background: var(--lp-azzurro-hover); }
.ch-btn[hidden] { display: none; }

/* riepilogo della giornata e dei gruppi */
.ch-riep-giorno { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--ch-soft); border: 1px solid var(--lp-azzurrino); }
.ch-riep-giorno > b { font-size: 14px; }
.ch-riep { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ch-riep-ore { display: flex; flex-direction: column; line-height: 1.1; }
.ch-riep-ore small { font-size: 10.5px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: .02em; }
.ch-riep-ore b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ch-riep.is-grande .ch-riep-ore b { font-size: 18px; }
.ch-diff { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ch-grey-soft); color: var(--ch-text-3); }
.ch-diff.is-ok { background: #ecfdf3; color: var(--ch-pos-ink); }
.ch-diff.is-warn { background: #fff1d6; color: var(--ch-warn-ink); }
.ch-diff.is-grigio { background: var(--ch-grey-soft); color: var(--ch-muted); }

.ch-gruppi { display: flex; flex-direction: column; gap: 14px; min-height: 60px; }
.ch-gruppi.is-vuoto::after { content: attr(data-vuoto); font-size: 13px; color: var(--ch-muted); }
.ch-gruppo { display: flex; flex-direction: column; gap: 8px; }
.ch-gruppo[hidden] { display: none; }
.ch-gruppo-testa { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; transition: transform .35s var(--uscita); }
.ch-titoletto { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.ch-titoletto svg { color: var(--ch-ink); font-size: 15px; }
.ch-conta { min-width: 20px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--ch-soft); color: var(--ch-ink); text-align: center; }
.ch-lista { display: flex; flex-direction: column; gap: 8px; }

/* la riga di una lezione (ml-lezione + cl-riga) */
.ch-riga { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--ch-border); border-left: 4px solid #c3cfdb;
    transition: transform .35s var(--uscita), border-color .25s; }
.ch-riga[hidden] { display: none; }
.ch-riga.is-dichiarata { border-left-color: var(--ch-warn); }
.ch-riga.is-chiusa { border-left-color: var(--ch-pos); }
.ch-riga.is-lampo { animation: ch-lampo .9s ease-out; }
@keyframes ch-lampo { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); } 100% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); } }
.ch-riga.is-suggerita { animation: ch-anello 1.6s infinite; }
@keyframes ch-anello { 0% { box-shadow: 0 0 0 0 rgba(145, 220, 245, .8); } 100% { box-shadow: 0 0 0 12px rgba(145, 220, 245, 0); } }
.ch-ora { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 8px; border-radius: 10px; background: var(--ch-soft); }
.ch-ora b { font-size: 16px; font-weight: 700; color: var(--ch-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ch-ora small { font-size: 11.5px; color: var(--ch-muted); font-variant-numeric: tabular-nums; }
.ch-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ch-corpo > b { font-size: 15px; font-weight: 700; }
.ch-corpo > small { font-size: 12.5px; color: var(--ch-text-3); }
.ch-chip { flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--ch-grey-soft); color: var(--ch-text-3); }
.ch-chip.is-attesa { background: #fff7e6; color: var(--ch-warn-ink); }
.ch-chip.is-ok { background: #ecfdf3; color: var(--ch-pos-ink); }
.ch-chip.is-futura { background: var(--ch-grey-soft); color: var(--ch-muted); }

/* verdetto: come da programma (verde) o diversa (arancio) */
.ch-verdetto { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--ch-border); background: var(--ch-grey-bg); }
.ch-verdetto.is-uguale { background: #ecfdf3; border-color: #a6f4c5; }
.ch-verdetto.is-diversa { background: #fffbf2; border-color: #fde4b0; }
.ch-verdetto.is-vuoto { background: transparent; border-style: dashed; color: var(--ch-muted); }
.ch-verdetto-testa { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 13.5px; }
.ch-verdetto-testa svg { font-size: 15px; }
.ch-verdetto.is-uguale .ch-verdetto-testa { color: var(--ch-pos-ink); }
.ch-verdetto.is-diversa .ch-verdetto-testa { color: var(--ch-warn-ink); }
.ch-verdetto-testa small { color: var(--ch-muted); font-weight: 400; font-size: 11.5px; }
.ch-ore { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ch-navy); }
.ch-ore > span { display: flex; flex-direction: column; line-height: 1.1; }
.ch-ore small { font-size: 10.5px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: .02em; }
.ch-ore b { font-size: 16px; font-variant-numeric: tabular-nums; }
.ch-ore > svg { color: var(--lp-azzurrino); font-size: 12px; }
.ch-ore em { font-style: normal; font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; }
.ch-ore em.is-meno { background: var(--ch-soft); color: var(--ch-ink); }
.ch-ore em.is-zero { background: #ecfdf3; color: var(--ch-pos-ink); }
.ch-nota { font-size: 12.5px; color: var(--ch-text-2); }

/* il modulo della dichiarazione (cl-form), qui ridotto a tre scelte */
.ch-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; padding: 12px; border-radius: 12px; background: var(--ch-grey-bg); border: 1px solid var(--ch-border); animation: ch-apre .25s var(--uscita) both; }
.ch-form[hidden] { display: none; }
@keyframes ch-apre { from { opacity: 0; transform: translateY(-4px); } }
.ch-etichetta { font-size: 12px; font-weight: 600; }
.ch-stati { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-pill { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ch-border); background: #fff; color: var(--ch-navy); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.ch-pill:hover, .ch-pill:focus-visible { border-color: var(--lp-azzurro); background: var(--ch-soft); outline: none; }
.ch-aiuto { font-size: 11.5px; color: var(--ch-muted); }
.ch-link { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ch-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ch-azioni { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ch-azioni[hidden] { display: none; }

/* guida e messaggi (come l'agenda) */
.ch-guida { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 12px; background: var(--lp-tenue); color: var(--ch-navy); font-size: 13.5px; }
.ch-guida-n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lp-azzurro); color: var(--lp-navy-profondo); font-size: 12px; font-weight: 700; }
.ch-guida p { margin: 0; flex: 1; }
.ch-guida b { font-weight: 600; }
.ch-guida button, .ch-guida a { flex: 0 0 auto; font: inherit; font-size: 13px; font-weight: 600; color: var(--ch-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ch-guida.is-fine { background: var(--ch-navy); color: #fff; }
.ch-guida.is-fine .ch-guida-n { background: #6ee7b7; color: #05603a; }
.ch-guida.is-fine a, .ch-guida.is-fine button { color: var(--lp-azzurrino); }
.ch-toast { position: absolute; left: 50%; bottom: 74px; z-index: 40; translate: -50% 12px; max-width: min(92%, 440px); padding: 10px 14px; border-radius: 10px;
    background: var(--ch-navy); color: #fff; font-size: 13px; line-height: 1.4; box-shadow: 0 12px 30px rgba(22, 52, 89, .3); opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s var(--uscita); }
.ch-toast.is-neg { background: #fef2f2; color: var(--ch-neg-ink); box-shadow: 0 12px 30px rgba(180, 35, 24, .18), inset 0 0 0 1px #fecaca; }
.ch-toast.is-visibile { opacity: 1; translate: -50% 0; }

@media (max-width: 760px) {
    .ch { padding: 10px; gap: 10px; }
    .ch-kpis { grid-template-columns: 1fr 1fr; }
    .ch-riga { padding: 10px; gap: 10px; flex-wrap: wrap; }
    .ch-chip { order: -1; width: 100%; justify-content: flex-start; align-self: flex-start; }
    .ch-ora { min-width: 48px; }
    .ch-azioni .ch-btn { flex: 1; justify-content: center; }
    .ch-barra .ch-btn { width: 100%; justify-content: center; }
    .ch-riep-giorno, .ch-gruppo-testa { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .ch-riga, .ch-gruppo-testa, .ch-toast { transition: none; }
    .ch-riga.is-lampo, .ch-riga.is-suggerita, .ch-form { animation: none; }
}

/* il conto della giornata: cosa è entrato, cosa maturano gli istruttori, cosa resta alla scuola (si riempie confermando) */
.ch-soldi { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 10px 16px; align-items: center; margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid rgba(22, 52, 89, .12); }
.ch-soldi-titolo { display: flex; flex-direction: column; min-width: 0; }
.ch-soldi-titolo b { font-size: 14px; }
.ch-soldi-titolo small { font-size: 11.5px; color: var(--ch-muted); }
.ch-soldo { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ch-soldo small { font-size: 10.5px; color: var(--ch-muted); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-soldo b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ch-soldo.is-resta b { color: var(--lp-azzurro-ink, #0a7299); }
.ch-soldi.is-pieno { border-color: var(--lp-azzurro); background: var(--ch-soft); }
.ch-soldo b.is-lampo { animation: ch-soldo-lampo .6s cubic-bezier(.16, 1, .3, 1); }
@keyframes ch-soldo-lampo { from { transform: translateY(6px); opacity: .3; } }
@media (max-width: 760px) { .ch-soldi { grid-template-columns: 1fr 1fr; } .ch-soldi-titolo { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .ch-soldo b.is-lampo { animation: none; } }
